Repository navigation
feat(deploy): deploy the edge from a release's bundle, prove it on the shared hostname, and roll it back when it fails - #295
Merged
Merged
Conversation
…in the attested deploy bundle The first part of #195's stage E3 (deploying the edge, ADR-0111). - Every answer of the edge, its own and a forwarded one, carries x-thrust-edge-version: its version's tag (the release's commit), else its id, by thrust's x-thrust-version rule. A WebSocket upgrade passes as it came, and an upstream cannot set the header. The template declares [version_metadata], and check-edge-config.sh requires exactly one. - build-bundle builds the edge with worker-build and puts it in deploy-bundle.tar.gz under edge/build/. release.yml therefore builds and attests it with the release, and a release candidate's bundle proves it builds. - The deploy dry run renders the edge's template with made-up values and runs wrangler deploy --dry-run on it, against that build. Refs: #195 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e shared hostname, and roll it back when it fails The second part of #195's stage E3 (ADR-0111). No workflow runs it yet. scripts/deploy-edge.sh deploys the edge every release, after production. It renders the edge's template and reads the live version; a split or unreadable one stops it. It then runs wrangler deploy --tag <sha>, with the edge's three secrets in a --secrets-file that only its owner can read, removed before anything else runs. The first deploy stops green, because the edge has no hostname until the cut-over. Every later deploy is proved: - the smoke through the edge (SMOKE_EXPECT_EDGE: this edge answers, routed to production, production at the release, a real read); - the smoke's control (an edge nobody deployed must fail); - scripts/edge-controls.sh: a forged pin goes to production, and the opt-in gives no pin to a request Access did not admit. Any failure rolls back to the edge that was live and proves it answers again, and the run stays red. Tests: test-deploy-edge.sh (96, against edge_fakes.py) and test-smoke-deploy.sh (74, against smoke_stub.py with a broken edge per control). Each of 45 hand mutants of the three scripts fails its test. Refs: #195 Co-Authored-By: Claude Opus 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 18, 2026
…o main) Refs: #195 Co-Authored-By: Claude Opus 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.
Stacked on #294 (the edge says which build of it answered; the bundle carries the edge).
The second part of deploying the edge Worker (#195 stage E3, ADR-0111). It holds the scripts and their tests. No workflow runs
them yet: that is the next pull request.
What changes
scripts/deploy-edge.shdeploys the edge from the release's bundle, every release, after production. A path rule wouldfire on every release anyway, because each one bumps the workspace version and the lock. In order:
wrangler deploy --tag <sha>.--secrets-file.wrangler's environment.
thrust.sow.footo it.SMOKE_EXPECT_EDGE);SMOKE_EXPECT_ROUTE=prod);scripts/edge-controls.sh: a forged pin goes to production, and the opt-in gives no pin to a request Access did notadmit (made-up service token and Access token headers must get 302, 401 or 403 and no
__Host-thrust_edgecookie).wrangler rollbackto the edge that was live, then a probe that it answers again.The run stays red.
smoke-deploy.shgainsSMOKE_EXPECT_EDGE.smoke_stub.pygains:--routewithout--pin, which stands for production behind the edge;--honour-any-pin,--opt-in-openand--no-edge-paths;--unavailable-first-gets.Docs:
cicd.md's row, and G-45 indocs/src/testing/status.md.Tests
test-deploy-edge.sh, 96 checks againstedge_fakes.py. The fakes are a wrangler that keeps the edge's versions, plus atruthful smoke and truthful controls; the render and
active-version.pyare the real ones.when it had none. A rollback that fails or cannot be confirmed says so, and
AUTO_ROLLBACK=falserolls nothing back.answers) and a refused render.
(taken), and the edge named as production.
test-smoke-deploy.sh, 74 checks, with the new cases forSMOKE_EXPECT_EDGEandedge-controls.sh:Hand mutants: each of 45 mutants of the three scripts fails its test.
Also passing: every
depsstep and all 47ci-scriptscommands, each run under dash.Not verified
Wrangler itself:
--secrets-filesatisfiessecrets.requiredon a Worker that does not exist yet;deployments list. It is read by the same reader as production's, which has been read live.The edge on the hostname. That waits for the cut-over. The first live runs will be:
Refs #195
🤖 Generated with Claude Code