Skip to content

Engineering - start more pull request jobs from the workspace images - #347275

Merged
Ladislau Szomoru (lszomoru) merged 2 commits into
mainfrom
lszomoru/agents/pr-checks-workspace-image-adoption
Nov 10, 2026
Merged

Ladislau Szomoru (lszomoru) merged 2 commits into
mainfrom
lszomoru/agents/pr-checks-workspace-image-adoption

Conversation

@lszomoru

@lszomoru Ladislau Szomoru (lszomoru) commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Follow-up of #345429 ("Other jobs" follow-up): the Linux and Windows test jobs of pull requests start from the workspace images of main, but the other jobs of pr.yml that install the dependencies still restore the pnpm store cache and install into an empty workspace.

What changes

These jobs of pr.yml now mount the workspace image before the checkout, exactly like the test jobs of pr-linux-test.yml and pr-win32-test.yml:

  • Compile & Hygiene
  • Monaco Editor
  • Copilot - Check Test Cache
  • Copilot - Test (Linux)
  • Copilot - Test (Windows)
  • chat-lib - Test (Linux)

With an image, the checkout keeps its untracked files and reuses its .git, and the existing install steps install only what changed since the commit of the image. Copilot and chat-lib are members of the root workspace since #347258, which an image holds installed, so the filtered Copilot and chat-lib installs are also incremental.

