Skip to content

fix(db): renumber the two newer 0134 migrations to resolve the 0134 collision#4578

Closed
davion-knight wants to merge 1 commit into
JSONbored:mainfrom
davion-knight:fix-migration-0134-collision
Closed

fix(db): renumber the two newer 0134 migrations to resolve the 0134 collision#4578
davion-knight wants to merge 1 commit into
JSONbored:mainfrom
davion-knight:fix-migration-0134-collision

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Three PRs each landed a migration numbered 0134, so check-migrations fails on main and every open contributor PR inherits the duplicate:

check-migrations: duplicate migration number 0134:
  "0134_pr_last_backlog_convergence_regated_at.sql",
  "0134_predicted_gate_calls.sql",
  "0134_review_targets_cadence_idx.sql".

Fix

Keep the earliest-merged file at 0134 (it pairs with 0135_backlog_convergence_fanout_marker.sql from the same PR) and renumber the two later ones to the next free numbers, preserving merge order:

was now migrated
0134_review_targets_cadence_idx.sql 0136_review_targets_cadence_idx.sql CREATE INDEX on review_targets
0134_predicted_gate_calls.sql 0137_predicted_gate_calls.sql CREATE TABLE predicted_gate_calls

Pure git mv renames — no SQL content changes (0 insertions / 0 deletions). The three migrations touch independent objects (a pull_requests column, a review_targets index, a new table), so ordering is unaffected. Same shape as the recent 0131 collision fix (#4554).

Validation

  • npm run db:migrations:check140 migrations OK — contiguous 0001..0137, no new duplicates. Next free: 0138
  • No duplicate numbers remain (only the pre-existing grandfathered 0015/0017/0074/0090).
  • git grep confirms no code references either migration by filename; no migrations manifest to regenerate.
  • npm run engine-parity:drift-check → ok (unaffected).

…ollision

Three PRs landed a migration numbered 0134 (pr_last_backlog_convergence_regated_at,
review_targets_cadence_idx, predicted_gate_calls), so check-migrations fails on main and
blocks the queue. Keep the earliest at 0134 and renumber the two later ones to the next
free numbers (0136, 0137), preserving merge order. Pure renames; no SQL changes.
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 10, 2026 05:19
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@f366b1d). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4578   +/-   ##
=======================================
  Coverage        ?   94.12%           
=======================================
  Files           ?      429           
  Lines           ?    38131           
  Branches        ?    13905           
=======================================
  Hits            ?    35889           
  Misses          ?     1585           
  Partials        ?      657           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 10, 2026
@loopover-orb

loopover-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-10 05:32:40 UTC

2 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · unstable

🛑 Suggested Action - Reject/Close

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR is a pure `git mv` renumbering of two migrations that collided with an already-merged `0134_pr_last_backlog_convergence_regated_at.sql`, moving `0134_review_targets_cadence_idx.sql` → `0136` and `0134_predicted_gate_calls.sql` → `0137` with zero SQL content changes. The renamed files' full content confirms no D1-forbidden constructs (no CREATE TEMP, ATTACH/VACUUM/PRAGMA, no explicit transaction control) and both use idempotent `IF NOT EXISTS` guards, and the three original 0134 files touch independent objects (a `pull_requests` column, a `review_targets` index, a new `predicted_gate_calls` table) so the renumber doesn't change effective ordering or behavior. Validation output confirms contiguous 0001..0137 numbering with no new duplicates, which is exactly what `check-migrations` requires.

Nits — 3 non-blocking
  • Since this PR only fixes the collision as of its branch point, another concurrently-open PR could independently grab 0136 or 0137 before this merges — worth a final `db:migrations:check` re-run right before merge to catch a fresh race.
  • Nothing further needed for a pure-rename fix of this shape; the validation evidence (contiguous count, next-free number, no code references to the old filenames) is sufficient given zero content changes.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

Why this is blocked

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 94 registered-repo PR(s), 57 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 94 PR(s), 3 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 94 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 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.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown

Gittensory is closing this pull request on the maintainer's behalf (No linked issue detected; Maintainer requires a linked issue). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant