From ec4860ae3fce52c227256c7e2279832efe309683 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Tue, 10 Nov 2026 10:55:32 +0100 Subject: [PATCH] Engineering - start the Windows chat-lib job from the workspace image chat-lib - Test (Windows) moves from windows-2025 to the larger Windows runners, whose workspaces have the path of the workspace images, and mounts the image before the checkout like chat-lib - Test (Linux). Without an image, or on any error, it installs everything without the pnpm store cache, like the other jobs of pr.yml that use the images. It sets GODEBUG=winreadlinkvolume=1 like the other Windows jobs on an image. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/pr.yml | 19 ++++++++++++++++++- .github/workflows/workspace_image/README.md | 4 ++-- build/lib/test/workspaceImage.test.ts | 2 +- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 299f7a21ad839a..35e4c231da8cf0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -937,20 +937,37 @@ jobs: # - name: Test chat-lib # uses: ./.github/actions/test-chat-lib + # Runs on the larger runners, whose workspaces have the path of the workspace images chat-lib-windows-tests: name: chat-lib - Test (Windows) needs: changes if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.copilot == 'true') }} - runs-on: windows-2025 + runs-on: vscode-large-runners-windows-8-core timeout-minutes: 30 + # actions: read finds and downloads the workspace image (see Compile & Hygiene) permissions: contents: read + actions: read + env: + # The workspace image is mounted at the parent of the workspace without a drive letter, so + # esbuild needs the volume paths of pnpm's junctions (see pr-win32-test.yml) + GODEBUG: winreadlinkvolume=1 steps: + - *image-scripts + - *image-node + - *image-restore + - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + # With a workspace image, keeps its untracked files, such as node_modules, and reuses its .git + clean: ${{ steps.image.outputs.used != 'true' }} - name: Test chat-lib uses: ./.github/actions/test-chat-lib + with: + # Installs on top of the workspace image, or everything without an image + restore-pnpm-store: 'false' # When Compile & Hygiene finds a problem in the change, which has to be fixed and pushed again # anyway, this job cancels the run so that the test jobs free their machines for other pull diff --git a/.github/workflows/workspace_image/README.md b/.github/workflows/workspace_image/README.md index f074aeff1fcfb1..8b878f767edd7d 100644 --- a/.github/workflows/workspace_image/README.md +++ b/.github/workflows/workspace_image/README.md @@ -1,8 +1,8 @@ # Workspace images -Workspace images let the jobs of pull requests that install the dependencies start from a disk image of a workspace of `main` instead of an empty folder: the test jobs ([pr-linux-test.yml](../pr-linux-test.yml) and [pr-win32-test.yml](../pr-win32-test.yml)), and the Compile & Hygiene, Monaco Editor, Copilot test and Linux chat-lib test jobs of [pr.yml](../pr.yml). Its dependencies, Electron and the Playwright browsers are installed, and its `.git` holds the commit it was built at. A job mounts the image, checks out its own commit, and installs only what changed since, which for most pull requests is nothing. +Workspace images let the jobs of pull requests that install the dependencies start from a disk image of a workspace of `main` instead of an empty folder: the test jobs ([pr-linux-test.yml](../pr-linux-test.yml) and [pr-win32-test.yml](../pr-win32-test.yml)), and the Compile & Hygiene, Monaco Editor, Copilot test and chat-lib test jobs of [pr.yml](../pr.yml). Its dependencies, Electron and the Playwright browsers are installed, and its `.git` holds the commit it was built at. A job mounts the image, checks out its own commit, and installs only what changed since, which for most pull requests is nothing. -The Windows and Linux jobs that install the dependencies use the images, except two Windows jobs. The WSL smoke test job (`Windows / Electron-Smoke (WSL)`) runs on the 1ES pool and keeps its workspace on drive C: WSL cannot open folders on a volume that is mounted in a folder of drive C:. The Windows chat-lib test job (`chat-lib - Test (Windows)`) runs on a standard `windows-2025` runner. A job can only use an image on the runners that build it (`vscode-large-runners-ubuntu-8-core` and `vscode-large-runners-windows-8-core`), whose workspaces have the path of the workspace of the image. The other jobs of `pr.yml` don't install the dependencies of the workspace, so an image would only add its download: Detect Changes, Telemetry, Copilot - Check Telemetry, Ripple, the Rust jobs of [pr-linux-cli-test.yml](../pr-linux-cli-test.yml), Cancel Run and PR Gate. The macOS test jobs never adopted them, and are commented out in [pr.yml](../pr.yml) for now, like the job of [pr-workspace-images.yml](../pr-workspace-images.yml) that builds the macOS image. [What a job does](#what-a-job-does) describes the steps of a job that uses the images. +The Windows and Linux jobs that install the dependencies use the images, except the Windows WSL smoke test job (`Windows / Electron-Smoke (WSL)`), which runs on the 1ES pool and keeps its workspace on drive C: WSL cannot open folders on a volume that is mounted in a folder of drive C:. A job can only use an image on the runners that build it (`vscode-large-runners-ubuntu-8-core` and `vscode-large-runners-windows-8-core`), whose workspaces have the path of the workspace of the image. The other jobs of `pr.yml` don't install the dependencies of the workspace, so an image would only add its download: Detect Changes, Telemetry, Copilot - Check Telemetry, Ripple, the Rust jobs of [pr-linux-cli-test.yml](../pr-linux-cli-test.yml), Cancel Run and PR Gate. The macOS test jobs never adopted them, and are commented out in [pr.yml](../pr.yml) for now, like the job of [pr-workspace-images.yml](../pr-workspace-images.yml) that builds the macOS image. [What a job does](#what-a-job-does) describes the steps of a job that uses the images. [pr-workspace-images.yml](../pr-workspace-images.yml) builds an image for Linux and Windows on the runners of the jobs every day at 05:00 UTC, and when one of its inputs changes on `main`: those of the install, of the native builds (`NATIVE_BUILD_INPUTS` in `image.ts`) and of the prepared Electron. It doesn't build them for other pushes, as the checkout of a job fetches and writes only what changed since the commit of its image. The images are kept for 2 days, so the daily build keeps a recent image available. [image.ts](image.ts) restores, checks and builds them; it has no dependencies, as the jobs run it before they check out the repository. diff --git a/build/lib/test/workspaceImage.test.ts b/build/lib/test/workspaceImage.test.ts index 1e2a61f8c1c45e..c62a369bb34a55 100644 --- a/build/lib/test/workspaceImage.test.ts +++ b/build/lib/test/workspaceImage.test.ts @@ -44,7 +44,7 @@ suite('workspace images', () => { ['pr-workspace-images.yml', 'windows'], ['pr-linux-test.yml', 'electron-unit-electron'], ['pr-win32-test.yml', 'electron-unit'], - ...['compile', 'monaco-editor', 'copilot-check-test-cache', 'copilot-linux-tests', 'copilot-windows-tests', 'chat-lib-linux-tests'].map(job => ['pr.yml', job] as const), + ...['compile', 'monaco-editor', 'copilot-check-test-cache', 'copilot-linux-tests', 'copilot-windows-tests', 'chat-lib-linux-tests', 'chat-lib-windows-tests'].map(job => ['pr.yml', job] as const), ]; const builder = download('pr-workspace-images.yml', 'linux'); assert.deepEqual(