Skip to content

ci: warm-up monorepo cache test under npm#1649

Merged
fengmk2 merged 1 commit into
mainfrom
ci/warm-up-monorepo-cache-test-1638
May 21, 2026
Merged

ci: warm-up monorepo cache test under npm#1649
fengmk2 merged 1 commit into
mainfrom
ci/warm-up-monorepo-cache-test-1638

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented May 21, 2026

Summary

  • Test-side band-aid for Fresh vp create monorepo requires 2–3 vp run ready invocations before cache stabilizes #1638: under npm, vp run ready requires three invocations before reaching 100% cache hit. The Verify cache (monorepo only) step previously asserted on what was effectively the second run and failed on the vp create monorepo (npm) matrix entry.
  • The preceding Verify project builds step already invokes vp run ready once (it's the monorepo template's verify-command at 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.
  • On assertion failure, dump vp run --last-details so 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:

  1. Directory-listing fingerprint of packages/utils/ sees node_modules as an added entry.
  2. fspy classifies vitest's reads/writes inside 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_modules in directory fingerprints + filter node_modules/.vite{,-temp}/ and node_modules/.cache/ from fspy tracking) can be filed as a new follow-up issue if/when desired.

Test plan

  • test-vp-create matrix: vp create monorepo (npm) turns green
  • pnpm / yarn / bun monorepo jobs stay green (single-run assertion unchanged)
  • On a deliberately-broken cache, the failure log shows vp run --last-details output with the per-task cache-miss reasons

Closes #1638

@fengmk2 fengmk2 self-assigned this May 21, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 21, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 60f9d0d
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a0ea7e4b5af3c00081fd1f9

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
@fengmk2 fengmk2 force-pushed the ci/warm-up-monorepo-cache-test-1638 branch from 90876c8 to 60f9d0d Compare May 21, 2026 06:36
@fengmk2 fengmk2 changed the title ci(test-vp-create): warm-up monorepo cache test under npm ci: warm-up monorepo cache test under npm May 21, 2026
@fengmk2 fengmk2 marked this pull request as ready for review May 21, 2026 06:39
@fengmk2 fengmk2 requested review from branchseer and cpojer May 21, 2026 06:39
@fengmk2 fengmk2 merged commit 5f5ce6e into main May 21, 2026
54 checks passed
@fengmk2 fengmk2 deleted the ci/warm-up-monorepo-cache-test-1638 branch May 21, 2026 06:43
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.

Fresh vp create monorepo requires 2–3 vp run ready invocations before cache stabilizes

2 participants