feat(db): drop the dead gate_check_mode column - #5446
Conversation
gate_check_mode has been a pure computed read-back of review_check_mode since #4618 (migrations/0107 backfilled review_check_mode from it and made it the real publish authority) -- getRepositorySettings and upsertRepositorySettings have re-derived it from review_check_mode on every read and write since then, self-healing any stale stored value. The stored column has carried no independent information for any live row since that migration. migrations/0146_drop_gate_check_mode.sql drops it (SQLite 3.35+/D1 supports DROP COLUMN directly, same as the 0122 precedent). Stops writing/reading the physical column in repositories.ts -- the in-memory RepositorySettings.gateCheckMode field itself is untouched and keeps being derived from reviewCheckMode on every read, so this is not yet the full field removal (tracked as a later #5373 stage). Pre-flight: grepped the full repo for raw SQL against gate_check_mode outside src/db/repositories.ts and found none in production code. Two test files needed updates: repository-settings-review-check-mode.test.ts had one test whose whole premise was self-healing over a stale physical column (removed, since there's no column left to drift), and queue-5.test.ts had a raw SQL assertion on the dropped column (switched to review_check_mode, the value it was actually trying to verify) plus 43 occurrences of gateCheckMode as pure fixture noise never asserted on elsewhere in that file -- not caught by the earlier #5373 discovery audit, found here while fixing the real column-drop fallout. migration-0107-review-check-mode.test.ts is correctly unaffected: it replays migrations up to a historical cutoff, never applying 0146.
|
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 #5446 +/- ##
==========================================
- Coverage 94.46% 94.46% -0.01%
==========================================
Files 554 554
Lines 44438 44437 -1
Branches 14663 14662 -1
==========================================
- Hits 41979 41978 -1
Misses 1784 1784
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 19:55:59 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory 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://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Stage 2.6 of #5373's staged removal plan.
gate_check_modehas been a pure computed read-back ofreview_check_modesince Reduce redundant config surface: linked-issue knob, gateCheckMode, label fields #4618 (migration 0107 backfilledreview_check_modefrom it and made it the real publish authority) --getRepositorySettings/upsertRepositorySettingshave re-derived it fromreview_check_modeon every read and write since then, self-healing any stale stored value. The stored column has carried no independent information for any live row since that migration.migrations/0146_drop_gate_check_mode.sqldrops it (SQLite 3.35+/D1 supportsDROP COLUMNdirectly -- same precedent as0122_drop_private_trust_enabled.sql). Stops writing/reading the physical column inrepositories.ts; the in-memoryRepositorySettings.gateCheckModefield itself is untouched and keeps being derived fromreviewCheckModeon every read -- this is not the full field removal yet (a later Stage and remove the derived-only gateCheckMode field (naming sprawl, #5355 follow-up) #5373 stage).gate_check_modeoutsidesrc/db/repositories.tsand found none in production code (also checkedscripts/**,review-enrichment/**, self-host observability/Grafana configs -- clean). Two test files needed updates:repository-settings-review-check-mode.test.tshad one test whose whole premise was self-healing over a stale physical column (removed -- there's no column left to drift);queue-5.test.tshad a raw SQL assertion on the dropped column (switched toreview_check_mode, the value it was actually trying to verify) plus 43 occurrences ofgateCheckModeas pure fixture noise never asserted on elsewhere in that file -- not caught by the earlier Stage and remove the derived-only gateCheckMode field (naming sprawl, #5355 follow-up) #5373 discovery audit, found here while fixing the real column-drop fallout.migration-0107-review-check-mode.test.tsis correctly unaffected: it replays migrations up to a historical cutoff, never applying 0146.npm run deploy:api(which applies migrations then deploys the Worker in one invocation) is run manually. No separate atomicity concern beyond that existing, already-used pattern.Test plan
npm run typechecknpm run db:migrations:check(149 migrations, contiguous 0001-0146)npm run db:schema-drift:check(schema.ts matches migrations/)test/unit/repository-settings-review-check-mode.test.ts,migration-0107-review-check-mode.test.ts,queue-5.test.ts,backfill.test.ts,backfill-2.test.ts-- 445/445gate_check_modeoutside the intentionally-unaffected historical-replay test