perf(ci): trim redundant install and unneeded build scripts from CF builds#248
Merged
Conversation
…uilds Workers Builds runs `pnpm install` before the build command, but bin/build ran a second `pnpm install --store=node_modules/.pnpm-store`. That relocated store forced node_modules to be recreated and fragmented it from the auto-install's store, so the cached install re-downloaded every package (logs showed `reused 0`). Only install in bin/build when node_modules is actually missing (clean local checkout), without `--store`. Also drop cypress, keytar, and @vscode/vsce-sign from allowBuilds — their install/build scripts (Cypress binary download, vscode native builds) aren't needed by the viewer build or runtime. The e2e workflow already installs the Cypress binary explicitly; vscode publishing deps are unused in CI. Cuts roughly a minute off each Worker build, on both the topology and graphs Workers.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
pi-base-topology | 9dbe57f | Commit Preview URL Branch Preview URL |
Jun 28 2026, 02:41 AM |
Deploying topology with
|
| Latest commit: |
9dbe57f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4b93f93a.topology.pages.dev |
| Branch Preview URL: | https://perf-lean-cf-builds.topology.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Each Cloudflare Workers build was doing substantially more work than needed, and this multiplies across the two git-connected Workers (
pi-base-topology+pi-base-graphs) that build on every push.Two issues, both visible in the build logs:
Dependencies were installed twice. Workers Builds auto-runs
pnpm install --frozen-lockfilebefore the build command, butbin/buildthen ran a secondpnpm install --store=node_modules/.pnpm-store. The relocated store forced node_modules to be recreated (Recreating /opt/buildhome/repo/node_modules) and fragmented it from the auto-install's store, so even warm builds re-downloaded every package (reused 0).Install ran build scripts the deploy doesn't need.
allowBuildsapproved Cypress (binary download, ~20s), keytar and@vscode/vsce-sign(native builds) — none of which the viewer build or runtime touches.What changed
bin/build: only install whennode_modulesis genuinely missing (clean local checkout); drop the--storerelocation so the CI dependency cache is actually reused.pnpm-workspace.yaml: removecypress,keytar,@vscode/vsce-signfromallowBuilds. Kept@sveltejs/kit,esbuild,svelte-preprocess, which the viewer build needs.Safety / blast radius
testande2eworkflows are unaffected.pnpm --filter viewer exec cypress install) and notes the postinstall is skipped on warm cache.vsce publishdeps — nothing invscode/srcimports keytar, and the unit-test workflow (--recursive test:cov) skips vscode (notest:covscript).Expected impact
Removes the redundant ~23s install and lets the remaining install hit the warm cache instead of re-downloading — roughly ~1 min off each build, on both Workers, every push.
Verifying
On the next build, the log should show: no second
pnpm install; cypress/keytar/vsce-sign in the "Ignored build scripts" line; and the auto-install reporting a meaningfulreused N.Not included (intentionally deferred)