Skip to content

internal: Trim CI workspaces to only what each job needs#3793

Open
ntucker wants to merge 1 commit intomasterfrom
ci-trim-workspaces
Open

internal: Trim CI workspaces to only what each job needs#3793
ntucker wants to merge 1 commit intomasterfrom
ci-trim-workspaces

Conversation

@ntucker
Copy link
Collaborator

@ntucker ntucker commented Mar 19, 2026

Motivation

Every GitHub Actions workflow was installing the full monorepo workspace — including heavy deps like playwright, @tanstack/react-query, swr, and webpack from examples/benchmark-react — even in jobs that never use them (releases, bundle size, node benchmarks).

Solution

Each workflow now explicitly sets the exact workspaces it needs before yarn install:

Workflow Workspaces
benchmark.yml packages/*, examples/benchmark, scripts/rollup-plugins
benchmark-react.yml packages/*, examples/benchmark-react, scripts/rollup-plugins
bundle_size.yml packages/*, examples/test-bundlesize, scripts/rollup-plugins
release.yml packages/*, scripts/rollup-plugins
beta-release.yml packages/*, scripts/rollup-plugins

scripts/rollup-plugins is required everywhere since all packages declare it as a workspace:* devDep.

Uses an explicit set rather than filter so new workspaces added to root package.json won't accidentally leak into CI.

Also: CircleCI setup updated to exclude the website workspace, and AGENTS.md updated with a note about keeping CI in sync with workspace changes.

Open questions

N/A

Made with Cursor


Note

Medium Risk
CI install behavior is changed across release/benchmark/bundle-size workflows by dynamically rewriting root package.json workspaces and dropping --immutable, which could cause unexpected dependency resolution or missing workspace packages in CI.

Overview
CI jobs now rewrite root package.json workspaces to an explicit minimal set per workflow (benchmarks, bundle-size, and releases) before running yarn install, to avoid installing unrelated example/website dependencies.

Release and benchmark workflows also switch from yarn install --immutable to yarn install, and CircleCI’s setup job updates its workspace-pruning to exclude the website workspace. AGENTS.md adds a note to keep CI workspace trimming in sync with future workspace changes.

Written by Cursor Bugbot for commit ec2f32d. This will update automatically on new commits. Configure here.

Each GitHub Actions workflow now sets exactly the workspaces it requires
instead of installing everything. This avoids pulling in heavy deps like
playwright, @tanstack/react-query, swr, and webpack in jobs that never
use them.

CircleCI setup also updated to exclude the website workspace.

Made-with: Cursor
@vercel
Copy link

vercel bot commented Mar 19, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs-site Ignored Ignored Mar 19, 2026 1:09pm

@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: ec2f32d

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

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.06%. Comparing base (1f34136) to head (ec2f32d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3793   +/-   ##
=======================================
  Coverage   98.06%   98.06%           
=======================================
  Files         151      151           
  Lines        2843     2843           
  Branches      556      556           
=======================================
  Hits         2788     2788           
  Misses         11       11           
  Partials       44       44           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

node -e "const f='package.json',p=JSON.parse(require('fs').readFileSync(f));p.workspaces=['packages/*','scripts/rollup-plugins'];require('fs').writeFileSync(f,JSON.stringify(p,null,2)+'\n')"
corepack enable
yarn install --immutable
yarn install
Copy link

Choose a reason for hiding this comment

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

Trimmed workspaces may leak into changesets version PRs

High Severity

The node one-liner rewrites root package.json workspaces to ['packages/*', 'scripts/rollup-plugins'] before changesets/action runs. When the action creates a "Version Packages" PR, it stages all dirty files via git add ., which includes the trimmed package.json. If that PR is merged, the root package.json on master permanently loses all example workspace entries (examples/benchmark, examples/benchmark-react, examples/test-bundlesize, examples/normalizr-*, examples/coin-app, website), breaking local development and other CI workflows. The same issue applies to beta-release.yml. The changeset:version script's embedded yarn install also updates yarn.lock against the trimmed workspace set, compounding the lockfile drift.

Additional Locations (1)
Fix in Cursor Fix in Web

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