Skip to content

ci: cut PR wall clock by caching what CI recomputes every run - #15211

Merged
nwparker merged 1 commit into
mainfrom
nwparker/efficient-CI
Aug 18, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/efficient-CI

Conversation

@nwparker

@nwparker nwparker commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Seven changes that remove work CI repeated on every PR. No test, lint, or check is dropped, and no runner is upgraded — every one makes the runners stop recomputing something they already had.

Measured results

Baseline 32083493059 vs this branch, compared per job. Run totals are not directly comparable: this PR touches no E2E spec, so its E2E chain is correctly skipped (44 jobs vs 47), and queueing differed between runs.

Caches only pay off from the second run onward, so both are shown.

Job Baseline Run 1 (cold) Run 2 (warm) Delta
root directory guard 46s 23s 18s −61%
Git compatibility 97s 91s 48s −51%
detect changed e2e specs 43s 19s 21s −51%
typecheck 72s 69s 37s −49%
cross-version wire 104s 85s 58s −44%
package (windows) 278s 232s 243s −13%
static analysis 128s 142s 111s −13%
package 155s 150s 140s −10%
tests shards (32, sum) 5340s 5108s 4711s −12%
shell contracts 92s 214s 176s +91% — external, see below
Common-job billed total 6407s — 5611s −12%

Excluding the external shell contracts flake, the billed total is −14%.

The individual steps each change targets:

Step Before After
pnpm run typecheck 34s 5s (−85%)
Verify Git binary compatibility matrix 43s 11s (−74%)
static analysis checkout 30s 14s (−53%)
cross-version-wire checkout 43s 16s (−63%)
install-node-dependencies (test shards, median) 39s 31s (−21%)
shallow checkouts (control, untouched) 7–9s 7–9s

Status per change

# Change Status
3 filter: blob:none on the 4 full-history checkouts ✅ Confirmed, −51% to −61% on the jobs that use it. Lands on the critical path — detect changed e2e specs gates the whole E2E chain
6 Parallel tsc + .tsbuildinfo cache ✅ Confirmed, typecheck step 34s → 5s
5 Git 2.25.5 build cache ✅ Confirmed, matrix step 43s → 11s
2 node-pty build cache ✅ Confirmed via the install action on native-runtime jobs (39s → 31s median across 32 shards)
7 build:release:parallel on Windows ✅ Confirmed, −35s
1 --frozen-lockfile ⚠️ No isolated speed gain measurable. I originally justified this by measuring that the old flags pull ~62 MB of registry metadata per job — but that was a byte count I inferred a time cost from, and on GitHub's network the fetch is cheap. Its effect cannot be separated from #2 in the install-action numbers. Kept on correctness grounds — strictly stricter than what it replaced, and the git diff guard already required a current lockfile — not on the speed claim I first made for it
4 pnpm store cache in e2e.yml ⏳ Not exercised — this PR skips the E2E chain. Verifiable on any PR touching tests/e2e/**, where E2E jobs currently cache nothing at all

The shell contracts regression is not from this PR

It is entirely inside Install zsh and fish: 31s baseline → 149s and 127s on the two attempts here. That is the add-apt-repository ppa:fish-shell/release-4 step, which this workflow already documents as "the network-flaky step" and wraps in a 3-attempt retry loop. This PR does not touch that job's apt steps, and they run before every step it does touch.

Worth a separate look: at ~2 minutes on every PR right now, that PPA fetch is currently one of the more expensive things in PR CI.

Safety

Each new cache has a contract test pinning its ordering and key:

  • The native-module cache uses no restore-keys — a partial key match is exactly the ABI-mismatched build that would be recompiled anyway. The key carries runtime, resolved Node version, and the node-pty patch hash.
  • The Git cache still runs the sha256 assertion on the miss path that actually builds.
  • build:release is untouched — release and nightly builds keep the serial path; only PR CI's Windows job uses the :parallel variant.
  • The cross-version-wire + blob:none interaction I flagged as riskiest (it runs git archive against an old tag, triggering a lazy blob fetch) came out 19s faster overall, so that risk did not materialize.

Testing

  • pnpm run lint — passes
  • pnpm exec vitest run config/scripts/ — 807 passed, 6 skipped
  • Full PR CI green on this branch, including typecheck

Correction to an earlier revision of this description: it claimed tsc -p config/tsconfig.tc.web.json was failing on main with two TS2741 errors and that the typecheck job would be red. That was wrong — typecheck passed in CI with no output. That failure reproduces only on my macOS checkout, not on Linux CI. There is no known pre-existing break on main.

None of these change what CI checks — they remove work the runners
repeated on every PR.

- install-node-dependencies installed with --no-frozen-lockfile, so every
  job re-resolved the graph against the registry to recompute what the
  lockfile already pins. Measured at ~62 MB of packument metadata per job;
  the pnpm store cache does not cover the metadata cache, so this was paid
  ~39 times per run. The `git diff` guard that made the re-resolution
  redundant stays.
- --ignore-scripts leaves node-pty with no build/Release, so
  ensure-native-runtime node-gyp-compiled it in every job asking for a
  runtime. Cache the build under an ABI-bound key (runtime, resolved Node
  version, node-pty patch) with no restore-keys, since a partial match is
  exactly the mismatched build that would be recompiled anyway.
- The four fetch-depth: 0 checkouts pulled full history including every
  historical blob (blobs are ~89% of this repo's pack). They only need the
  commit graph for a merge-base diff, so fetch them blobless. Measured
  30-43s each today versus 8s for the shallow checkouts. One of them,
  e2e-paths, gates the entire E2E chain.
- E2E jobs ordered setup-node before pnpm, which meant setup-node could not
  find the store and no E2E job cached dependencies at all. Reorder and
  cache; this sits on the critical path in both the build job and each
  shard.
- git_compatibility rebuilt Git 2.25.5 from a pinned tarball on every PR.
  Cache the build; the sha256 assertion still guards the miss path.
- typecheck ran three independent tsc passes back to back and discarded the
  .tsbuildinfo each project already emits. Run them concurrently and cache
  the incremental state.
- package (windows) built the electron-vite targets serially via
  build:release. Use a :parallel variant that overlaps them, matching what
  the Linux package job already packages and smoke-tests from.

Contract tests cover each new cache's ordering and key so none of them can
silently start serving a stale or ABI-mismatched artifact.
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nwparker, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Limit details: You’ve used all 10 included reviews currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1657c8ba-4e06-4060-ab0a-31836c052c30

📥 Commits

Reviewing files that changed from the base of the PR and between f8e728b and eab3a74.

📒 Files selected for processing (8)
  • .github/actions/install-node-dependencies/action.yml
  • .github/workflows/e2e.yml
  • .github/workflows/pr.yml
  • config/scripts/git-binary-compatibility-workflow.test.mjs
  • config/scripts/pr-workflow-parallelism.test.mjs
  • config/scripts/run-typecheck-projects-in-parallel.mjs
  • config/scripts/skills-cli-package-workflow.test.mjs
  • package.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 13b10e0 into main Aug 18, 2026
90 checks passed
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 21, 2026
…ai#15211)

None of these change what CI checks — they remove work the runners
repeated on every PR.

- install-node-dependencies installed with --no-frozen-lockfile, so every
  job re-resolved the graph against the registry to recompute what the
  lockfile already pins. Measured at ~62 MB of packument metadata per job;
  the pnpm store cache does not cover the metadata cache, so this was paid
  ~39 times per run. The `git diff` guard that made the re-resolution
  redundant stays.
- --ignore-scripts leaves node-pty with no build/Release, so
  ensure-native-runtime node-gyp-compiled it in every job asking for a
  runtime. Cache the build under an ABI-bound key (runtime, resolved Node
  version, node-pty patch) with no restore-keys, since a partial match is
  exactly the mismatched build that would be recompiled anyway.
- The four fetch-depth: 0 checkouts pulled full history including every
  historical blob (blobs are ~89% of this repo's pack). They only need the
  commit graph for a merge-base diff, so fetch them blobless. Measured
  30-43s each today versus 8s for the shallow checkouts. One of them,
  e2e-paths, gates the entire E2E chain.
- E2E jobs ordered setup-node before pnpm, which meant setup-node could not
  find the store and no E2E job cached dependencies at all. Reorder and
  cache; this sits on the critical path in both the build job and each
  shard.
- git_compatibility rebuilt Git 2.25.5 from a pinned tarball on every PR.
  Cache the build; the sha256 assertion still guards the miss path.
- typecheck ran three independent tsc passes back to back and discarded the
  .tsbuildinfo each project already emits. Run them concurrently and cache
  the incremental state.
- package (windows) built the electron-vite targets serially via
  build:release. Use a :parallel variant that overlaps them, matching what
  the Linux package job already packages and smoke-tests from.

Contract tests cover each new cache's ordering and key so none of them can
silently start serving a stale or ABI-mismatched artifact.
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…ai#15211)

None of these change what CI checks — they remove work the runners
repeated on every PR.

- install-node-dependencies installed with --no-frozen-lockfile, so every
  job re-resolved the graph against the registry to recompute what the
  lockfile already pins. Measured at ~62 MB of packument metadata per job;
  the pnpm store cache does not cover the metadata cache, so this was paid
  ~39 times per run. The `git diff` guard that made the re-resolution
  redundant stays.
- --ignore-scripts leaves node-pty with no build/Release, so
  ensure-native-runtime node-gyp-compiled it in every job asking for a
  runtime. Cache the build under an ABI-bound key (runtime, resolved Node
  version, node-pty patch) with no restore-keys, since a partial match is
  exactly the mismatched build that would be recompiled anyway.
- The four fetch-depth: 0 checkouts pulled full history including every
  historical blob (blobs are ~89% of this repo's pack). They only need the
  commit graph for a merge-base diff, so fetch them blobless. Measured
  30-43s each today versus 8s for the shallow checkouts. One of them,
  e2e-paths, gates the entire E2E chain.
- E2E jobs ordered setup-node before pnpm, which meant setup-node could not
  find the store and no E2E job cached dependencies at all. Reorder and
  cache; this sits on the critical path in both the build job and each
  shard.
- git_compatibility rebuilt Git 2.25.5 from a pinned tarball on every PR.
  Cache the build; the sha256 assertion still guards the miss path.
- typecheck ran three independent tsc passes back to back and discarded the
  .tsbuildinfo each project already emits. Run them concurrently and cache
  the incremental state.
- package (windows) built the electron-vite targets serially via
  build:release. Use a :parallel variant that overlaps them, matching what
  the Linux package job already packages and smoke-tests from.

Contract tests cover each new cache's ordering and key so none of them can
silently start serving a stale or ABI-mismatched artifact.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ai#15211)

None of these change what CI checks — they remove work the runners
repeated on every PR.

- install-node-dependencies installed with --no-frozen-lockfile, so every
  job re-resolved the graph against the registry to recompute what the
  lockfile already pins. Measured at ~62 MB of packument metadata per job;
  the pnpm store cache does not cover the metadata cache, so this was paid
  ~39 times per run. The `git diff` guard that made the re-resolution
  redundant stays.
- --ignore-scripts leaves node-pty with no build/Release, so
  ensure-native-runtime node-gyp-compiled it in every job asking for a
  runtime. Cache the build under an ABI-bound key (runtime, resolved Node
  version, node-pty patch) with no restore-keys, since a partial match is
  exactly the mismatched build that would be recompiled anyway.
- The four fetch-depth: 0 checkouts pulled full history including every
  historical blob (blobs are ~89% of this repo's pack). They only need the
  commit graph for a merge-base diff, so fetch them blobless. Measured
  30-43s each today versus 8s for the shallow checkouts. One of them,
  e2e-paths, gates the entire E2E chain.
- E2E jobs ordered setup-node before pnpm, which meant setup-node could not
  find the store and no E2E job cached dependencies at all. Reorder and
  cache; this sits on the critical path in both the build job and each
  shard.
- git_compatibility rebuilt Git 2.25.5 from a pinned tarball on every PR.
  Cache the build; the sha256 assertion still guards the miss path.
- typecheck ran three independent tsc passes back to back and discarded the
  .tsbuildinfo each project already emits. Run them concurrently and cache
  the incremental state.
- package (windows) built the electron-vite targets serially via
  build:release. Use a :parallel variant that overlaps them, matching what
  the Linux package job already packages and smoke-tests from.

Contract tests cover each new cache's ordering and key so none of them can
silently start serving a stale or ABI-mismatched artifact.
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