Repository navigation
fix(dev): Start compose services and apply migrations when pnpm dev starts - #2421
Merged
Merged
Conversation
pnpm dev did not run migrations, so the first request against a fresh database failed with `relation "junior_users" does not exist`. Run `junior upgrade` after the package builds and before Nitro and the queue worker start. It skips migrations that already ran, so it is safe on every start. Co-Authored-By: Thomas Jiang <20501235+thomasjiangcy@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Run `docker compose up -d --wait` first, so `junior upgrade` finds a healthy Postgres without a manual step. Fail with a clear message when a required command such as `docker` cannot run.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a7c04b4. Configure here.
thomasjiangcy
approved these changes
Oct 30, 2026
Without a fixed project name, Compose names the project after the checkout folder. A worktree then starts a second project on the same host ports and pnpm dev fails with a bind error. Name the project junior so every checkout reuses the same services.
This reverts commit 362db17. Co-Authored-By: Thomas Jiang <20501235+thomasjiangcy@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

pnpm devdid not start the local services or run migrations. Against a fresh database, the first conversation request failed with a 500:relation "junior_users" does not exist. Contributors had to know to rundocker compose up -dandpnpm cli -- upgradefirst.scripts/dev-server.mjsnow does both before the app starts:docker compose up -d --waitstarts Postgres, Redis and S3 fromcompose.yamland waits for their health checks. Services that already run are left as they are.junior upgrade(the example app's installed bin, on the fresh build) applies missing core and plugin migrations. Migrations that already ran are skipped.If either step fails,
pnpm devstops with that command's error instead of serving a broken app.runRequiredChildnow also stops with a clear message when a command cannot run at all, for example whendockeris not installed. Before, a missing command was ignored. The contributor docs (contribute/development.md) describe this.Verified locally (no
.env.local):pnpm devstarted all three, waited until they wereHealthy, reportedDatabase is up to date (88 migrations)., then started Nitro.POST /api/conversationsreturned 200accepted, and the worker loggedconversation.work.lease.acquired.Applied 88 migrations (88 total)., then the same request and lease. The turn stopped at model auth, which is expected with no gateway key.DATABASE_URL:junior command failed: connect ECONNREFUSED ..., exit code 1.dockeronPATH:Failed to run docker: spawnSync docker ENOENT, exit code 1.node --checkpass on the changed files.Open question: Docker is now required for
pnpm dev. Someone who pointsDATABASE_URLand Redis at their own services still needs Docker running. Add an opt-out only if someone needs it.No automated test added: this is dev-script wiring.
--
View Session [Sentry]