fix(db): stop documenting 0090 as a grandfathered migration duplicate - #9832
Conversation
`KNOWN_MIGRATION_DUPLICATES` (src/db/migration-collisions.ts) is already correct — 0090 is not a key, because JSONbored#8897 renumbered 0090_pull_request_detail_sync_head_sha to 0092, leaving a single 0090_contributor_cap_label file. But check-migrations.ts's header still listed 0090 as a grandfathered duplicate and cross-referenced "0074/0090", so a future reader could re-add the dead entry from git history. Replace the 0090 bullet with a note that it was renumbered (not grandfathered) and correct the 0156 cross-reference to name only real grandfathers (0074). No script or KNOWN_MIGRATION_DUPLICATES behaviour change. Add two guards so the header and the data cannot silently diverge again: every filename in KNOWN_MIGRATION_DUPLICATES must exist in migrations/ (a re-added 0090 fails this), and every on-disk migration number with more than one file must be a key (a new un-grandfathered collision fails this). Closes JSONbored#9653
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-29 12:45:22 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9832 +/- ##
=======================================
Coverage 91.59% 91.59%
=======================================
Files 915 915
Lines 112700 112700
Branches 27077 27077
=======================================
Hits 103229 103229
Misses 8144 8144
Partials 1327 1327
Flags with carried forward coverage won't be shown. Click here to find out more. |
What & why
KNOWN_MIGRATION_DUPLICATES(src/db/migration-collisions.ts) is already correct — 0090 is not a key, because #8897 renumbered0090_pull_request_detail_sync_head_shato0092, leaving a single0090_contributor_cap_labelfile at 0090. Butscripts/check-migrations.ts's header still documented 0090 as a grandfathered duplicate and cross-referenced "same reasoning as 0074/0090", so a future reader could re-add the dead entry straight from git history.The fix
KNOWN_MIGRATION_DUPLICATES(which is not edited).npm run db:migrations:checkstill reports the same "4 grandfathered duplicates: 0015, 0017, 0074, 0156".Tests (
test/unit/migration-collisions.test.ts)Two guards so the header comment and the data can't silently diverge again:
KNOWN_MIGRATION_DUPLICATESexists in the realmigrations/directory — a re-added 0090 entry (naming the renumbered-away file) fails this (verified by injecting one).KNOWN_MIGRATION_DUPLICATES— the reverse direction, so a new un-grandfathered collision surfaces here, not only at premerge.Validation
npm run db:migrations:checkgreen;npm run typecheckgreen; the migration-collisions and check-migrations-script suites green.scripts/**is outside Codecov's include, so the comment change carries no coverage obligation; the new tests importsrc/db/migration-collisions.ts, so coverage collection sees realsrc/**files.git diff --check <base> HEADclean; diff is two files, nosrc/**source or migration change.Closes #9653