From 91e5924a07ef76b3df189443b93b1523d5888e33 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Tue, 10 Nov 2026 14:33:29 +0000 Subject: [PATCH] ci(create): warm up the monorepo cache check under every package manager (#3423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary `vp create monorepo (pnpm)` and `vp create monorepo (bun)` have failed on every run since #3418 bumped vite-task to cb1ea8d. The "Verify cache (monorepo only)" step expects 100% cache hits on the second `vp run ready` but gets 40%: ``` [1] test-project#ready: $ vp check → Cache miss: 'dist' added in 'packages/utils' [2] utils#test: vp test → Cache miss: 'dist' added in 'packages/utils' [4] website#build: tsc → Cache miss: 'dist' added in 'apps/website' ``` vite-task no longer skips `dist` entries in folder listings (voidzero-dev/vite-task#919). `ready` runs `vp check && vp run -r test && vp run -r build`, so `vp check`, `vp test`, and `tsc` list these folders before `vp pack` and `vp build` create `dist/` there. The second run then sees the new entry and misses. The third run hits. npm and yarn already got one extra warm-up for the `packages/utils/node_modules/` miss (#1638), so they kept passing. This PR gives pnpm and bun the same warm-up and rewrites the step's comment to describe both causes. #3418 didn't catch this because these jobs only run when create, template, or workflow files change. ## Not included This only fixes CI. A freshly created monorepo still needs three `vp run ready` runs to be fully cached. Fixing that is a separate change: - `vp check`, `vp lint`, `vp fmt`: oxlint and oxfmt skip gitignored folders, so the built-in cache config could add folder-entry exclusions for gitignored entries (`!**/dist`, `!**/node_modules`). `!**/dist/**` would be wrong: type-aware checks read other packages' `dist/*.d.ts`. - `vp test`: Vitest 5 doesn't read `.gitignore` and its default `exclude` doesn't cover `dist`, so it does search `dist` for test files. - `tsc` in the website's `build` script: a third-party command, so only per-package config can exclude `dist`. ## Test plan - [ ] `vp create monorepo` passes for pnpm, npm, yarn, and bun 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- .github/workflows/test-vp-create.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-vp-create.yml b/.github/workflows/test-vp-create.yml index 31ce989db7..38efa02f22 100644 --- a/.github/workflows/test-vp-create.yml +++ b/.github/workflows/test-vp-create.yml @@ -479,23 +479,20 @@ jobs: if: matrix.template.name == 'monorepo' working-directory: ${{ runner.temp }}/test-project run: | - # Under npm and yarn, `vp run ready` reaches 100% cache hit only on - # the third invocation (#1638): vite-task's directory-listing - # fingerprint and fspy read/write tracking surface false-positive - # misses on run #2 because `packages/utils/node_modules/` is born - # during run #1. pnpm and bun pre-create per-package - # `node_modules/` at install time and reach 100% on run #2; Yarn - # Berry did too under the old file: overrides (per-package copies), - # but with registry-resolved semver specs it hoists the workspace - # deps like a real install, so it now behaves like npm here. + # `vp run ready` reaches 100% cache hit only on the third + # invocation. vite-task fingerprints the folders a task lists, and + # entries born during run #1 surface as misses on run #2: + # - `dist/` under every package manager: `vp check`, `vp test`, and + # `tsc` list `packages/utils/` and `apps/website/` before + # `vp pack` and `vp build` create `dist/` there. vite-task stopped + # skipping `dist` entries in listings (voidzero-dev/vite-task#919). + # - `packages/utils/node_modules/` under npm and yarn (#1638): they + # hoist workspace deps, so the folder only appears during run #1. + # pnpm and bun create it at install time. # The preceding `Verify project builds` step already invoked # `vp run ready` once (verify-command for monorepo), so one # extra warm-up here is enough. - case "${{ matrix.package-manager }}" in - npm|yarn) - vp run ready >/dev/null 2>&1 - ;; - esac + vp run ready >/dev/null 2>&1 output=$(vp run ready 2>&1) echo "$output" if ! echo "$output" | grep -q 'cache hit (100%)'; then