Skip to content

CL-6589: run only affected packages, cache prettier and eslint - #295

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-check-speedup
Aug 22, 2026
Merged

CL-6589: run only affected packages, cache prettier and eslint#295
TheGreatAxios merged 3 commits into
mainfrom
cl-check-speedup

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

bun run check runs all 109 workspace packages regardless of what moved, and test is in SEQUENTIAL_SCRIPTS — so 106 test jobs run one at a time on an 8-core machine. A one-line edit pays for the whole repo. That is the multi-minute local gate.

What this adds

WORKBENCH_CHECK_SINCE=<ref> narrows the job list to the packages a change touches plus everything that transitively depends on them. Measured against the real 109-package graph:

edited package packages checked reduction
slug 6 / 109 18x
folded-runs 31 / 109 3.5x
inference-catalog 32 / 109 3.4x

It helps test most, precisely because that phase is sequential.

Opt-in. Unset, every package runs, so CI and a bare bun run check keep their current meaning. Local use:

WORKBENCH_CHECK_SINCE=origin/main bun run typecheck

Correctness over speed. A change to a root manifest, bun.lock, the shared tsconfig, the eslint config, scripts/, or .github/ has a blast radius no dependency edge records, so those force a full run. Dependents are walked to a fixed point, so a dependency cycle terminates instead of recursing. A filtered gate that misses a break is worse than a slow one.

Also: pins hono

Two resolved copies (4.13.2 via a transitive GitHub dep, 4.13.3 everywhere else) produce structurally identical but nominally distinct Hono types. The mismatch surfaces as an unreadable multi-screen TS2345 in whichever package bridges them.

What this deliberately does not change

test stays sequential. The comment in sequential-scripts.ts says several suites bind sockets and share Postgres, and making them concurrent is a real piece of work — not something to slip into a speedup PR. Narrowing the job list gets most of the win without that risk.

Note on the two typecheck errors seen locally

They were stale install state, not code: two @corbits/memory trees and two hono trees left behind by earlier installs, plus a tsconfig.tsbuildinfo caching a path that no longer existed. Verified clean in a fresh-install worktree. The hono pin prevents the duplicate recurring; the stale-tree pruning is a local rm -rf node_modules && bun install.

The gate ran all 109 workspace packages regardless of what moved, and
tests run one at a time, so a one-line edit paid for the whole repo.

WORKBENCH_CHECK_SINCE=<ref> narrows the job list to the packages the
change touches plus everything that depends on them, transitively. A
change to a root manifest, the shared tsconfig, or scripts/ has a blast
radius no dependency edge records, so those still run everything.

Opt-in: unset, every package runs, so CI keeps its current meaning.

Also pins hono in overrides. Two resolved copies produce structurally
identical but nominally distinct Hono types, and the mismatch surfaces
as an unreadable TS2345 in whichever package bridges them.
Both re-lint every file on every run. Measured on this repo: prettier
19.5s, eslint 108s. Neither result changes for a file that has not
changed, so both keep a cache keyed on content.

Warm: prettier 7.1s, eslint 2.4s -- a full lint goes from ~127s to
~4.3s. Cold cost is unchanged, so CI (fresh checkout, no cache) is
unaffected; this buys back the local edit-check loop.
@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main and added lint caching.

Measured on this repo

step before after (warm)
prettier 19.5s 7.1s
eslint 108s 2.4s
bun run lint total ~127s 4.3s

eslint was by far the biggest single cost in the gate and re-linted every file on every run. Neither tool's result changes for a file that has not changed, so both now cache on content.

Cold cost is unchanged, so CI (fresh checkout, no cache) is unaffected — this buys back the local edit-check loop. .eslintcache is gitignored.

Combined with the affected-package filter, a local check on a leaf package now touches 6 of 109 packages and skips ~123s of redundant linting.

@TheGreatAxios TheGreatAxios changed the title check: run only the packages a change can break CL-6589: run only affected packages, cache prettier and eslint Aug 22, 2026
@TheGreatAxios
TheGreatAxios merged commit 6ccd633 into main Aug 22, 2026
5 checks passed
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