ci: warm-up monorepo cache test under npm#1649
Merged
Merged
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
The `Verify cache (monorepo only)` step expected 100% cache hit on the second `vp run ready`. Under npm this fails because vite-task treats the appearance of `packages/utils/node_modules/` (created by vitest's deps optimizer + tsdown during run #1) as an input change, and fspy classifies vitest's reads/writes inside `node_modules/.vite/` as a read-write overlap that refuses to cache. pnpm/yarn/bun pre-create per-package `node_modules/` at install time and don't hit either bug. As a test-side band-aid, add one warm-up `vp run ready` under npm before asserting (the preceding `Verify project builds` step already invoked `vp run ready` once via the matrix verify-command, so one extra warm-up is enough to land on the third — first 100% — invocation). pnpm/yarn/bun keep the original single-run assertion. On failure, dump `vp run --last-details` to surface per-task cache-miss reasons. Refs #1638
90876c8 to
60f9d0d
Compare
cpojer
approved these changes
May 21, 2026
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.
Summary
vp create monoreporequires 2–3vp run readyinvocations before cache stabilizes #1638: under npm,vp run readyrequires three invocations before reaching 100% cache hit. TheVerify cache (monorepo only)step previously asserted on what was effectively the second run and failed on thevp create monorepo (npm)matrix entry.Verify project buildsstep already invokesvp run readyonce (it's the monorepo template'sverify-commandat line 125 of this file), so we add one extra warm-up under npm — that lands the assertion on the third invocation, the first to reach 100%. pnpm/yarn/bun keep the original single-run assertion since they already pass.vp run --last-detailsso per-task cache-miss reasons surface directly in the CI log.Why npm only
Under npm with full hoisting,
packages/utils/node_modules/does not exist until run #1 — vitest's deps optimizer + tsdown's temp dir create it. Two distinct vite-task bugs then trip on run #2:packages/utils/seesnode_modulesas an added entry.node_modules/.vite/as a read-write overlap →CacheNotUpdatedReason::InputModified, no cache entry written.pnpm/yarn/bun pre-create per-package
node_modules/during install, so neither bug triggers there.This is the "test-side band-aid" path called out in #1638. The proper vite-task fix (ignore
node_modulesin directory fingerprints + filternode_modules/.vite{,-temp}/andnode_modules/.cache/from fspy tracking) can be filed as a new follow-up issue if/when desired.Test plan
test-vp-creatematrix:vp create monorepo (npm)turns greenvp run --last-detailsoutput with the per-task cache-miss reasonsCloses #1638