Skip to content

ci: start the Linux PR test jobs from the workspace images - #346362

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

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

Conversation

@lszomoru

Copy link
Copy Markdown
Member

Phase 2 of #345429, for Linux, after #346270 for Windows.

The Linux test jobs of pull requests now 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 run 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. macOS follows in its own pull request.

What changed

  • pr-linux-test.yml: before the checkout, the jobs download the image scripts at their commit (exactly as the Linux job of pr-workspace-images.yml does, which a test now also checks for Linux), set up Node.js, and restore the image (image.ts restore --timeout-seconds 240, within the 5 minutes of the step; on failure it unmounts the image and detaches the loop device). With an image, the 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 install steps are unchanged and run on top of the image: the build root install, then the root install, whose setup-env.sh reuses the sysroots, Clang and libc++ in the .build folder of the image. The apt packages (xvfb, libkrb5-dev, …) aren't in the image and are installed as before.
  • pr.yml: linux-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.
  • No step compares the dependencies with the image (the prototype's image.ts deps, which no longer exists).
  • The README of the images and the header of pr-workspace-images.yml follow. build/ripple/vscode.jsonc already lists .github/workflows/workspace_image/** since ci: start the Windows PR test jobs from the workspace images #346270.

What to look for in the checks of this pull request

  • In each Linux job: "Restore the workspace image" finds the image of main, mounts it on a loop device and sets used=true, and the job summary reports the restore; Restore node_modules cache and Restore Playwright browsers are skipped; Install dependencies prints "Using cached client sysroot"/"Using cached remote sysroot" and installs nothing new; Setup Electron keeps the prepared Electron when its inputs match; Install Playwright Chromium downloads nothing.
  • The time from the start of a job to its first test step, against the same jobs of recent pull requests that hit the node_modules cache.

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-linux-test.yml .github/workflows/pr.yml .github/workflows/pr-workspace-images.yml: only unknown custom runner labels
  • The native build inputs (NATIVE_BUILD_INPUTS of image.ts) of the newest Linux image of main are the same as on this branch.

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>
Copilot AI balanced review requested due to automatic review settings November 5, 2026 20:20

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

No Linux CI results were provided to validate image-hit and fallback runs, timeout cleanup, loop-device mounting, or checkout and native dependency reuse.

No open issues 🎉

What changed in this PR

Extends workspace-image reuse to Linux PR test jobs, following the Windows rollout, to reduce setup time while preserving the existing cache-based setup when an image is unavailable or restoration fails.

Changes:

  • Restore Linux workspace images before checkout, preserve their dependencies, and skip redundant dependency and Playwright cache restores.
  • Grant Linux jobs image-download permissions and select images from the PR’s target branch.
  • Extend script-download consistency tests to Linux and update rollout documentation.
File Description
build/​lib/​test/​workspaceImage.test.ts Adds Linux coverage to the image-script download consistency test.
.github/​workflows/​workspace_image/​README.md Documents Linux adoption and reuse of image-provided build tools.
.github/​workflows/​pr.yml Grants image-download permissions and passes the target branch.
.github/​workflows/​pr-workspace-images.yml Updates the header comment to reflect Linux adoption.
.github/​workflows/​pr-linux-test.yml Adds image restoration, conditional checkout cleaning, and cache bypasses.

Review effort: Balanced

@lszomoru
Ladislau Szomoru (lszomoru) merged commit 03dee5a into main Nov 5, 2026
60 checks passed
@lszomoru
Ladislau Szomoru (lszomoru) deleted the lszomoru/agents/linux-workspace-image-setup branch November 5, 2026 21:01
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 5, 2026
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