Skip to content

ci: start the Windows PR test jobs from the workspace images - #346270

Merged
Ladislau Szomoru (lszomoru) merged 1 commit into
mainfrom
lszomoru/agents/windows-workspace-image-setup
Nov 5, 2026
Merged

Ladislau Szomoru (lszomoru) merged 1 commit into
mainfrom
lszomoru/agents/windows-workspace-image-setup

Conversation

@lszomoru

Copy link
Copy Markdown
Member

Phase 2 of #345429, for Windows, after #346211 (the images), #346254 and #346256 (the deadline of the restore and its cleanup).

The Windows test jobs of pull requests now mount the workspace image that pr-workspace-images.yml builds on main, instead of creating an empty Dev Drive and restoring the node_modules and Playwright caches. With an image, the checkout keeps its untracked files and reuses its .git, and the usual install step runs on top of its node_modules, so pnpm installs only what changed since the commit of the image. Without an image, or on any error, the jobs set up as before. Linux and macOS follow in their own pull requests.

What changed

  • pr-win32-test.yml: before the checkout, the jobs download the image scripts at their commit (as pr-workspace-images.yml does, which a test keeps equal), set up Node.js, and restore the image (image.ts restore --timeout-seconds 240, within the 5 minutes of the step). With an image, the Dev Drive, node_modules cache and Playwright cache steps are skipped (the Playwright action would point PLAYWRIGHT_BROWSERS_PATH into the workspace instead of the image), and the checkout uses clean: false.
  • The smoke test shard with the WSL suite (1ES pool) runs none of the image steps and keeps today's setup.
  • pr.yml: windows-tests gets actions: read, to find and download the images, and passes workspace_image_branch: ${{ github.base_ref }}, so that pull requests to release branches look for images of their own branch, find none, and set up as before.
  • There is no step that compares the dependencies with the image: image.ts has no deps command since build: remove the install-state fast path and install-fast #346049, and the install step runs on top of the image instead.
  • The README of the images, the header of pr-workspace-images.yml, build/ripple/vscode.jsonc (the image scripts define the test jobs) and detectMissingCaches.test.ts (the steps before the Dev Drive) follow.

What to look for in the checks of this pull request

  • In each Windows job except Electron-Smoke (shard 1/3): "Restore the workspace image" finds the image of main, mounts it and sets used=true, and the job summary reports the restore; the Dev Drive, Restore node_modules cache and Restore Playwright browsers steps are skipped; Setup Electron keeps the prepared Electron; Install dependencies installs nothing new; Install Playwright Chromium downloads nothing.
  • Electron-Smoke (shard 1/3) sets up as before.
  • The time from the start of a job to its first test step, against the same jobs of recent pull requests.

Validation:

  • cd build && node --test lib/test/detectMissingCaches.test.ts lib/test/detectChanges.test.ts lib/test/workspaceImage.test.ts lib/test/agentHostTestSelection.test.ts: 35 passed
  • go run github.com/rhysd/actionlint/cmd/actionlint@latest -shellcheck= .github/workflows/pr-win32-test.yml .github/workflows/pr.yml .github/workflows/pr-workspace-images.yml: only unknown custom runner labels

Copilot AI balanced review requested due to automatic review settings November 5, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The newly enabled VHDX restore path affects nearly all Windows PR test jobs, but successful mounts and failure/timeout cleanup and fallback require Windows-runner validation that this source-only review could not provide.

No open issues 🎉

What changed in this PR

This PR enables workspace-image reuse for Windows PR test jobs, building on the image producer and restore-cleanup work. Linux and macOS adoption remains separate.

Changes:

  • Restore images before checkout and reuse prepared dependencies, Electron, and Playwright browsers, with the existing setup as fallback.
  • Preserve the WSL smoke shard’s setup and pass the target branch plus artifact-read permissions to Windows jobs.
  • Update workflow consistency tests, change detection, and documentation.
File Description
build/​ripple/​vscode.jsonc Includes image scripts in test-job change detection.
build/​lib/​test/​workspaceImage.test.ts Checks that Windows producer and consumer download scripts identically.
build/​lib/​test/​detectMissingCaches.test.ts Updates Dev Drive ordering assertions for image restoration.
.github/​workflows/​workspace_image/​README.md Documents Windows adoption, fallback, and cache handling.
.github/​workflows/​pr.yml Grants artifact-read access and passes the PR target branch.
.github/​workflows/​pr-workspace-images.yml Updates header comments to reflect Windows adoption.
.github/​workflows/​pr-win32-test.yml Adds image restoration and conditional checkout/cache behavior while preserving the WSL exception.

Review effort: Balanced

Phase 2 of #345429, for Windows: the Windows test jobs of pull requests
mount the workspace image that pr-workspace-images.yml builds on main,
instead of creating an empty Dev Drive and restoring the node_modules
and Playwright caches. With an image, the checkout keeps its untracked
files and reuses its .git, and the usual install step runs on top of
its node_modules, so pnpm installs only what changed since the commit
of the image. Without an image, or on any error, the jobs set up as
before. The Linux and macOS test jobs follow in their own pull requests.

The smoke test shard with the WSL suite, on the 1ES pool, runs none of
the image steps and keeps today's setup. Pull requests to release
branches look for images of their own branch, find none, and set up as
before. The windows-tests call in pr.yml grants actions: read, to find
and download the images. The restore step passes --timeout-seconds 240,
within the 5 minutes of the step, so that image.ts gives up and cleans
up before the runner stops it.

Unlike in the pull request, the jobs have no step that compares the
dependencies with the image, as image.ts has no `deps` command since
image.ts expects, as pr-workspace-images.yml does, which a test keeps
equal.

Co-authored-by: Alex Dima <alexdima@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lszomoru
Ladislau Szomoru (lszomoru) merged commit 586f769 into main Nov 5, 2026
59 checks passed
@lszomoru
Ladislau Szomoru (lszomoru) deleted the lszomoru/agents/windows-workspace-image-setup branch November 5, 2026 20:10
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 5, 2026
Ladislau Szomoru (lszomoru) added a commit that referenced this pull request Nov 5, 2026
Phase 2 of #345429, for Linux, after #346270 for Windows: the Linux test
jobs of pull requests mount the workspace image that
pr-workspace-images.yml builds on main, an ext4 volume on a loop device at
the parent of the workspace, instead of restoring the node_modules and
Playwright caches. With an image, the checkout keeps its untracked files
and reuses its .git, and the usual install steps (the build root, then the
root with setup-env.sh) run on top of its node_modules, so pnpm installs
only what changed since the commit of the image, and setup-env.sh reuses
the sysroots and compilers in its .build folder. The system packages are
not in the image, and are installed as before. Without an image, or on any
error, the jobs set up as before.

The jobs download the scripts of the image exactly as the job that builds
the Linux image does, which the test of the Windows jobs now also checks
for the Linux jobs. Pull requests to release branches look for images of
their own branch, find none, and set up as before. The linux-tests call in
pr.yml grants actions: read, to find and download the images. The restore
step passes --timeout-seconds 240, within the 5 minutes of the step, so
that image.ts gives up, unmounts the image and detaches the loop device
before the runner stops it.

Co-authored-by: Alex Dima <alexdima@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants