Skip to content

chore(deploy): stage the production worker unbound ahead of the domain cutover - #191

Merged
MaximusHaximus merged 1 commit into
masterfrom
chore/prod-cutover-spec-swap
Jul 8, 2026
Merged

MaximusHaximus merged 1 commit into
masterfrom
chore/prod-cutover-spec-swap

Conversation

@MaximusHaximus

@MaximusHaximus MaximusHaximus commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

What

Prepares the production environment for the domain cutover: [env.production] deploys the Worker with no domain binding, so the polygon-static-production Worker exists as a deployment target before any hostname is attached to it.

Also removes the src/index.ts pass-through Worker script — the deployment is pure static assets (the shape staging already validated), so the script was unnecessary and the ESLint carve-out for it goes too.

Why this ordering

A hostname that is already live cannot simply be re-bound by a config push; the binding has to be attached to an existing Worker as a deliberate step. Deploying the Worker unbound first — and landing the custom_domain config as its own follow-up (#192) — makes every intermediate state safe: nothing routes to the new Worker until the domain is attached, and a premature production deploy fails harmlessly rather than affecting live traffic.

No changeset — all changes outside packages/meta/.

SPEC confirmed the zone-route binding we planned for the apex does not work — they
have tried it before, and it fails from CI just like custom_domain (code 100117 on
the externally-managed record; wrangler's clobber flag was removed by Cloudflare).
The sanctioned zero-downtime cutover, confirmed with SPEC and ordered so a stray
production dispatch is harmless at every step, is instead:

1. Deploy the production env with NO domain binding so the worker exists
   (polygon-static-production).
2. Immediately land a follow-up PR setting custom_domain = true. Until the swap,
   any production dispatch fails harmlessly at the domain-registration step (code
   100117) — wrangler deploys the script before registering domains, so nothing
   already deployed or bound is touched.
3. SPEC swaps the existing static.polygon.technology DNS record onto the worker in
   the Cloudflare dashboard — the actual zero-downtime cutover moment.
4. Dispatch production to verify wrangler now owns the domain (idempotent).

This PR is step 1's config: [env.production] drops the route and declares no domain
binding. The src/index.ts pass-through worker existed only to guarantee a route
could bind an assets-only deployment; with routes abandoned it is dead scaffolding,
so the deployment reverts to pure static assets (as staging already validated) and
the eslint carve-out for it is removed.

wrangler.toml, deploy.yml, and CLAUDE.md document the sequence. The ordering
matters: landing custom_domain BEFORE the swap means the only possible premature-
dispatch failure is a red run, whereas dispatching with no domain declared AFTER
the swap could remove the binding SPEC just created.
@MaximusHaximus
MaximusHaximus force-pushed the chore/prod-cutover-spec-swap branch from 666bff7 to 55a6fc3 Compare July 8, 2026 15:34
@MaximusHaximus
MaximusHaximus marked this pull request as ready for review July 8, 2026 15:36
@MaximusHaximus
MaximusHaximus requested a review from a team as a code owner July 8, 2026 15:36
@MaximusHaximus
MaximusHaximus merged commit b9f2db6 into master Jul 8, 2026
8 checks passed
@MaximusHaximus
MaximusHaximus deleted the chore/prod-cutover-spec-swap branch July 8, 2026 15:36
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

MaximusHaximus added a commit that referenced this pull request Jul 8, 2026
…m_domain

Step 2 of the apex cutover (sequence in #191). The production worker
(polygon-static-production, Version a9b0f239) is deployed and unbound; this lands
the standard custom_domain binding so the config already matches what SPEC will
create when they swap the DNS record onto the worker in the CF dashboard.

Ordering rationale: with custom_domain declared before the swap, a premature
production dispatch fails harmlessly at domain registration (code 100117) — the
script deploys first, and nothing routes to this worker yet. The reverse order
(swap first, config later) would leave a window where a deploy with no domain
declared could remove the binding SPEC just created. After the swap, deploys
idempotently own the domain and production works normally.
@MaximusHaximus MaximusHaximus changed the title chore(deploy): replace route cutover with SPEC dashboard-swap process chore(deploy): stage the production worker unbound ahead of the domain cutover Jul 8, 2026
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