Skip to content

ci: Shorten CircleCI setup, report coverage sooner, speed up the website check - #4201

Merged
ntucker merged 3 commits into
masterfrom
claude/project-thread-0atpd1
Oct 5, 2026
Merged

ntucker merged 3 commits into
masterfrom
claude/project-thread-0atpd1

Conversation

@ntucker

@ntucker ntucker commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Motivation

I timed the latest pushes on #4184, #4148, #4181 and #4192. PR CI takes 3–4 min, and CircleCI is the critical path. Its setup job takes about 1m40s, and 55s of that is just uploading a 334 MiB workspace. Codecov holds its status for another 30–50s after coverage is uploaded, until every CircleCI job finishes. The website check takes 2m37s cold, every time: it installs the Vercel CLI, runs a full uncached install, builds every package, and runs a Docusaurus build with no cache.

Solution

  • CircleCI workspace: stops persisting .yarn/cache (~130 MiB). Only jobs that run yarn up/add (unit_tests other than latest, node_matrix, esmodule-types) restore it, by prefix, before attach_workspace.
  • CircleCI cache key: the dependency cache key never matched exactly, because yarn up rewrote yarn.lock and the example package.json files between restore and save, so every run fell back to whichever cache was newest. The key now hashes the manifests as committed (git show HEAD:…).
  • codecov.yml (new): require_ci_to_pass: false and wait_for_ci: false, so coverage reports as soon as it's processed.
  • website build job:
    • Builds directly with yarn workspace rdc-website build and VERCEL_ENV=preview, so drafts are included like the preview deploy.
    • Uses the setup-node yarn cache and ci-install.sh website, and builds only the packages the site imports.
    • Caches Docusaurus' webpack cache, one entry per PR. Locally, a warm build took 27s instead of 1m43s.
    • Fails on any [WARNING]/[ERROR] line. onBrokenLinks/onBrokenMarkdownLinks go from log to warn, so broken links fail this check but never fail a Vercel deploy. Master currently builds with no warnings. I checked that an injected broken link fails the check.

Open questions

The workspace saving is an estimate, and this PR's own CircleCI run will measure it.

🤖 Generated with Claude Code

https://claude.ai/code/session_0174ShyuST1krJS2ZqzuLi9B


Generated by Claude Code


Note

Low Risk
CI and docs tooling only; no runtime app logic, though stricter website build warnings may surface new PR failures.

Overview
Speeds up CircleCI, Codecov, and the docs site CI by shrinking workspace uploads, fixing yarn cache keys, and replacing the Vercel-based website job with a cached local Docusaurus build.

CircleCI stops persisting .yarn/cache in the setup workspace (~130 MiB) and adds restore-yarn-cache for jobs that run yarn up/add (React matrix except latest, node_matrix, esmodule-types). Dependency cache keys move to v16-dependencies-{{ checksum ".ci-deps-key" }}, where .ci-deps-key hashes manifests from git show HEAD:… before trimming/yarn up rewrites them, so restore/save actually match.

codecov.yml sets require_ci_to_pass: false and notify.wait_for_ci: false so coverage status posts without waiting for all Circle jobs.

site-preview.yml collapses to a single build job: ci-install.sh website, new yarn ci:build:website, typecheck, restore/save Docusaurus webpack cache (save only on master push), then yarn workspace rdc-website build with VERCEL_ENV=preview instead of Vercel CLI. The job fails on [WARNING]/[ERROR] in the build log. docusaurus.config.ts changes broken link handling from log to warn so this check catches issues without breaking Vercel deploys.

Reviewed by Cursor Bugbot for commit fb19069. Bugbot is set up for automated code reviews on this repo. Configure here.

…the website check

- setup no longer copies the yarn cache into the workspace; only jobs that
  re-resolve dependencies restore it. The cache key now hashes the committed
  manifests, so it hits exactly instead of always falling back.
- codecov reports as soon as coverage is processed instead of waiting for
  every CI job.
- The website check builds the site directly with a cached webpack build,
  builds only the packages it imports, and fails on build warnings. Broken
  links now log as warnings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174ShyuST1krJS2ZqzuLi9B
@changeset-bot

changeset-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fb19069

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ntucker ntucker self-assigned this Oct 5, 2026
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs-site Ignored Ignored Preview Oct 5, 2026 7:53pm UTC

Request Review

@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (c5e95d4) to head (fb19069).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4201   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files         165      165           
  Lines        3145     3145           
  Branches      626      626           
=======================================
  Hits         3085     3085           
  Misses         18       18           
  Partials       42       42           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntucker
ntucker marked this pull request as ready for review October 5, 2026 19:39
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

- Downstream jobs restore the dependency cache by the same key setup saved
  (carried in the workspace) instead of whichever entry is newest. The cache
  no longer holds install-state.gz, so restoring after attach_workspace is safe.
- The website typecheck and build share one job and one install;
  ci:build:website builds types and the packages the site imports in parallel.
- The webpack cache key drops head_ref: caches are already scoped per PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174ShyuST1krJS2ZqzuLi9B

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Staff engineer (Cursor agent): LGTM at c862947. No changes requested for this PR.

What I checked:

  • CircleCI cache key. Hashing the committed manifests with git show HEAD: fixes a real bug: the old key was computed after yarn up rewrote yarn.lock, so it never matched exactly. restore-yarn-cache runs after attach_workspace, which it must, because .ci-deps-key comes from the workspace. Only the jobs that run yarn up restore the cache. unit_tests-latest, the coverage job and the critical path, skips it. The other jobs only use yarn run, and the persisted install-state.gz covers that. The first commit's CircleCI run went green on every job.
  • codecov.yml. Only unit_tests-latest uploads coverage, so wait_for_ci: false can't post a partial report that changes as more uploads arrive. Codecov isn't a required check, so require_ci_to_pass: false doesn't loosen any gate.
  • Website check. Dropping the Vercel CLI and secrets is a real simplification, and fork PRs can now run the check. On this push it finished in 2m26s on a cold cache with no [WARNING] lines. The webpack cache entry it saved is 73 MiB, not ~600 MiB. That matters because the repo's Actions cache is already at its 10 GB limit (about 10.8 GB in 70 entries), so a per-PR entry of that size is cheap. warn for broken links, plus a grep gate here, is the right split: the check fails, but a Vercel deploy doesn't.
  • .cursor/rules/ci-config.mdc is updated to match. Good, that keeps the next CI edit from drifting.

FOLLOW_UP (optional, after merge): caches are scoped to each PR, and nothing on master saves website-build-*, so every PR's first website build is still cold. Saving the cache from a push-to-master run (for example in site-release.yml) would make first pushes warm, since PRs can restore from the base branch. With PR runs switched to actions/cache/restore only, there'd be one entry per lockfile instead of one per PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174ShyuST1krJS2ZqzuLi9B
@ntucker
ntucker merged commit c26c1bb into master Oct 5, 2026
23 of 24 checks passed
@ntucker
ntucker deleted the claude/project-thread-0atpd1 branch October 5, 2026 19:58
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.

2 participants