Without an image (none of main, a pull request to a release branch, other native build inputs than the image's, or any error or timeout of the restore), these jobs run their install steps with a plain pnpm install: they no longer restore the pnpm store cache. Unlike the test jobs, which still fall back to the store cache.

  • Shared steps: the download, Node.js and restore steps are defined once in Compile & Hygiene and reused with YAML anchors, since a local action can't run before the checkout. The restore picks the Linux or Windows image from runner.os, and uses the base branch like the test jobs.
  • Permissions: the jobs get actions: read to find and download the image artifacts. Monaco Editor had permissions: {}; it now has contents: read and actions: read.
  • Windows: Copilot - Test (Windows) sets GODEBUG=winreadlinkvolume=1, as pr-win32-test.yml does, so that esbuild resolves pnpm's junctions on the image, which is mounted without a drive letter.
  • test-chat-lib: a new restore-pnpm-store input (default 'true') skips the store cache, which chat-lib - Test (Linux) sets to 'false'. Its isolateChatLib.ts step (Engineering - install the built-in extensions, Copilot and the sanity tests in the root workspace #347258) removes only the links in the node_modules folders above extensions/copilot, so it stays fast on an image.
  • Guard test: workspaceImage.test.ts now checks that every job that uses the images downloads the scripts exactly like the jobs that build them.
  • Docs: the workspace image and CI caches READMEs and the header of pr-workspace-images.yml list the jobs that use the images, why the others don't, and how the pr.yml jobs install without one.

Not adopted

  • chat-lib - Test (Windows) keeps its standard windows-2025 runner and the pnpm store cache. An image can only be used on the larger runners that build it, whose workspace has the same path as the image. chat-lib-package.yml also keeps the store cache.
  • Windows / Electron-Smoke (WSL) runs on the 1ES pool, and WSL can't open folders on a volume that is mounted in a folder of drive C:.
  • Detect Changes, Telemetry, Copilot - Check Telemetry, Ripple, the Rust jobs, Cancel Run and PR Gate don't install the dependencies of the workspace, so an image would only add its download.

Reviewers should know

  • In recent pull request runs, the install step alone took about 2–3 minutes in Compile & Hygiene and Monaco Editor, and Copilot - Test (Windows) spent about 40 s restoring the store before installing. The test jobs that use an image install in seconds when the dependencies didn't change.
  • Without an image, these jobs now download every package, so they set up more slowly than with the store cache.
  • The Linux jobs only use an image whose native build inputs match the pull request's. The pnpm settings changed on main after the last Linux image (Engineering - install every pnpm root with the isolated linker #347200), and the push build of the Linux image after that change hit its 60-minute timeout in Install build tools. Until the next Linux image builds, the Linux jobs of this pull request run the plain install. Merging this pull request also builds new images, since it changes pr-workspace-images.yml.

How to test

This pull request's own checks run the changed jobs: each one reports in its job summary that it restored an image, or a Workspace image warning when it installed everything instead.

  • cd build && node --test lib/test/workspaceImage.test.ts lib/test/detectChanges.test.ts lib/test/detectMissingCaches.test.ts lib/test/agentHostTestSelection.test.ts: passed, 36 tests. Removing *image-scripts from one of the jobs makes the workspace image test fail.
  • cd build && pnpm run typecheck: passed.
  • ./node_modules/.bin/eslint build/lib/test/workspaceImage.test.ts: passed.
  • actionlint -shellcheck= .github/workflows/pr.yml (actionlint 1.7.12): passed, apart from the custom runner labels.
  • Not run locally: the jobs themselves, with and without an image, which this pull request's checks cover.

🤖 Authored with GitHub Copilot on behalf of Ladislau Szomoru (@lszomoru).

Compile & Hygiene, Monaco Editor, Copilot - Check Test Cache, Copilot - Test (Linux and Windows) and chat-lib - Test (Linux) mount the workspace image of main before the checkout, like the Linux and Windows test jobs, instead of restoring the pnpm store cache and installing into an empty workspace. The root postinstall of an image installs extensions/copilot too, so the Copilot and chat-lib jobs install only what changed since. Without an image, or on any error, the jobs set up as before.

The jobs share the image steps of Compile & Hygiene through YAML anchors, as a local action can't run before the checkout, and workspaceImage.test.ts checks that each of them downloads the scripts like the jobs that build the images. test-chat-lib gets a restore-pnpm-store input, and moves the node_modules folders above extensions/copilot out of the way instead of deleting them, which on an image would delete full installs.

chat-lib - Test (Windows) keeps its standard windows-2025 runner, whose workspace has another path than that of the images. The other jobs of pr.yml don't install the dependencies of the workspace.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…has no workspace image

The jobs of pr.yml that start from a workspace image no longer restore the pnpm store cache when there is no image, or the restore fails: their install steps install everything with pnpm install. chat-lib - Test (Linux) passes restore-pnpm-store: 'false' to test-chat-lib, while chat-lib - Test (Windows), which uses no image, and chat-lib-package.yml keep the store cache. The test jobs of pr-linux-test.yml and pr-win32-test.yml still restore the store cache without an image.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

Successful image-backed CI validation is still needed for the migrated Linux jobs, since current runs exercise only the fallback and leave mount/checkout, incremental-install, and chat-lib extraction behavior unverified.

No open issues 🎉

What changed in this PR

Extends workspace-image reuse to six additional pull request jobs, reducing dependency setup work by starting from preinstalled workspaces.

Changes:

  • Adds shared image restore steps, required permissions, and checkout preservation; these jobs use plain installs without a store cache when no image is available.
  • Makes chat-lib’s store-cache restore optional and moves ancestor node_modules folders aside instead of deleting them.
  • Expands the script-download guard test and documents image adoption and fallback behavior.

No actionable findings remain. Workflow execution with and without images still needs CI validation.

File Description
build/​lib/​test/​workspaceImage.test.ts Extends download-step consistency checks to the newly adopting jobs.
.github/​workflows/​workspace_image/​README.md Documents image consumers, runner constraints, and fallback behavior.
.github/​workflows/​pr.yml Adds image reuse to six jobs and Windows junction-resolution support.
.github/​workflows/​pr-workspace-images.yml Updates header comments to describe the broader consumer set.
.github/​workflows/​caches/​README.md Clarifies uncached installs when the newly adopting jobs lack an image.
.github/​actions/​test-chat-lib/​action.yml Adds optional cache restoration and moves ancestor dependencies out of module resolution.

Review effort: Balanced

auto-merge was automatically disabled November 10, 2026 09:20

Pull request was closed

@lszomoru
Ladislau Szomoru (lszomoru) merged commit 13af64a into main Nov 10, 2026
145 of 165 checks passed
@lszomoru
Ladislau Szomoru (lszomoru) deleted the lszomoru/agents/pr-checks-workspace-image-adoption branch November 10, 2026 09:44
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 10, 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.

4 participants