Repository navigation
fix(dev): the runner says which migration failed - #694
Merged
Merged
Conversation
Owner
Author
|
Review by GPT 6.1 Sol (codex, xhigh, one pass) on 136d7c1. Two findings, both fixed in f820aab:
|
A migration that failed on the way up left `pnpm dev` saying only that the supervisor exited: a step's SQL error is a defect in the Migrator, which the supervisor's tapError never saw, and a duplicate id was reported without the id. The supervisor now logs any migrate failure to dev.log as a marked `[dev] error:` line with the step and Postgres's reason, and `start` prints that line from the supervisor's own run. The sql package's loader names a duplicate id and both steps that claim it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
failureOf stops at the next supervisor's header, so a retry started before the first caller reads dev.log cannot lend it its error, and the reason is folded onto one line so the marked line carries all of it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
allisonmahmood
force-pushed
the
fix/186-dev-runner-migration-error
branch
from
October 15, 2026 20:34
f820aab to
69f6dee
Compare
allisonmahmood
added a commit
that referenced
this pull request
Oct 16, 2026
…u when they fail (#720) Release 13's What's new entry, written from `c9b8fc4`, ahead of deploying it. `patchy` and `CURRENT_RELEASE` move to `0.13.0`, so CLIs and patch repos installed before this deploy are told to upgrade. | Change | PRs | | --- | --- | | New: Home puts the patches you use first | #713, #716, #719 | | New: Every patch in one list | #715 | | Improved: Each patch's page leads with Open | #717 | | New: See when your tools are failing | #718 | | Fixed: Everyone has a name | #687 | | Improved: Your company's look is easier to get right | #697, #696, #703, #688 | | Improved: Forms follow your look's error states | #691, #692 | | Improved: Clearer answers when a publish goes wrong | #686, #685, #689 | | Fixed: Your agent's Patchy commands are steadier | #695, #704, #680, #681 | | Behind the scenes: stricter checks on static pages and tools' database requests; malformed requests are logged | #682, #693, #683 | | Behind the scenes: usage numbers count every publish, sharing change and restore | #698, #699, #700, #690 | | Test and tooling only, no line | #705, #702, #701, #694, #684, #607 | Made by Claude Opus 5.5 in Claude Code, running in T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
When a migration failed on the way up,
pnpm devsaid only "The supervisor exited before the server became healthy" anddev.loghad no[dev]line saying why. A step's SQL error is a defect in Effect's Migrator, so the supervisor'stapErrornever saw it, and a duplicate id was logged as "Found duplicate migration id's" without the id.Fix
dev.logas a marked[dev] error:line, worded like the seed's error:The dev database failed to migrate: <step>: <Postgres's reason>.startreads that line from the supervisor's own run (between itssupervisor pid=line and the next run's, so another run's failure is never shown) and prints it, then points atdev.log. If there's no such line, it prints the old message.@patchy/sql's loader names a duplicate id and both steps that claim it. The server's own migrate gets the clearer message too.Seed and package-build failures still go only to the supervisor's ignored stderr. That's the same kind of gap, but it's a separate change.
Tested by hand
pnpm dev upin this worktree with a migration temporarily broken, before and after (paths shortened):Duplicate id 14 (a second
0014_…step in@patchy/limits)Before:
After:
A failing step (
0015_broken_probe:SELECT * FROM no_such_table)Before: the same generic terminal line, and in
dev.logonly Postgres's ownERROR: relation "no_such_table" does not exist, with no[dev]line naming the migration.After:
With the break reverted,
pnpm dev upstill comes up healthy (scenario team), andpnpm dev downcleans it up.Tests: a duplicate-id case in
packages/sql/src/sql.test.ts, and afailureOfcase inscripts/dev/src/state.test.ts.Surfaces
docs/DEVELOPMENT.md(the migration paragraph under "The local instance") and thepatchy-dev-loopskill now say a failed migration prints which step failed and why. The vitest template is untouched because the seed didn't change.migratedoc comment says so.Closes #186
Made by Claude Opus 5.5 in Claude Code, running in T3 Code.