Skip to content

fix(cf-v2): superseded Production deployments become inactive, not success with a blank URL - #90

Merged
ClaudiaFang merged 1 commit into
mainfrom
fix/prod-deployment-environment-url
Nov 4, 2026
Merged

ClaudiaFang merged 1 commit into
mainfrom
fix/prod-deployment-environment-url

Conversation

@ClaudiaFang

Copy link
Copy Markdown
Member

Evidence

The reported empty environment_url on Production deployments is not an engine URL bug. All three deployments are runs that published nothing:

  • heaven-www www/prod 7538001174 (run 41773874599, Deploy job 126389888576): Superseded (start): a newer push of this branch owns the target. Nothing further is built, migrated or published by this run. Build/Publish/Smoke/Verified all skipped; report prints stale=true, target_url=.
  • blog blog/prod 7538093167 (job 126392131676): same stale guard, stale=true.
  • blog blog/prod 7538097823 (job 126392248396): failed at the migration gate: the migration for production was skipped because its run became stale.

A real publish does expose the URL: run_publish passes APP_URL=$(target_url) (falls back to app_url_prod), publish.sh:92 prints url=, verified re-emits url=; test-deploy.sh:139 asserts it. (Earlier heaven-www run 40633497812 logged Evaluated environment url: https://www.heaveninfo.workers.dev; older job layout, so indirect evidence.)

Root cause of the misleading record

GitHub appends success to the Environment deployment when the Deploy job ends (_cf-worker-delivery.yml deploy.environment), even when the stale guard skipped every publish step, so a superseded run shows "success" with a blank URL.

Fix

New Smoke-job step (runs after Deploy ended; Production only; only when the hand-off has stale == "true") appends inactive to the newest <app>/prod deployment at GITHUB_SHA. deployments: write was already granted. Deploy/smoke/rollback/release, ledger/stale rules, deploy_url/deploy_verified_url and Preview behavior are unchanged; published or failed runs are untouched.

Test

scripts/cf-preview/test-workflow-contract.py: new checks, executed against a stub gh. Before the workflow change: FAIL: Smoke: a step marks a superseded Production deployment inactive. After: that check plus 4 behavior checks (superseded -> inactive, fresh run / empty hand-off -> nothing, Preview untouched, permissions/secrets) pass.

Gate (local)

scripts/cf-preview/test.sh full -> PASSED (full) (contract, node unit+cli, deploy, migrate, smoke, parse-env, probe, gh, testsh, gc unit, delivery chain groups). Not run locally: shellcheck and actionlint (not installed; installing a remote script was declined) - CI runs both.

Compatibility

Consumers use floating v2: merging does NOT change what they run until the maintainer moves the tag. After the tag moves, a superseded Production run will show inactive ("Superseded by a newer push before publish; nothing deployed") instead of success; real publishes are unchanged.

Rollback

Revert this commit (single workflow step + tests); or do not move v2.

Remaining risks

Only 3 deployments + 1 older run were examined; a non-stale v2 Production deploy with no URL would be a different cause. On a re-run of the same SHA the "newest deployment at this SHA" is marked (same rule as existing mark-env-deployment).

🤖 Generated with Claude Code

…of success with a blank URL

When the stale guard supersedes a Production run, no publish step runs, but GitHub still
appends `success` (no environment_url) to the Environment deployment when the Deploy job
ends. The Smoke job, which runs after Deploy, now appends `inactive` to that deployment
when the hand-off says stale=true. Production only; published, failed and Preview
deployments and all deploy/smoke/rollback/release semantics are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@ClaudiaFang
ClaudiaFang merged commit b01494a into main Nov 4, 2026
1 check passed
@ClaudiaFang
ClaudiaFang deleted the fix/prod-deployment-environment-url branch November 4, 2026 06:23
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