Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

fix(db): merge the two divergent Alembic heads on main - #555

Merged
Peyton-Spencer merged 1 commit into
mainfrom
peyton/merge-divergent-alembic-heads
Jul 28, 2026
Merged

fix(db): merge the two divergent Alembic heads on main#555
Peyton-Spencer merged 1 commit into
mainfrom
peyton/merge-divergent-alembic-heads

Conversation

@Peyton-Spencer

@Peyton-Spencer Peyton-Spencer commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

main is currently red and undeployable. It has two Alembic heads, so every migration run fails with:

alembic.util.exc.CommandError: Multiple head revisions are present for given
argument 'head'; please specify a specific target revision ...

That takes down the entire database test tier (1183 errors + 4 failures on the last main CI run) and the deploy. CI is failing on main itself at deead2d, and the Deploy job failed at d3ffc730.

The two heads

Revision File down_revision
f4b7d2c91ae5 2026_07_27_add_never_disclose_release_policy (#505) b2e9d4a17c60
c7a4f1e2b903 2026_07_27_reinstate_an_evicted_submission a7c14f8bd260

Both were written against different tips and merged without either being rebased onto the other. This is the ordinary way it happens: Alembic linears by down_revision, not by merge date, so nothing about the git merge forced them into a single chain. The repo's own guidance (CLAUDE.md, "rebase onto current origin/main before renumbering") is aimed at exactly this.

The fix

An empty merge point. No upgrade/downgrade body, on purpose — neither branch's schema changes are altered, re-run, or reordered by this revision. It only rejoins the chain so head is singular again. The two branches touch unrelated tables (release policy vs. submission-queue reinstate), so the order in which they land carries no schema meaning.

Verification

  • alembic heads45ef71514f21 (head), singular.
  • make lint and make typecheck clean.
  • make test2473 passed.

One note worth recording for whoever hits this next: the first full run on a fresh worktree came back with 513 failures. That was a stale cached test-DB template (built against the broken chain), not the fix — make test-db-reset and the run is green. If you review this and see mass DB failures locally, reset the template before believing them.

Scope

Found while rebasing #554 onto current main; that PR touches zero files under alembic/ and inherited this failure rather than causing it. Split out as its own PR because it is a main-wide breakage that should merge on its own schedule rather than riding behind an unrelated review — #554 goes green once this lands.

Ownership really sits with #505, so if its author would rather fix it their own way, close this. It is here because main is red right now.

🤖 Generated with Claude Code

main has two heads, so every migration run fails with "Multiple head
revisions are present for given argument 'head'". That takes the entire
database test tier and the deploy down with it: CI is red on main itself
at deead2d and Deploy failed at d3ffc73.

  f4b7d2c91ae5  add_never_disclose_release_policy (#505), from b2e9d4a17c60
  c7a4f1e2b903  reinstate_an_evicted_submission,        from a7c14f8bd260

Both were written against different tips and merged without either being
rebased onto the other. Alembic linears by down_revision, not by merge
date, so nothing about the git merge forced them into one chain.

Empty merge point, deliberately: no upgrade/downgrade body, so neither
branch's schema changes are altered, re-run, or reordered. It only rejoins
the chain so `head` is singular again. The two branches touch unrelated
tables, so their relative order carries no schema meaning.

Verified: `alembic heads` reports one head; full suite 2473 passed after a
`make test-db-reset` (the cached template was built against the broken
chain).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Peyton-Spencer

Copy link
Copy Markdown
Contributor Author

Blocks #554 (CI only — #554 touches no migrations).

@Peyton-Spencer
Peyton-Spencer marked this pull request as ready for review July 28, 2026 17:25
@Peyton-Spencer
Peyton-Spencer merged commit 94f818c into main Jul 28, 2026
7 checks passed
@Peyton-Spencer
Peyton-Spencer deleted the peyton/merge-divergent-alembic-heads branch July 28, 2026 17:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant