Skip to content

fix: disable vp CLI caching and add force-install test matrix#13

Merged
fengmk2 merged 6 commits intomainfrom
disable-cache-on-ci-test
Mar 19, 2026
Merged

fix: disable vp CLI caching and add force-install test matrix#13
fengmk2 merged 6 commits intomainfrom
disable-cache-on-ci-test

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Mar 19, 2026

Summary

  • Temporarily disable vp CLI caching (restoreVpCache / saveVpCache) with early returns to avoid the Windows Cannot find module 'which' issue (Windows runner failures with latest action version #10). Original code is preserved with FIXME comments.
  • Add SETUP_VP_FORCE_INSTALL env var to bypass vp CLI cache (for future use when caching is re-enabled)
  • Add force-install: [false, true] matrix to all test jobs to cover both cached and fresh install paths
  • Revert install URLs back to viteplus.dev

Changes

  • src/cache-vp.ts: Add early returns to disable caching, original code preserved
  • src/cache-vp.test.ts: Skip cache restore/save tests with describe.skip and FIXME comments
  • src/install-viteplus.ts: Revert install URLs to viteplus.dev
  • .github/workflows/test.yml: Add force-install matrix to all test jobs, add vp exec / vp run test jobs

Test plan

Closes #10

🤖 Generated with Claude Code

fengmk2 added 6 commits March 19, 2026 19:30
Internal-only mechanism for CI testing. When SETUP_VP_FORCE_INSTALL
is set to "true" or "1", the action skips cache restore/save and
always does a fresh install. Test matrix now covers both cached and
uncached paths across all platforms.
Disable restoreVpCache and saveVpCache at the code level until a new
vite-plus release fixes the 'Cannot find module which' error on Windows.
Tests are skipped with describe.skip and FIXME comments.
@fengmk2 fengmk2 marked this pull request as ready for review March 19, 2026 11:56
Copilot AI review requested due to automatic review settings March 19, 2026 11:56
@fengmk2 fengmk2 changed the title feat: add SETUP_VP_FORCE_INSTALL env var to bypass vp CLI cache fix: disable vp CLI caching and add force-install test matrix Mar 19, 2026
@fengmk2 fengmk2 enabled auto-merge March 19, 2026 11:57
@fengmk2 fengmk2 merged commit af9f92c into main Mar 19, 2026
33 checks passed
@fengmk2 fengmk2 deleted the disable-cache-on-ci-test branch March 19, 2026 11:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to introduce an internal mechanism (SETUP_VP_FORCE_INSTALL) to bypass the vp CLI cache so CI can exercise both “cached” and “fresh install” paths (motivated by Windows failures in #10). In the current diff, vp CLI caching is instead disabled unconditionally, while CI matrices are expanded to run with and without the env var.

Changes:

  • Update vp installer URLs from staging.viteplus.dev to viteplus.dev.
  • Disable vp CLI cache restore/save unconditionally and skip the related unit tests.
  • Expand GitHub Actions job matrices with a force-install dimension and set SETUP_VP_FORCE_INSTALL in job env.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

File Description
src/install-viteplus.ts Switches install script URLs to production domain.
src/cache-vp.ts Forces vp cache restore/save off via early returns and logs.
src/cache-vp.test.ts Skips cache restore/save test suites.
.github/workflows/test.yml Adds force-install matrix and exports SETUP_VP_FORCE_INSTALL across multiple jobs.
Comments suppressed due to low confidence (1)

src/cache-vp.ts:43

  • The early return leaves the remainder of restoreVpCache() unreachable (cache key computation, restoreCache(), and error handling). If caching is meant to be temporarily disabled, consider moving the cache implementation behind a conditional (e.g., the force-install env var) rather than leaving dead code in place.
  // FIXME: Re-enable vp CLI caching after the new version of vite-plus is released
  // that fixes the Windows `Cannot find module 'which'` issue (#10).
  info("Vp CLI caching is temporarily disabled");
  return false;

  const vpHome = getVitePlusHome();
  const runnerOS = process.env.RUNNER_OS || platform();
  const runnerArch = arch();
  const primaryKey = `setup-vp-${runnerOS}-${runnerArch}-${version}-node${nodeVersion}`;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 34 to +39
export async function restoreVpCache(version: string, nodeVersion: string): Promise<boolean> {
// FIXME: Re-enable vp CLI caching after the new version of vite-plus is released
// that fixes the Windows `Cannot find module 'which'` issue (#10).
info("Vp CLI caching is temporarily disabled");
return false;

Comment on lines 63 to +68
export async function saveVpCache(): Promise<void> {
// FIXME: Re-enable vp CLI caching after the new version of vite-plus is released
// that fixes the Windows `Cannot find module 'which'` issue (#10).
info("Vp CLI caching is temporarily disabled, skipping save");
return;

Comment on lines +86 to 90
// FIXME: Re-enable these tests after vp CLI caching is re-enabled.
// Caching is temporarily disabled due to Windows `Cannot find module 'which'` issue (#10).
describe.skip("restoreVpCache", () => {
beforeEach(() => {
vi.stubEnv("RUNNER_OS", "Linux");
Comment on lines 15 to 20
os: [ubuntu-latest, macos-latest, windows-latest]
force-install: [false, true]
runs-on: ${{ matrix.os }}
env:
SETUP_VP_FORCE_INSTALL: ${{ matrix.force-install }}
steps:
Comment on lines +9 to +10
const INSTALL_URL_SH = "https://viteplus.dev/install.sh";
const INSTALL_URL_PS1 = "https://viteplus.dev/install.ps1";
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.

Windows runner failures with latest action version

2 participants