Skip to content

The pnpm check cycle costs more than it needs to: an uncacheable e2e tier, a cold-cache lint race, and a PR body check that only runs on CI #1925

Open

Description

@thomasbeaudry

pnpm check is the gate every change passes, and on #1922 it was paid six times. Only two of
those runs failed on the change itself. The rest were the gate's own mechanics, and three of the
four causes below are fixable in the repo.

Measured on fix/instrument-repo-sync-reporting (v2.6.0 + the branch), one developer machine:

Tier Time Cached
pnpm lint, 34 tasks 1m25s yes
pnpm test:coverage, 456 files ~3m yes
pnpm test:e2e, 415 specs, 1 worker 17m24s no
full pnpm check, cold ~22m

CI's lint-and-test took 22m, 23m and 25m on the same branch, so a local run buys no time over
pushing — it only avoids the round trip.

1. test:e2e carries cache: false, so it is 80% of the gate and never skipped

turbo.json sets "cache": false on test:e2e. Every pnpm check pays the full 17 minutes even
when the diff cannot reach a spec — a docs-only or schema-only change included. Nothing else in the
pipeline is uncacheable, so the practical cost of re-running the gate after any review comment is
one fixed 17-minute block.

The suite needs real servers and a database, which is presumably why it opted out. Whether that
rules out caching is the question: Playwright is deterministic given the same inputs, and the task
could declare inputs (the specs, apps/{api,gateway,web}'s sources, .env) and cache on them.
If it genuinely cannot be cached, the alternative is to stop asking developers to run it: make
pnpm check lint + coverage, and let CI own the full suite.

2. runtime-core's own lint races its own build, and lib/** is not a declared output

Two turbo.json facts combine into a cold-cache failure:

  • lint declares dependsOn: ["^build", "^db:generate", "db:push"]. ^build is topological — the
    dependencies' builds. A package's own build is not ordered before its own lint.
  • build declares outputs: ["dist/**"], but packages/runtime-core's build script is
    rm -rf dist lib && pnpm build:lib && pnpm build:dist, and build:lib writes lib/. That
    directory is a published entrypoint (./constants resolves to ./lib/constants.js) and is not
    in outputs, so turbo neither saves nor restores it.

packages/runtime-core/tsconfig.json includes lib/**/*, and its lint is tsc --noEmit. So on
a cold cache runtime-core:lint type-checks lib/ while runtime-core:build is deleting it:

@opendatacapture/runtime-core:lint: error TS6053: File '…/packages/runtime-core/lib/index.d.ts' not found.
… 13 more, all under lib/
Failed: @opendatacapture/runtime-core#lint

Exit 2, nine seconds in. Reliably triggered by anything that invalidates the cache — editing
.env, a fresh clone, a pruned cache — and invisible afterwards, because the second run finds
lib/ populated. It cost a full attempt here and reads as a real lint failure.

Either ordering lint after the package's own build, or adding lib/** to the build task's
outputs, would close it; the second also stops a cache hit from leaving a published entrypoint
missing on disk.

3. .agents/skills/opening-pr/SKILL.md does not say the body check runs locally

scripts/check-pr-body.ts takes an event payload and a commit-message file, reads no network, and
prints the same report the workflow posts. Nothing in the skill mentions it, so the first signal
that a body is malformed is .github/workflows/pr-body.yaml closing the PR.

That is what happened to #1922: the stamp read pnpm check: lint green (34/34) and unit green …
instead of the literal pnpm check: green, and the PR was closed and reopened for a one-line body
edit. The checker flags it in two seconds. A line under Open, before gh pr create, would make
the loop local.

Related: gh pr edit and gh pr reopen both fail against this repo right now with
GraphQL: Projects (classic) is being deprecated … (repository.pullRequest.projectCards). A single
REST PATCH /pulls/{n} with body and state works. Worth a note wherever the skill tells an
agent to fix a closed PR's body, since the command it gives does not currently run.

4. The local default of two e2e workers flakes, and the flake is contagious

testing/playwright.config.ts uses workers: workerCount ?? (process.env.CI ? 1 : 2). At two
workers this branch failed 2 of 415 specs on each of two runs, a different pair each time —
admin-audit-logs.spec.ts:19/:33, then gateway-assignment.spec.ts:95/:207 — each passing when
re-run alone. At E2E_WORKERS=1 the same commit passed 415/415 in 17m24s.

The second-order cost is worse than the lost minutes: a developer facing an unrelated flake writes
a hedged pnpm check line into the PR body, which is exactly what the body workflow rejects. The
options are to default local runs to one worker, or to document the two-worker flake and the
E2E_WORKERS override in testing/AGENTS.md under its existing worker note.

Not filed here

The review for this PR returned two confirmed findings, both instances of one source of truth;
everything derived
from coding-guidelines.md, and both required a code change and therefore a
second full gate. That is the process working as intended, not a defect.

Activity

  1. added
    DiscussionType: an open design question that needs a decision before work can start
    Area: InfrastructureDeployment, Docker, CI, logging, CLIs, build and test tooling
    PerformanceSpeed, memory or scalability
    Needs DecisionWell-defined, but blocked on a maintainer decision about direction or design
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: InfrastructureDeployment, Docker, CI, logging, CLIs, build and test toolingDiscussionType: an open design question that needs a decision before work can startNeeds DecisionWell-defined, but blocked on a maintainer decision about direction or designPerformanceSpeed, memory or scalabilityPriority: MediumReal value; schedule normally

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions