You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e91dd6
Browse filesBrowse the repository at this point in the historyBrowse files
dev-status and drop: say when Kafka or Redis is stopped (#415) (#419)
* dev-status: flag a stopped Postgres, Kafka or Redis container (#415)
One line per container that isn't running, with what fails and the compose
command that starts it; a Docker daemon that doesn't answer is one line for
all three. container_state in dev-servers-common.sh is now the one place
that tells the daemon from a container, and db_down_reason reads it.
A stopped container keeps the OK line away; the exit code is unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* dev-branch-servers: drop skips a stopped Kafka or Redis (#415)
drop asks once whether each of the Kafka and the Redis container runs and
skips that cleanup with one line, where it printed one docker error per
call; the database is still dropped and the exit code is unchanged, so
ship-branch still finishes. start's refusal names the container and the
compose command that starts it, from the same container_state.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* dev-branch-servers: a skipped cleanup says what is left behind (#415)
'not dropped' read as handled, but after the database is gone no drop
finds the topics or the Redis index again (#418). Review follow-up.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Pre-commit is the full-suite run (~10 min) for `backend/`: commit in the background.
71
71
`scripts/dev-env.sh` loads only the OAuth and GitHub App values from `infra/.env` (from a worktree, the main checkout's). That file is the production server's config: sourcing it whole overrides the dev CORS origins, JWT secret, database and Judge0 URL.
72
-
When the local app answers 403, acts like old code, doesn't show a change, or a button "does nothing", run `scripts/dev-status.sh` from the checkout or worktree whose code you expect. It flags a backend, worker or frontend running another checkout's code, a process older than its source (bootRun doesn't reload) or carrying production values, a database missing this checkout's migrations, a migration number another branch already ran under another name, a row of the gitignored `docs/PROBLEMS_MAPPING.md` that disagrees with the database, and a Judge0 that doesn't answer (every Run and Submit then fails, so check it before planning a UI check).
72
+
When the local app answers 403, acts like old code, doesn't show a change, or a button "does nothing", run `scripts/dev-status.sh` from the checkout or worktree whose code you expect. It flags a backend, worker or frontend running another checkout's code, a process older than its source (bootRun doesn't reload) or carrying production values, a `codebite-postgres`, `codebite-kafka` or `codebite-redis` container that isn't running (or a Docker daemon that doesn't answer), a database missing this checkout's migrations, a migration number another branch already ran under another name, a row of the gitignored `docs/PROBLEMS_MAPPING.md` that disagrees with the database, and a Judge0 that doesn't answer (every Run and Submit then fails, so check it before planning a UI check).
73
73
To see a branch's backend changes (migrations, endpoints, problems) or check its UI end to end, run `scripts/dev-branch-servers.sh` from its worktree instead of restarting or mocking the shared servers: that checkout's backend, worker and Vite on free ports, with a database, Kafka topics and Redis index of their own. From an agent, `start --detach`, then wait with `until scripts/dev-branch-servers.sh status >/dev/null; do sleep 2; done`. Its header lists the subcommands (`restart` after a new migration, `stop`, `drop`, `orphans`).
74
74
To sign in locally without OAuth (dev profile only), `POST /api/auth/test-token?username=<name>&role=ADMIN` returns a JWT; `role` (USER or ADMIN) also switches an existing user; left out, it keeps the role (new users are USER). An ADMIN token checks admin pages against real data. Check the UI from a session of your own: the Vite `scripts/dev-branch-servers.sh` prints (`127.0.0.1` at an unusual port), signed in by a test token from the branch backend. `localhost:5173`/`5174` and the user's Chrome tabs hold their real signed-in sessions, drafts and settings. Headless Chrome over CDP, as `scripts/walkthrough-app-check.mjs` drives it, needs neither: its own profile, any width by `Emulation.setDeviceMetricsOverride`, and screenshots to files. In the user's Chrome, `resize_window` may leave the window as it was: for phone width open a page of that Vite and replace its body with a 390px-wide `<iframe>` of the route; media queries follow the iframe, and it shares the page's sign-in and localStorage.
check "start refused with Kafka and Redis stopped""$code" 1
338
+
check "start names what to start""$out""dev-branch-servers.sh: the codebite-kafka container isn't running; start it: docker compose -f infra/docker-compose.yml up -d kafka
339
+
dev-branch-servers.sh: the codebite-redis container isn't running; start it: docker compose -f infra/docker-compose.yml up -d redis"
0 commit comments