Repository navigation
feat(upstream): check the upstream migration history against upstream - #560
Merged
Merged
Conversation
Fork #538 added a fork migration to the upstream migration manifest as ID 51, which upstream already used for another migration. Nothing flagged it before two nightlies shipped it. `migrations:check` now requires the upstream manifest to be a prefix of upstream main's manifest (same IDs, names and modules), and every file under the upstream migration paths to match a version upstream has had. Fork Check runs it on every pull request and push, and the intake audit treats a mismatch as a blocking error. The audit's migration review reason also names the entries a candidate adds or changes.
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.
Note
Fork CI and the upstream intake audit now fail when the upstream migration manifest or migration files differ from upstream, so a fork migration can no longer take an upstream migration ID.
Fork #538 added its
ProjectionThreadLatestMessageAtmigration to the upstream manifest as ID 51. Upstream uses 51 forProjectionThreadMessageContext, and because the migrator treats the highest recorded ID as a watermark, databases that ran the fork migration would have skipped upstream's. Nothing caught this until the next intake conflicted with it, after two nightlies had shipped it (fixed in #550).Change
vp run --filter @t3tools/scripts migrations:checkcomparesapps/server/src/persistence/Migrations.tsand everything underapps/server/src/persistence/Migrations/with fetched upstreammain:mainand runs the check on every pull request and push.mainbefore the audit.a database migration changed: adds 50 ProjectionThreadPullRequests.docs/internals/fork-migrations.mddescribes the check. An early import of an unmerged upstream migration fails it until upstream merges the migration, since its ID can still change before then.Validation
mainpasses. The check takes about a tenth of a second.Upstream migration manifest position 51 is 51 ProjectionThreadLatestMessageAt (…), but upstream has 51 ProjectionThreadMessageContext (…).main, only the commits from feat(clients): choose thread activity timestamp #538 up to fix(server): move the latest message migration into fork history #550 fail. The 250 commits before feat(clients): choose thread activity timestamp #538 all pass, including the intakes that brought migrations 49 and 50.Blockedwith the migration errors anda database migration changed: adds 51 ProjectionThreadLatestMessageAt. On the upstream feat(pull-requests): link multiple pull requests to threads pingdotgg/t3code#10839 intake commit (feat(pull-requests): link multiple pull requests to threads pingdotgg/t3code#10839) it reportsa database migration changed: adds 50 ProjectionThreadPullRequestswithout errors.Written by an agent (Claude Code, claude-opus-5-5).