Repository navigation
fix(cf-v2): superseded Production deployments become inactive, not success with a blank URL - #90
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evidence
The reported empty
environment_urlon Production deployments is not an engine URL bug. All three deployments are runs that published nothing:www/prod7538001174 (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 allskipped; report printsstale=true,target_url=.blog/prod7538093167 (job 126392131676): same stale guard,stale=true.blog/prod7538097823 (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_publishpassesAPP_URL=$(target_url)(falls back toapp_url_prod),publish.sh:92printsurl=,verifiedre-emitsurl=;test-deploy.sh:139asserts it. (Earlier heaven-www run 40633497812 loggedEvaluated environment url: https://www.heaveninfo.workers.dev; older job layout, so indirect evidence.)Root cause of the misleading record
GitHub appends
successto the Environment deployment when the Deploy job ends (_cf-worker-delivery.ymldeploy.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") appendsinactiveto the newest<app>/proddeployment atGITHUB_SHA.deployments: writewas already granted. Deploy/smoke/rollback/release, ledger/stale rules,deploy_url/deploy_verified_urland Preview behavior are unchanged; published or failed runs are untouched.Test
scripts/cf-preview/test-workflow-contract.py: new checks, executed against a stubgh. 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 showinactive("Superseded by a newer push before publish; nothing deployed") instead ofsuccess; 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