Skip to content

feat(upstream): check the upstream migration history against upstream - #560

Merged
incognitojam merged 1 commit into
mainfrom
fix/upstream-migration-manifest-check
Sep 30, 2026
Merged

incognitojam merged 1 commit into
mainfrom
fix/upstream-migration-manifest-check

Conversation

@incognitojam

Copy link
Copy Markdown
Owner

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 ProjectionThreadLatestMessageAt migration to the upstream manifest as ID 51. Upstream uses 51 for ProjectionThreadMessageContext, 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:check compares apps/server/src/persistence/Migrations.ts and everything under apps/server/src/persistence/Migrations/ with fetched upstream main:
    • the fork's manifest must be a prefix of upstream's, with the same ID, name and module at each position. A fork-only entry, a renamed entry, or a later upstream migration imported without the earlier ones fails;
    • every file must match a version upstream has had at that path, so upstream edits to its own tests do not cause failures while the fork trails.
  • Fork Check fetches upstream main and runs the check on every pull request and push.
  • The intake audit runs the same check on the candidate and reports mismatches as blocking errors. The Fork CI intake job and the promotion workflow fetch upstream main before the audit.
  • The audit's "a database migration changed" review reason now names what changed, for example a database migration changed: adds 50 ProjectionThreadPullRequests.
  • docs/internals/fork-migrations.md describes 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


Written by an agent (Claude Code, claude-opus-5-5).

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.
@incognitojam
incognitojam merged commit 6719b02 into main Sep 30, 2026
18 checks passed
@incognitojam
incognitojam deleted the fix/upstream-migration-manifest-check branch September 30, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant