feat(compose): improve local development workflow - #1857
Conversation
Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
📝 WalkthroughWalkthroughThe compose development flow renames ChangesCompose development flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant dev-compose.sh
participant insight-init.sh
participant DockerCompose
participant cargo-watch
participant Analytics
Developer->>dev-compose.sh: run compose development flow
dev-compose.sh->>insight-init.sh: pass --no-frontend when requested
insight-init.sh->>DockerCompose: generate compose environment
Developer->>dev-compose.sh: run up --watch=analytics
dev-compose.sh->>DockerCompose: generate analytics watch override
DockerCompose->>cargo-watch: start watched Rust container
cargo-watch->>Analytics: rebuild and restart service
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
dev-compose.sh (1)
473-477: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winFail instead of launching Keycloak with an unreachable issuer.
When host-IP detection fails, this sets the issuer to
localhosteven though the adjacent warning confirms the authenticator cannot reach it. The stack starts, but all Keycloak login attempts fail. Return an error here and tell the developer to configure a reachable issuer.Proposed fix
- if [[ -z "$kc_ip" ]]; then - echo "WARN: no host IP detected — Keycloak issuer stays localhost (browser-only; the authenticator can't reach it)." >&2 - kc_ip="localhost" - fi + if [[ -z "$kc_ip" ]]; then + echo "ERROR: no host IP detected; cannot configure a Keycloak issuer reachable by both browser and authenticator." >&2 + return 1 + fi🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dev-compose.sh` around lines 473 - 477, Update the host-IP fallback in the Keycloak startup flow around kc_ip and detect_host_ip to fail immediately when no reachable host IP is detected, rather than assigning localhost. Emit an actionable error directing the developer to configure a reachable issuer, and prevent the stack from launching in this invalid state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@dev-compose.sh`:
- Around line 473-477: Update the host-IP fallback in the Keycloak startup flow
around kc_ip and detect_host_ip to fail immediately when no reachable host IP is
detected, rather than assigning localhost. Emit an actionable error directing
the developer to configure a reachable issuer, and prevent the stack from
launching in this invalid state.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 04621be4-bd84-4a35-b7bf-409d7f97c734
📒 Files selected for processing (12)
.env.compose.exampleCONTRIBUTING.mddeploy/compose/insight-init.shdeploy/compose/keycloak/README.mddeploy/compose/keycloak/gen-realm.pydeploy/compose/rust-watch.Dockerfiledeploy/seed/profiles.pydev-compose.shdocker-compose.ymlsrc/backend/services/fakeidp/README.mdsrc/backend/services/fakeidp/src/lib.rssrc/backend/services/fakeidp/users.yaml
Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
Summary
--watch=<service>execution for Compose-managed Rust services, initially supporting analyticsDEV_USER_EMAILand remove obsolete frontend impersonation wiring--no-frontendsetup and correct host-side ClickHouse probingValidation
bash -n dev-compose.sh deploy/compose/insight-init.shdocker compose config --quietfor the generated watch overrideSELECT 1probe onhost.docker.internal:8124via hostlocalhosthttp://localhost:5173/auth/callback