fix(release): pin host Deno to bundled canary so denort matches#1308
Merged
fix(release): pin host Deno to bundled canary so denort matches#1308
Conversation
`deno compile` bakes the host deno's matching `denort-<version>` into the compiled binary as the runtime that executes `main.ts` — i.e. the swamp CLI itself, including the workflow runner that does TLS uploads. The release job was running `deno compile` under stable v2.x (currently 2.7.14), which embeds `denort-2.7.14` containing the unfixed ext/node/ops/tls_wrap.rs unwrap (denoland/deno#33713). The fact that scripts/download_deno.ts also embeds the patched canary as a resource at resources/deno/deno doesn't help: that copy is extracted to ~/.swamp/deno for spawned children, not used by the CLI process where the panic fires. Resolve the pinned SHA from scripts/deno_canary.txt (the existing single source of truth) and pass it to denoland/setup-deno, so `denort` is fetched from dl.deno.land/canary/<sha>/ instead of release/v2.7.14/. The bridge is grep-able via `CANARY-BRIDGE` and the back-out checklist now lists the workflow change to undo when v2.8.0 ships. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
No blocking issues found. This is a clean, well-scoped fix for the denort version mismatch that caused TLS panics in production.
What I verified
- SHA parsing consistency — The shell pipeline in the workflow (
grep -v comments | grep -v blank | head -n1 | tr -d space) correctly mirrors thereadCanarySha()logic inscripts/download_deno.ts. Both skip#-comment and blank lines, taking the first content line. - Error handling — Empty SHA is caught with an explicit error message and
exit 1before the workflow proceeds. - Back-out checklist — Correctly updated and renumbered with the new step 3 for the workflow change.
- CANARY-BRIDGE markers — Consistently applied across the workflow comment and step, making cleanup grep-able.
- Security — SHA is read from a repo-committed file, not from untrusted PR input. Full 40-char pinned hash, not a mutable ref.
- Scope — Only the release workflow is changed; other workflows (
ci.yml,publish-testing.yml,publish-client.yml) are correctly left on stable since they don't rundeno compile.
LGTM — ship it.
There was a problem hiding this comment.
CI Security Review
Critical / High
None.
Medium
denoland/setup-deno@v2(release.yml:49) — tag-only pin, not SHA-pinned. Pre-existing, not introduced by this PR. If a compromisedv2tag were pushed, the release job (which hascontents: writeand access toUAT_TRIGGER_TOKEN) would execute attacker-controlled setup code. Consider pinning to a full SHA for parity withsoftprops/action-gh-releaseandpeter-evans/repository-dispatch, which are already SHA-pinned. Same applies to several Docker actions in thedockerjob (docker/setup-qemu-action@v3,docker/build-push-action@v6, etc.) — also pre-existing.
Low
None.
Verdict
PASS. The new "Resolve Deno canary SHA" step reads a committed file from ref: main, outputs a deterministic hash, and passes it via steps.canary.outputs.sha into a with: input — no expression injection, no shell injection, no new secret exposure. The deno_canary.txt changes are documentation-only (updated back-out checklist numbering). No security concerns introduced by this PR.
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.
Summary
Stop shipping a swamp CLI with the buggy
denort-2.7.14runtime baked in. Resolve the pinned canary SHA from the existing single source of truth (scripts/deno_canary.txt) and use it as the host Deno fordeno compile, sodenortis fetched fromdl.deno.land/canary/<sha>/instead ofrelease/v2.7.14/.Why the swamp-club deploy still panics on the latest release
The current
stableswamp tarball was built with this release flow:denoland/setup-deno@v2withdeno-version: v2.x— installs stable 2.7.14.scripts/compile.tsdownloads canary19bd3d8band writes it toresources/deno/deno✅.deno compile --include resources/deno --output dist/swamp-linux-x86_64 main.ts— runs under 2.7.14, so it pullshttps://dl.deno.land/release/v2.7.14/denort-x86_64-unknown-linux-gnu.zipand bakes that into the swamp CLI binary.Result: the shipped swamp binary contains two runtimes:
denort-2.7.14— runsmain.ts(the swamp CLI / workflow runner). Still has theext/node/ops/tls_wrap.rs:2018unwrap.canary-19bd3d8b(the embedded resource) — extracted to~/.swamp/denoand used by spawned children, not by the CLI process.The TLS panic the swamp-club deploy hits comes from the workflow runner uploading to
giga-swamp.sfo3.digitaloceanspaces.com— that runs in the swamp CLI process (single PID2467throughout the failing log), i.e. indenort-2.7.14. So the embedded canary resource doesn't help here.Verified:
denort-{x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin, x86_64-pc-windows-msvc}.zipare all present atdl.deno.land/canary/19bd3d8b99d92f15d20692aca02ac059bbc9ada7/(HTTP 200 for all five), sodeno compilewill be able to fetch them on every target.Change
release.yml: newResolve Deno canary SHAstep readsscripts/deno_canary.txt(same parsing asreadCanarySha()inscripts/download_deno.ts) and pinsdenoland/setup-deno@v2'sdeno-versiontocanary-<sha>. MarkedCANARY-BRIDGEfor grep-ability.deno_canary.txt: back-out checklist now lists therelease.ymlstep to remove when v2.8.0 ships.Other workflows (
publish-testing.yml,publish-client.yml,ci.yml) don't rundeno compile, so they don't bakedenortand are intentionally left on stable.Test plan
Pinned Deno canary: 19bd3d8b...and the subsequentdeno compilefetchesdenortfromdl.deno.land/canary/19bd3d8b.../denort-...zip(notrelease/v2.7.14/).Deploy swamp-club to DigitalOceanworkflow on the newstableswamp; the S3 upload to DigitalOcean Spaces should complete without thetls_wrap.rs:2018:31panic.swamp --versionon the new build still reports the expected swamp version string.🤖 Generated with Claude Code