Skip to content

OPN2: openproduct goes live on its own URLs - #8

Merged
pullely merged 1 commit into
mainfrom
orun/OPN-8-openproduct-goes-live
Nov 11, 2026
Merged

pullely merged 1 commit into
mainfrom
orun/OPN-8-openproduct-goes-live

Conversation

@pullely

@pullely pullely commented Nov 11, 2026

Copy link
Copy Markdown
Owner

The fourth and last task of OPN2: openproduct goes live on its own URLs. This PR's merge deploys core, the gateway, the website and the synthetic monitor to stage, then prod, and creates the two R2 media buckets. On this PR, every lane only verifies.

Stage and prod each serve from the openproduct account's workers.dev:

  • openproduct-web-<env>.openproduct.workers.dev, the website;
  • openproduct-gateway-<env>.openproduct.workers.dev, the API.

openproduct.live comes back at the prod switch (OPN3).

Deploy order (from orun plan, both triggers)

openproduct-media → openproduct-worker (core, after Hyperdrive and the migrations) → openproduct-gateway → openproduct-web, stage before prod. The synthetic monitor deploys alongside.

core (openproduct-worker)

  • It binds this repository's Hyperdrive.
  • It orders after openproduct-hyperdrive and openproduct-db-migrate. A deploy therefore never runs ahead of the ladder it reads.

The gateway

  • The openproduct-worker edge is now enforced. It was advisory while nothing deployed. On an estate built from nothing, the CORE service binding's target must exist first.
  • openproduct-media is back as an edge. A deploy that binds a missing bucket fails.
  • skipResourceProvisioning: true. infra/media owns the buckets, and the brokered workers-deploy token has no R2 permission.
  • Runtime secrets are best-effort. They ride optionalSecretEnv plus runtimeSecrets, so a key not yet stored is skipped by name:
    • LISTING_SEAM_SECRET
    • OPENPRODUCT_AUTH_SEAM_SECRET
    • SCREENSHOT_CAPTURE_URL/TOKEN
  • GITHUB_TOKEN is deliberately left out. secrets-live reads each name from the job's environment, and CI exports the workflow's own short-lived GITHUB_TOKEN. An unseeded workspace key would therefore push that token into the Worker. It joins both lists in the change that stores it.
  • SITE_ORIGIN moves to the website's workers.dev hosts.

The website

  • The gateway fallback no longer names the old account. platform.ts splits the platform's workers.dev subdomain (oruncloud, for api-edge) from the product's (openproduct). Before this change, the fallback would have called the monorepo deployment's gateway.
  • It reads its environment's console origin through subscription env: stage.orunbase.com on stage and app.orunbase.com on prod. The composition has no buildEnv.
  • It orders after the gateway.

infra/media (openproduct-media)

  • State moves to the platform: backend "http" {}.
  • No AWS. The Secrets Manager wiring secret is gone, and nothing read it.
  • It is discovered, and applies on the merge.
  • Brokered token: CLOUDFLARE_R2_TOKEN (r2-data, account-wide R2 Storage Write) on stage and prod.
  • Unchanged: the bucket name openproduct-media-<env> and its location.

infra/synthetic

Its API_ORIGIN and SITE_ORIGIN point at the new hosts, with matching test expectations.

Secrets stored for this merge (workspace openproduct-live)

  • Brokered:
    • CLOUDFLARE_API_TOKEN for prod (workers-deploy). Stage already had one.
    • CLOUDFLARE_R2_TOKEN for stage and prod.
  • Generated per environment: LISTING_SEAM_SECRET and OPENPRODUCT_AUTH_SEAM_SECRET, piped over stdin and never printed.

Departure from OPN2's done-when

Password sign-in moves to OPN3. The platform's identity-worker holds one OPENPRODUCT_AUTH_SEAM_SECRET, the monorepo deployment's.

  • The new site can't sign anyone in by password until the platform holds the new key.
  • Giving the platform the new key cuts the old site off, which is the domain switch.

Recorded in IMPLEMENTATION-STATUS.md.

Checks (local)

  • Tests: core 881, web 1,481, gateway 341, synthetic 38.
  • Typecheck and lint: clean.
  • terraform validate passes on infra/media, and orun validate passes.
  • orun task check OPN-8: 6 changed components, all inside the contract.
  • web-perf failed locally on one axe target-size check on a forum thread page. This change doesn't touch that page. CI is the judge.

🤖 Generated with Claude Code

core, the gateway, the website and the synthetic monitor deploy stage and
prod on the merge to main (and on a dispatch from Orunbase), and still only
verify on pull requests.

- core binds this repository's Hyperdrive: its template's wiring tokens and
  fixture name openproduct-hyperdrive, and each stage and prod lane resolves
  WIRING_OPENPRODUCT_HYPERDRIVE for both environments. It orders after
  Hyperdrive and the migration ladder.
- Runtime secrets ride on optionalSecretEnv plus runtimeSecrets, so a key not
  stored yet is skipped by name. GITHUB_TOKEN stays out until the owner
  stores one: secrets-live would otherwise push the workflow's own token.
- The gateway orders after core and the media bucket, and skips wrangler's
  resource provisioning, which the deploy token has no R2 permission for.
- The website reads the openproduct account's workers.dev subdomain, gets its
  console origin per environment through subscription env, and orders after
  the gateway. platform.ts splits the platform's subdomain from the product's,
  so the gateway fallback no longer names the old account's gateway.
- infra/media keeps its state on the platform, loses AWS, and is discovered.
- Every self-reference names the openproduct workers.dev hosts until the prod
  switch (OPN3) brings back openproduct.live.

Orun-Task: OPN-8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pullely
pullely merged commit 5070529 into main Nov 11, 2026
18 checks passed
@pullely
pullely deleted the orun/OPN-8-openproduct-goes-live branch November 11, 2026 22:15
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