Skip to content

feat(edge): say which build of the edge answered, and carry the edge in the attested deploy bundle - #294

Merged
aRustyDev merged 1 commit into
mainfrom
feat/edge-in-bundle
Nov 18, 2026
Merged

aRustyDev merged 1 commit into
mainfrom
feat/edge-in-bundle

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

The first part of deploying the edge Worker (#195 stage E3, ADR-0111): the edge says which build of it answered, and the
release's attested bundle carries it. Nothing deploys the edge yet.

What changes

The edge's version on every answer.

  • The header: every answer the edge gives carries x-thrust-edge-version, its own and the ones it forwards from
    production or a target. The value is its version's tag (the release's commit), else the version id, by thrust's
    x-thrust-version rule.
  • Exceptions:
    • a passed-through WebSocket upgrade, whose response cannot be rebuilt without losing its socket;
    • a value an upstream sends under that name, which is dropped.
  • Where it lives: the rule is in forward::edge_version_label and forward::stamp_edge_version, tested natively; the
    runtime reads the version metadata and applies it.
  • Why: without this header, a deploy of the edge could not be told from the version it replaced. x-thrust-version
    stays production's or the target's.

The template declares [version_metadata], and scripts/check-edge-config.sh now requires exactly one, with two new
self-test fixtures (none, two).

The bundle carries the edge.

  • build-bundle builds crates/edge with worker-build --release and puts it under edge/build/.
  • So release.yml builds and attests the edge with each release, under the same attestation as thrust, and a release
    candidate's bundle proves the edge builds.

The deploy dry run renders the edge's template with made-up values and lets wrangler deploy --dry-run check it against
that build.

Docs:

  • ADR-0111's dated update;
  • cicd.md's bundle rows;
  • G-41's note that the runtime's version read is untested natively.

Tests

cargo nextest run -p thrust-edge: 228 passed, including the new tests:

  • prop_the_edge_version_is_the_edges_own: an upstream's header in any case is dropped, the others stay in order, and the
    edge's label comes once, last;
  • prop_the_label_is_the_tag_else_the_id;
  • an exhaustive matrix of tag and id shapes, with the expectation spelled out per shape.

cargo clippy -p thrust-edge is clean for wasm32 and natively.

check-edge-config.sh passes on the template. Its self-test refuses a template without [version_metadata] and one
with two.

The dry run, locally, with wrangler 4.151.2 on the bundle's build:

  • it passes, and lists env.CF_VERSION_METADATA among the bindings;
  • control: the same config with a main that is not there fails.

Also passing: every deps step (actionlint run locally, since its step needs $RUNNER_TEMP) and all 46 ci-scripts
commands.

Not verified

The edge build in CI. This pull request's release dry run builds the bundle, and its deploy dry run renders the
edge's config, so CI shows both.

The header on a live edge: no edge is deployed.

Refs #195

🤖 Generated with Claude Code

…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]>
@aRustyDev
aRustyDev merged commit 39994fb into main Nov 18, 2026
30 checks passed
@aRustyDev
aRustyDev deleted the feat/edge-in-bundle branch November 18, 2026 04:15
aRustyDev added a commit that referenced this pull request Nov 18, 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