mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
worker/ is not a workspace member and its lockfile was gitignored from the
scaffold days ("deps installed fresh"), with wrangler at ^4.0.0. Both CI jobs
therefore installed --no-frozen-lockfile and resolved everything afresh on every
run.
Three consequences, in rising order of seriousness. CI never ran the wrangler
anyone had tested locally. A `wrangler dev` crash could not be told apart from a
code change, because the version moved underneath the suite. And every prod
deploy BUNDLED whatever npm served that morning.
That last one is worth being precise about, because the obvious reading is the
wrong one. The deploy CLI was never the exposure: wrangler-action@v3 already
pins wranglerVersion: '4.106.0' on the backup, migrate and deploy steps. What
floated into production was the pnpm install that `wrangler deploy` bundles
FROM -- hono (43 imports, the entire HTTP and auth layer), zod, pdf-lib,
postal-mime and xlsx. Those are not dev tooling. They run on every request, they
handle user data, and they were resolved unreviewed and integrity-unchecked on
each deploy.
The counter-argument was security: leave it floating so an urgent fix arrives on
its own. It does not survive contact.
- Floating IS the supply-chain exposure, not the mitigation. Unreviewed,
integrity-unchecked downloads going straight into a deploy pipeline is the
path a hijacked or republished package takes.
- "Automatically latest" only helps if somebody notices. There was no
dependabot.yml in this repo at all, so nothing watched for advisories,
nothing opened a PR, nothing tested an upgrade.
- The dev-tool-versus-runtime split cuts both ways. A CVE in wrangler
threatens CI runners rather than user data -- but hono is not wrangler.
So: lockfile committed (209 resolutions, integrity-hashed, so a tampered tarball
is refused rather than installed), wrangler pinned exactly at 4.126.0 to match
vitest and @cloudflare/vitest-pool-workers which were already exact, both
workflows on --frozen-lockfile, and a dependabot.yml covering the workspace
root, worker/, and the Actions themselves.
Dependabot raises SECURITY updates as soon as an advisory lands regardless of
the weekly cadence, so this surfaces fixes faster and more visibly than floating
did, because a human is told. wrangler minors and majors are on the ignore list:
it ships a minor most weeks, each carrying a different miniflare, and an
unattended bump is how a dev server that crashes mid-run reaches main.
Left alone deliberately: wrangler-action's 4.106.0 now differs from the 4.126.0
in package.json, so the CLI that migrates prod is not the one the tests ran
against. Aligning them changes the production deploy path and cannot be
rehearsed without deploying -- its own PR, against a quiet main.
This does NOT fix the E2E wrangler dev crash. That was seen on 4.125.0 at 17:44
and on 4.126.0, published 19:13 the same day, so it spans versions and is a
regression in neither. Pinning makes it diagnosable: the toolchain is finally a
fixed variable, so the next occurrence can be bisected rather than guessed at.
worker: 54 files, 445 tests passing, typecheck clean, --frozen-lockfile verified
against the committed lockfile.
10 lines
372 B
Plaintext
10 lines
372 B
Plaintext
node_modules/
|
|
.wrangler/
|
|
.dev.vars
|
|
dist/
|
|
worker-configuration.d.ts
|
|
# pnpm-lock.yaml IS tracked. It was ignored here from the scaffold days ("deps installed fresh"),
|
|
# which meant every CI run and every prod deploy resolved the toolchain afresh and no two were
|
|
# guaranteed to be the same build. npm-lock is still ignored — pnpm is the package manager.
|
|
package-lock.json
|