Skip to content

feat(api): OSS-to-EE adoption migration on the EE chain#4683

Open
jp-agenta wants to merge 3 commits into
feat/migration-chain-splitfrom
feat/oss-to-ee-adoption
Open

feat(api): OSS-to-EE adoption migration on the EE chain#4683
jp-agenta wants to merge 3 commits into
feat/migration-chain-splitfrom
feat/oss-to-ee-adoption

Conversation

@jp-agenta

@jp-agenta jp-agenta commented Jun 12, 2026

Copy link
Copy Markdown
Member

Context

The chain split (#4680) makes an in-place OSS→EE switch structurally possible: point the EE stack at the OSS databases and run the EE runner. This PR adds the revision that makes it actually work — the EE chain's adoption migration. Design: docs/designs/oss-ee-convergence/migration-chains-and-edition-switch.md.

Changes

One conditional revision (e00000000003) on the EE-only chain:

  • EE-origin database: every object exists, every backfill target is populated — complete no-op.
  • OSS-origin database (edition switch): creates meters_type and the four EE-only tables (subscriptions, meters, organization_domains, organization_providers) in their canonical post-cleanup shapes (six nullable lifecycle columns, billing FKs anchored to organizations(id) ON DELETE CASCADE), then backfills one subscription per organization on the configured free plan (get_free_plan(), anchor = adoption day) and the USERS gauge recomputed from organization_members. Domains and providers start empty.

References only EE tables and forever-stable shared PKs, per the chain rules.

What to QA

Replay an OSS database to head, switch the stack to EE (same postgres, POSTGRES_URI_* pointing at the agenta_oss_* databases), run the EE runner: the schema dump afterwards should be identical to a fresh EE database's dump except data-bearing rows; running the runner twice must be a no-op.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 14, 2026 6:40pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 742ee664-f9f7-4add-8da8-cbed3a5e88f9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/oss-to-ee-adoption

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. feature labels Jun 12, 2026
@jp-agenta jp-agenta changed the base branch from chore/ee-chain-proof to feat/migration-chain-split June 12, 2026 18:36
@junaway junaway force-pushed the feat/migration-chain-split branch from 4f35d7b to 6c47e27 Compare June 12, 2026 18:40
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from e1764f5 to c0c4f01 Compare June 12, 2026 18:40
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 631d499 to a500bff Compare June 13, 2026 06:19
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-2437.up.railway.app/w
Image tag pr-4683-cc4eb7e
Status Failed
Railway logs Open logs
Logs View workflow run
Updated at 2026-06-14T18:46:52.794Z

@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from a500bff to 9c11f6c Compare June 13, 2026 06:31
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 14, 2026
@junaway junaway force-pushed the feat/migration-chain-split branch from 407a0cf to 553a01a Compare June 14, 2026 13:06
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 8653507 to 01c058e Compare June 14, 2026 13:06
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jun 14, 2026
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 01c058e to 3cd35cc Compare June 14, 2026 13:10
@junaway junaway force-pushed the feat/migration-chain-split branch from 8829687 to d8682ac Compare June 14, 2026 13:25
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 3cd35cc to e717dae Compare June 14, 2026 13:26
@junaway junaway force-pushed the feat/migration-chain-split branch from d8682ac to 0145eed Compare June 14, 2026 13:59
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch 2 times, most recently from 7b7346f to 3d96326 Compare June 14, 2026 14:13
@junaway junaway force-pushed the feat/migration-chain-split branch from 9b2e417 to 1e0e499 Compare June 14, 2026 15:07
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 3d96326 to 3858d3f Compare June 14, 2026 15:07
@junaway junaway force-pushed the feat/migration-chain-split branch from 1e0e499 to 5bd61fd Compare June 14, 2026 15:38
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 3858d3f to 52d8077 Compare June 14, 2026 15:38
@junaway junaway force-pushed the feat/migration-chain-split branch from 5bd61fd to 5c39511 Compare June 14, 2026 15:44
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 52d8077 to 19e4325 Compare June 14, 2026 15:44
@junaway junaway force-pushed the feat/migration-chain-split branch from 5c39511 to e65c76a Compare June 14, 2026 17:14
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 19e4325 to 920dfd9 Compare June 14, 2026 17:15
@junaway junaway force-pushed the feat/migration-chain-split branch from e65c76a to 296ccc4 Compare June 14, 2026 18:01
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from 920dfd9 to c2f7973 Compare June 14, 2026 18:02
@junaway junaway force-pushed the feat/migration-chain-split branch from 296ccc4 to 3b889cb Compare June 14, 2026 18:09
@junaway junaway force-pushed the feat/oss-to-ee-adoption branch from c2f7973 to 588af2d Compare June 14, 2026 18:10
Conditional revision serving every flow: complete no-op on EE-origin
databases; on adopted OSS databases it creates the EE-only enum and tables in
their canonical post-cleanup shapes and backfills one subscription per org on
the configured free plan (anchor = adoption day) plus the USERS gauge from
organization_members. References only EE tables and forever-stable shared
PKs, per the chain rules.

Revision ee0000000002, down_revision ee0000000001 (the EE chain proof).
…tion

The hand-written CREATE TABLE declared organization_domains.meta and
organization_providers.meta as json, while the native EE migration
(59b85eb7516c) and the sibling flags/tags columns use jsonb. Align them so
a switched OSS database matches the native EE schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant