Skip to content

[CI] Refresh TypeScript caches on every PR push - #26368

Closed
nwparker wants to merge 5 commits into
mainfrom
nwparker/ci-bun-typecheck
Closed

nwparker wants to merge 5 commits into
mainfrom
nwparker/ci-bun-typecheck

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Keep fast TypeScript typechecks and reuse the latest successful result after each PR push. The measured ARM CI comparison did not justify switching to Bun.

What Changed

The old cache key was shared by every commit while a PR's base stayed unchanged. GitHub cache entries are immutable, so later successful checks could not publish their updated dependency graph. The new key includes the PR and head commit, restores the newest result for that PR first, then falls back to compatible base/shared caches. Changed files and their dependencies still get checked.

Add an isolated, fixed Bun checker and a repeatable manual CI comparison through the existing full-project scheduler. Production and local commands continue using incremental TypeScript; tests and localization retain their existing Bun version. The comparison is manual so ordinary PRs do not pay for repeated benchmarks.

Why

The actual ARM Linux runner showed a much larger benefit from usable incremental state than from Bun. This replaces the earlier 30–45 second CI saving estimated from local runs.

Cache state TypeScript before Bun candidate Bun saving
Existing restored cache 93.68 s 85.74 s 7.94 s (8.5%)
Cold incremental state 88.15 s 85.19 s 2.95 s (3.3%)
Same-source warm state 7.40 s 83.39 s 75.98 s slower

Paired ARM CI measurements and logs: two runs per compiler per condition, alternating order, identical source and cache bytes restored before each run. These are whole scheduler timings, excluding setup/cache transfer. Bun installation added three seconds. TypeScript was 7.0.2 and Bun was 1.4.3-canary.1+bd599f5af; the fixed npm artifact is recorded in config/.bun-typecheck-version. Runner: four ARM64 cores, 15.57 GiB RAM, Node 24.21.0.

Normal preflight observations were 87 seconds initially, 70 seconds after publishing per-head entries, 79 seconds while an exact legacy fallback still won, and 80 seconds after selecting the latest PR state. The checked source trees changed between runs as main advanced, so these differences are not controlled speedup measurements. The paired table above isolates the compiler/cache comparison.

Final preflight logs verify that the prefix-only policy restored the preceding PR head's cache (aef796b1539d) and successfully saved the current head (f3ed052a8064), about 2 MiB. An intermediate exact legacy base fallback kept winning in CI despite a newer PR cache; the final restore list contains only prefixes.

Warm results apply to reusable source state; broad source changes and cold runs remain slower. This does not claim every PR becomes a seven-second typecheck.

Linked Issue

N/A — maintainer-requested performance improvement.

Visual Proof

N/A — CI tooling only, with no application UI or interaction changes.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

All 53 focused scheduler, cache-workflow, sample-summary, and alternating-order tests pass locally on macOS. Formatting, lint, syntax, and workflow parsing pass. All 12 full-project checks passed in ARM CI, and both compilers rejected an invalid imported type. The initial normal CI gate and all ten unit shards passed. Final CI passed on f3ed052a806461c98ece59141752fba048ee977d: all 32 checks succeeded, including required verify, all ten unit shards, static analysis/typechecking, Linux and Windows packaging, mobile bundle, Git compatibility, shell contracts, and wire compatibility. Logs verify restore of the preceding PR head and successful save of the current one. The compiler-stream review finding is fixed and its thread resolved.

Review

The project list and memory admission policy are unchanged. Every project still runs after another fails. Compiler stream errors are reported after the child exits, so a failed pipe cannot crash the scheduler or admit another heavy project early; regression tests cover all three streams. The cache contains compiler state only; TypeScript validates source hashes. Cache saves happen after successful checks. Lockfile/configuration changes keep separate compatible cache prefixes.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Bun's checker requires a canary build, which is why the manual benchmark installs an immutable artifact without lifecycle scripts outside application dependencies. The production cache fix needs no new compiler. It adds one cache entry per successful PR head; normal GitHub eviction applies. Application runtimes, dependency installs, SSH execution, folder workspaces, mobile behavior, and local typecheck commands are unaffected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@nwparker nwparker changed the title Measure Bun for CI typechecking on ARM Linux Refresh TypeScript caches on every PR push Oct 8, 2026
@nwparker
nwparker marked this pull request as ready for review October 8, 2026 00:22
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 23857f43-2aca-4abc-a1b2-a6794e4881d7
📥 Commits

Reviewing files that changed from the base of the PR and between aef796b and f3ed052.

📒 Files selected for processing (2)
  • .github/workflows/pr.yml
  • config/scripts/pr-workflow-parallelism.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The changes add a composite action that installs and verifies a pinned Bun typechecker on Linux ARM64. The project runner can select Bun or Node for project checks. The PR workflow updates TypeScript cache keys and restore tiers, with related test updates. A manually dispatched workflow and benchmark script compare TypeScript and Bun using restored, cold, and warm cache states, validate type-error detection, and produce JSON and Markdown reports.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to f3ed0

No actionable merge-blocking issue is established in the reviewed cache-policy and test changes; proceed subject to the normal CI gate.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the primary change: refreshing TypeScript caches on every pull request push.
Description check Passed The description follows the required template, explains the cache change and Bun benchmark, documents testing and review considerations, and marks non-UI proof as not applicable. The maintainer-specif…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f66c253-3295-4b08-8304-709a94135f3a
📥 Commits

Reviewing files that changed from the base of the PR and between e9b3efa and 98aac2e.

📒 Files selected for processing (9)
  • .github/actions/setup-bun-typecheck/action.yml
  • .github/workflows/pr.yml
  • .github/workflows/typecheck-benchmark.yml
  • config/.bun-typecheck-version
  • config/scripts/ci-cache-warmup-workflow.test.mjs
  • config/scripts/ci-typecheck-benchmark.mjs
  • config/scripts/pr-workflow-parallelism.test.mjs
  • config/scripts/run-typecheck-projects-in-parallel.mjs
  • config/scripts/run-typecheck-projects-in-parallel.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@nwparker nwparker changed the title Refresh TypeScript caches on every PR push [CI] Refresh TypeScript caches on every PR push Oct 9, 2026
@nwparker

Copy link
Copy Markdown
Contributor Author

Closing as superseded: CI moved to Bun typechecking (#27382/#28106), and the tsbuildinfo cache step this edits no longer exists.

@nwparker nwparker closed this Oct 14, 2026
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