fix(db): fold seven raw-SQL identity tables into renameRepositoryIdentity#8409
Conversation
|
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 #8409 +/- ##
==========================================
- Coverage 92.17% 89.64% -2.54%
==========================================
Files 791 98 -693
Lines 79249 22841 -56408
Branches 23945 3892 -20053
==========================================
- Hits 73048 20475 -52573
+ Misses 5062 2187 -2875
+ Partials 1139 179 -960
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-24 12:15:45 UTC
Review summary Nits — 5 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.
|
Summary
A repository-rename webhook left seven raw-SQL-only, identity-bearing tables — all with confirmed live writers — pinned to the stale
owner/repo: the Orb PR-outcome ledger, the Orb webhook-delivery log, the live and shadow tunable overrides, the override-audit trail, and both predicted-gate history tables.renameRepositoryIdentitynow covers them, usingenv.DB.prepare(...)directly like the module's existingreview_audit/contributor_gate_history/submitter_statsblocks (none of these tables are in the Drizzle schema, per their own migration headers).Each table uses the fold strategy its real constraint requires — verified against each migration, not inferred from column names:
orb_pr_outcomesPRIMARY KEY (repository_full_name, pr_number)pr_number), same shape assubmitter_statsorb_webhook_eventsdelivery_id; repo column nullable, no uniquesignal_snapshotsoverride_auditidis randomova_<ts36>_<random>, project index non-uniquetunables_overrides/_shadowproject TEXT PRIMARY KEYrepositoriespredicted_gate_calibration_ledgerid,id+target_idembed projectproject/id/target_id+ PK-collision fold, identical toreview_auditpredicted_gate_callsid,idembeds projecttarget_id(this table has none)Closes #8380
Test plan
describeblocks intest/unit/repo-identity-rename.test.ts, each mirroring the existing raw-SQL blocks' style: rows move to the new name; the collision fold keeps the old row's data (asserted on real column values, not just row counts); a different PR/submitter/other-repo row under the new name survives untouched;orb_webhook_events' NULL-repo rows stay NULL;override_auditids are left verbatim; both predicted-gate tables get id/target_id rewrite and renamed-id-collision fold casessrc/db/repo-identity-rename.ts: 134/134 lines, 39/40 branches — the single partial branch is pre-existing at line 60, far outside this diff (lines 417-491), so every changed line and branch is coverednpm run typecheckclean