internal: Trim CI workspaces to only what each job needs#3793
internal: Trim CI workspaces to only what each job needs#3793
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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 |
There was a problem hiding this comment.
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.


Motivation
Every GitHub Actions workflow was installing the full monorepo workspace — including heavy deps like
playwright,@tanstack/react-query,swr, andwebpackfromexamples/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:benchmark.ymlpackages/*,examples/benchmark,scripts/rollup-pluginsbenchmark-react.ymlpackages/*,examples/benchmark-react,scripts/rollup-pluginsbundle_size.ymlpackages/*,examples/test-bundlesize,scripts/rollup-pluginsrelease.ymlpackages/*,scripts/rollup-pluginsbeta-release.ymlpackages/*,scripts/rollup-pluginsscripts/rollup-pluginsis required everywhere since all packages declare it as aworkspace:*devDep.Uses an explicit set rather than filter so new workspaces added to root
package.jsonwon't accidentally leak into CI.Also: CircleCI setup updated to exclude the
websiteworkspace, andAGENTS.mdupdated 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.jsonworkspaces and dropping--immutable, which could cause unexpected dependency resolution or missing workspace packages in CI.Overview
CI jobs now rewrite root
package.jsonworkspacesto an explicit minimal set per workflow (benchmarks, bundle-size, and releases) before runningyarn install, to avoid installing unrelated example/website dependencies.Release and benchmark workflows also switch from
yarn install --immutabletoyarn install, and CircleCI’ssetupjob updates its workspace-pruning to exclude thewebsiteworkspace.AGENTS.mdadds 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.