Skip to content

ci: pin pnpm via packageManager and use frozen lockfile#247

Merged
jamesdabbs merged 4 commits into
mainfrom
fix/ci-pnpm-pin
Jun 28, 2026
Merged

ci: pin pnpm via packageManager and use frozen lockfile#247
jamesdabbs merged 4 commits into
mainfrom
fix/ci-pnpm-pin

Conversation

@jamesdabbs

Copy link
Copy Markdown
Member

Problem

packages/core/test/Parser.test.ts was failing in the Unit tests workflow on main (e.g. run 28306464955) while passing locally. The failures were KaTeX glyph-margin mismatches like:

  • margin-right:0.13889em0.1389em (the T glyph)
  • margin-right:0.03588em0.0359em (the σ glyph)

Root cause

Not a KaTeX or test bug — a pnpm version mismatch between CI and local:

  • Local pnpm 10.x writes pnpm-lock.yaml at lockfileVersion: '9.0', pinning katex@0.16.9 (emits the old 0.03588em precision → tests pass).
  • CI pinned pnpm to 8.x.x, which can't parse a v9 lockfile. The install logged WARN Ignoring not compatible lockfile, discarded it, and re-resolved all ~1271 deps from scratch — pulling a newer KaTeX 0.16.x that rounds margins, breaking the exact-HTML assertions.

Fix

  • Pin pnpm via the packageManager field in package.json (pnpm@10.33.0) so CI and local agree.
  • Let pnpm/action-setup read that field — drop the version: 8.x.x input (e2e bumped @v2@v4, required to read packageManager).
  • Use pnpm install --frozen-lockfile in both workflows so CI fails loudly on lockfile drift instead of silently re-resolving.

Verification

  • pnpm install --frozen-lockfile"Lockfile is up to date … Already up to date", KaTeX stays 0.16.9.
  • pnpm --filter core run test → all pass (Parser.test.ts: 15 tests, 2 skipped).

Note

From now on, changing a dependency without committing the updated pnpm-lock.yaml will fail CI at the install step — that's the intended safety net.

CI pinned pnpm to 8.x.x, which cannot read the lockfileVersion 9.0
lockfile written by the pnpm 10 used locally. It silently ignored the
lockfile (`WARN Ignoring not compatible lockfile`) and re-resolved every
dependency, pulling a newer KaTeX whose rounded glyph margins broke the
exact-HTML assertions in packages/core/test/Parser.test.ts.

- Pin pnpm via the `packageManager` field so CI and local agree
- Let pnpm/action-setup read that field (e2e: bump v2 -> v4, required)
- Use `--frozen-lockfile` so CI fails loudly on lockfile drift instead
  of silently re-resolving to newer transitive deps
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying topology with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7e80a67
Status: ✅  Deploy successful!
Preview URL: https://e0822cb0.topology.pages.dev
Branch Preview URL: https://fix-ci-pnpm-pin.topology.pages.dev

View logs

With --frozen-lockfile, CI now resolves the pinned chokidar@3.5.3, whose
bundled types declare `class FSWatcher implements fs.FSWatcher` without
the ref/unref methods that newer @types/node (22.15.31) added, causing a
TS2420 error in `packages/compile` (tsc). chokidar 3.6.0 fixes the type
compatibility.

This was previously masked: CI ran pnpm 8, which couldn't read the
lockfileVersion 9.0 lockfile, ignored it, and re-resolved to versions
that happened to type-check. Surfaced now that CI honors the lockfile.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
pi-base-topology 447b79a Commit Preview URL

Branch Preview URL
Jun 28 2026, 01:17 AM

Expand the topology environment's observability config to explicitly
persist invocation logs and enable tracing (100% head sampling).
pnpm 10 records build-script execution state in the (cached) store, so on
a warm store hit it skips cypress's postinstall and the binary is never
fetched into the e2e container, failing with "Cypress binary is missing".
The Cypress cache also pointed at /github/home/.cache/Cypress, not the
container's CYPRESS_CACHE_FOLDER (/root/.cache/Cypress).

- Install the cypress binary explicitly after pnpm install (deterministic)
- Point the Cypress cache at /root/.cache/Cypress (bump key v2 -> v3)
@jamesdabbs jamesdabbs merged commit 107edf1 into main Jun 28, 2026
3 checks passed
@jamesdabbs jamesdabbs deleted the fix/ci-pnpm-pin branch June 28, 2026 01:26
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