feat(api): split migration chains at the alignment point#4680
feat(api): split migration chains at the alignment point#4680jp-agenta wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4f35d7b to
6c47e27
Compare
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
Railway Preview Environment
|
a52e038 to
92530d5
Compare
407a0cf to
553a01a
Compare
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
92530d5 to
903f73e
Compare
8829687 to
d8682ac
Compare
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
d8682ac to
0145eed
Compare
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
e66be2c to
01b03ff
Compare
9b2e417 to
1e0e499
Compare
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
1e0e499 to
5bd61fd
Compare
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
Both legacy core chains gain a final empty align revision (a1167e5b0001, same id in both editions, per-edition parent) and park forever. New independent chains take over: the shared chain under oss/databases/postgres/migrations/ core_oss (alembic_version_oss, runs in both editions; EE reads it from the oss tree it ships) and the EE-only chain under ee/.../core_ee (alembic_version_ee). Runners gain the new steps with an explicit at-align assert before the new chains run; chain configs derive from the module location, so there is no path env var to misconfigure. Roots are empty markers; the adoption migration for OSS-to-EE switches lands in the ee chain in a follow-up. Design: docs/designs/oss-ee-convergence/migration-chains-and-edition-switch.md
No-op revision demonstrating the split works end to end: replaying either edition moves alembic_version_oss past the root while alembic_version stays parked at the align revision.
No-op revision demonstrating EE-only divergence: alembic_version_ee advances in EE databases while the shared and parked chains are untouched, and OSS never sees it.
align = a00000000000, shared chain root/proof = o00000000001/2, EE chain root/proof = e00000000001/2; file names and in-file revision/down_revision ids match the agreed scheme.
Mirror the core chain split for tracing (its own database): park the legacy tracing chain at park00000000, then a shared post-alignment chain tracing_oss (alembic_version_tracing_oss, root oss000000000 + proof) and an EE-only chain tracing_ee (alembic_version_tracing_ee, root ee0000000000 + proof). Wire both runners (oss: +migrate_tracing_oss; ee: +migrate_tracing_oss +migrate_tracing_ee). Same id scheme as core; tracing has its own version tables so ids do not collide. tracing_ee is root+proof only — no EE-only tracing tables to adopt on a switch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The split tracing chains tracked their versions in alembic_version_tracing_oss and alembic_version_tracing_ee; the tracing database has its own version tables, so the _tracing infix is redundant. Rename to alembic_version_oss / alembic_version_ee to match the core chains, updating env VERSION_TABLE, the runner utils log/error strings, and the chain root/proof/park docstrings in both editions.
The revision regex only matched [a-f0-9], so the split-chain ids that start
with a non-hex letter (oss chain 'o00...') parsed as zero revisions and
find_head reported an empty tree / 'Heads: []'. The ee chain ('e00...') and
legacy hex ids happened to pass. Widen the capture to [^"] like the
down_revision pattern already does, so any alembic id resolves.
5bd61fd to
5c39511
Compare
#4680 renames the chain-split migrations to the final ids; drop this branch's interim revert so the stack stays at the final scheme end to end.
Context
The OSS and EE alembic core chains are historically different and immutable, which makes an in-place OSS→EE switch impossible: an OSS database's
alembic_versionholds ids the EE chain cannot resolve. The convergence stack (#4671→#4676) brings the schemas to parity; this PR splits the migration chains at that point so the editions never re-fork and adoption becomes structurally possible. Design:docs/designs/oss-ee-convergence/migration-chains-and-edition-switch.md.Changes
a00000000000, same id in both editions with per-edition parents. The legacy chains park there forever;alembic_versionbecomes a frozen artifact.oss/databases/postgres/migrations/core_oss/tracked inalembic_version_oss. It runs in both editions; EE executes it from theoss/tree its images already ship, so shared migrations exist exactly once.ee/databases/postgres/migrations/core_ee/tracked inalembic_version_ee. All future EE-only schema lives here; it may reference only EE tables and forever-stable shared PKs.o00000000002shared,e00000000002EE-only) so the version tables can be watched moving independently. The OSS→EE adoption migration lands in the EE chain in feat(api): OSS-to-EE adoption migration on the EE chain #4683.Tests / notes
🤖 Generated with Claude Code