Skip to content

OPN2: Hyperdrive and the migration ladder - #7

Merged
pullely merged 1 commit into
mainfrom
orun/OPN-7-hyperdrive-and-the-migration-ladder
Nov 11, 2026
Merged

pullely merged 1 commit into
mainfrom
orun/OPN-7-hyperdrive-and-the-migration-ladder

Conversation

@pullely

@pullely pullely commented Nov 11, 2026

Copy link
Copy Markdown
Owner

The third task of OPN2: Hyperdrive over openproduct's two Supabase projects, and the migration ladder on both. This PR's merge creates two Hyperdrive configs (stg-openproduct-stage, prod-openproduct-prod) and applies the 52-step ladder to openproduct-stage, then openproduct-prod. On this PR, Hyperdrive runs terraform.plan-only and the migrations run db-migrate.plan, which is offline.

infra/hyperdrive (openproduct-hyperdrive)

From orun-cloud ffb71be69, with only the changes design §11 names, made the way lumen's cloudflare-hyperdrive makes them:

  • State on the platform: backend "http" {}.
  • No AWS. The origin derives from SUPABASE_PROJECT_REF and SUPABASE_DB_PASSWORD, which OPN2: the Supabase projects come up #6's apply published. The derivation is the old payload's: db.<ref>.supabase.co:5432, user and database postgres.
  • The wiring is published as a secret. The wiring output, {hyperdrive_id, hyperdrive_name}, becomes WIRING_OPENPRODUCT_HYPERDRIVE via secretOutputs. core reads it when it goes live (the next task).
  • Brokered token: CLOUDFLARE_HYPERDRIVE_TOKEN comes from the openproduct Cloudflare connection (hyperdrive-edit), on stage and prod. Prod also gained CLOUDFLARE_ACCOUNT_ID.
  • Unchanged: the resource, its name, cloudflare ~> 4.30, and caching on.

infra/db-migrate (openproduct-db-migrate)

The runner

  • It reads its project from SUPABASE_PROJECT_REF (loadProjectRef, with a test) and drops @aws-sdk/client-secrets-manager.
  • The lockfile drops only that package. The other AWS packages in it belong to OpenNext.

Checks (local)

  • typecheck + lint: 22 of 22 tasks pass
  • @openproduct/db: 24 files and 574 tests pass, 1 skipped
  • The build reports Packages in scope: @openproduct/db. The built CLI's plan lists the ladder offline, and apply without the ref fails naming SUPABASE_PROJECT_REF.
  • terraform validate and orun validate pass. orun task check OPN-7: 4 changed components, all inside the contract.
  • Plans: stage then prod for both new components. core verifies as a dependent of openproduct-db.

🤖 Generated with Claude Code

infra/hyperdrive and infra/db-migrate arrive from orun-cloud ffb71be69 as
they are, with the changes design §11 names, made the way lumen makes them.
Hyperdrive keeps its state on the platform, builds its origin from the
SUPABASE_PROJECT_REF and SUPABASE_DB_PASSWORD secrets openproduct-supabase
published, and publishes WIRING_OPENPRODUCT_HYPERDRIVE instead of writing
Secrets Manager. Its token is brokered from the openproduct Cloudflare
connection (hyperdrive-edit). db-migrate loses its AWS parameters and
builds @openproduct/db through stack-tectonic 0.22.0's buildFilter.

The runner reads its project from SUPABASE_PROJECT_REF and drops
@aws-sdk/client-secrets-manager. A new migration is scheduled through the
input edge on openproduct-db instead of a mirrored migrations.lock.

The merge applies stage, then prod: two Hyperdrive configs and the 52-step
ladder on both databases.

Orun-Task: OPN-7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pullely
pullely merged commit 0aeb50a into main Nov 11, 2026
11 checks passed
@pullely
pullely deleted the orun/OPN-7-hyperdrive-and-the-migration-ladder branch November 11, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant