Repository navigation
ci: one deploy command that suits both toolchains - #445
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
aadhar-sh | 1df8cde | Aug 18 2026, 06:39 PM |
Wire-size diff vs merge base
Brotli q11, the quality the edge serves. Every number here is deterministic: Client assetsNo change. 21 files, 75.15 KiB Brotli total. PagesNo change. 48 files, 502.05 KiB Brotli total. Worker bundleNo change. 229.72 KiB gzip. Dictionary deltas (
|
|
Converting to draft along with #443: the toolchain stays pnpm + node for now, so merging this would put a script on It stays open because it is still the right shape for the day the migration resumes. The transition it exists for is real whenever |
|
Rebased onto Both tests still pass by name, and Still a draft on purpose: the toolchain stays pnpm and node, so pointing the dashboard at this script is not something to do yet. It merges the day the bun migration resumes. |
de48ea5 to
ad2d42c
Compare
Workers Builds holds a SINGLE command string per trigger, and it has to work on whatever branch is being built. `main` is a pnpm tree; #443 makes it a bun tree, and the two cannot share an invocation: pnpm exec wrangler REFUSES on a bun tree. pnpm reads packageManager and exits "This project is configured to use bun" (reproduced on pnpm 11.22.0; the image ships 10.11.1, which enforces the same field) bun .../wrangler.js cannot run on a pnpm tree in the image, which installs bun only when the tree asks for it Without this, the dashboard string can only ever suit one branch, so the migration would need the dashboard edited at the exact moment it merges with every other branch's build broken on one side of the switch. The LOCKFILE decides, not what is on PATH: the image preinstalls a bun of its own, so probing `command -v bun` would quietly run main's production deploy under a bun this tree never asked for. It takes NO opinion on wrangler's arguments. Everything after the script name is passed through, so `versions upload` and both provisioning flags stay in the dashboard string where check-infra.mjs already reads them, and that check needs no change. It never fetches. npx/bunx/dlx resolve missing binaries from the registry (gotcha 29), which on the one path that publishes production means deploying with a wrangler nobody pinned. A test greps for those tokens rather than for a phrase, since the sweep that closed that hole missed `npx` as a quoted argument. It runs wrangler's ENTRY FILE rather than `bun x wrangler`: measured 2026-08-18 with node replaced by a stub exiting 127, `bun x --no-install wrangler` invokes node through the `#!/usr/bin/env node` shebang and fails, while the entry stays inside bun. TESTED BY RUNNING IT against fixture trees with stub binaries: both branches, plus the three loud failures (no lockfile, missing wrangler entry, no arguments). Control run: breaking the lockfile branch fails the test by name. No dashboard change is required by this commit. It lands the script so the dashboard CAN be pointed at it, which is a separate step, with infra.json's strings following after.
ad2d42c to
1df8cde
Compare
|
Rebased onto One conflict, in Still a draft on purpose. The toolchain is pnpm and node, so pointing the dashboard at this script is not something to do yet; it merges the day the bun migration resumes. |
Records what the dashboard runs, so infra:check stops reading drift. The wrapper landed in #445 and is dormant until the dashboard points at it. HOLD THIS UNTIL THE DASHBOARD IS FLIPPED. check-infra.mjs compares these strings against the live dashboard values with an exact match, and validate is a required check, so landing this first fails on drift it invented itself and blocks its own merge. Dashboard first, strings second. Both tree-tier assertions still hold: the two provisioning flags are present, and it is still a `versions upload` so a publish moves no traffic. MAINTENANCE.md's historical rollout recipe keeps its `pnpm exec` spelling. That passage records the sequence used in 2026-08-04 and rewriting it would falsify what was typed at the time. Co-authored-by: Aadharsh Pannirselvam <19518661+oddharsh@users.noreply.github.com>
Lands
.github/deploy-wrangler.shso the Workers Builds dashboard can hold one command string that works on bothmain(pnpm) and the bun branch (#443).No dashboard change is required by this PR, and
infra.jsonis deliberately untouched. Merging this changes nothing about how anything deploys today; it just puts the script onmainso the dashboard can be pointed at it as a separate, reversible step.Why a script rather than a command
The dashboard holds a single string per trigger, and the two trees cannot share an invocation:
pnpm exec wranglerrefuses on a bun tree. pnpm readspackageManagerand exits withThis project is configured to use bun(reproduced on pnpm 11.22.0; the build image ships 10.11.1, which enforces the same field).bun …/wrangler.jscannot run on a pnpm tree in the image, which installs bun only when the tree asks for it.So without this, the dashboard would have to be edited at the exact moment #443 merges, with every other branch's build broken on one side of the switch.
Three decisions worth reviewing
The lockfile decides, not
PATH. The image preinstalls a bun of its own, so probingcommand -v bunwould quietly runmain's production deploy under a bun this tree never asked for.It takes no opinion on wrangler's arguments. Everything after the script name passes through, so
versions uploadand both provisioning flags stay in the dashboard string wherecheck-infra.mjsalready reads them. That check needs no change.It runs wrangler's entry file, not
bun x wrangler. Measured 2026-08-18 with node replaced by a stub exiting 127:bun x --no-install wranglerinvokes node through the#!/usr/bin/env nodeshebang and fails, while running the entry directly stays inside bun.It also never fetches:
npx/bunx/dlxresolve missing binaries from the registry (gotcha 29), which on the one path that publishes production means deploying with a wrangler nobody pinned.Tested by running it
Fixture trees with stub binaries cover both branches plus the three loud failures: no lockfile, a missing wrangler entry, and no arguments. Control: breaking the lockfile branch fails the test by name (
✖ the deploy bridge picks its invocation from the lockfile).Also exercised against this tree for real, where it resolves
pnpm exec wranglerand prints4.123.0.The sequence after this merges
bash .github/deploy-wrangler.sh versions upload --x-provision=false --x-auto-create=falseinfra.json's two stringsBetween 2 and 3,
infra:checkreports drift onmainand on any open PR, which is the documented dashboard-first cost. The follow-up PR's own CI is green, because its tree declares what the dashboard holds.