Repository navigation
ci: build workspace images of main for the PR test jobs - #346211
Merged
Ladislau Szomoru (lszomoru) merged 3 commits intoNov 5, 2026
Merged
Ladislau Szomoru (lszomoru) merged 3 commits into
Ladislau Szomoru (lszomoru) merged 3 commits into
Conversation
Phase 1 of #345429: pr-workspace-images.yml builds a disk image of a ready workspace of main for each platform, when an input of the install, of the native builds or of the prepared Electron changes on main. Nothing uses the images yet: the test workflows adopt them one platform at a time in follow-up pull requests. setup-electron stamps the Electron that it prepares in .build/electron.stamp, and keeps an Electron prepared from the same inputs, as the images hold. Jobs that start from an empty workspace prepare Electron as before. Unlike in the pull request, image.ts has no `deps` command, as #346049 removed the install state that it compared: a job that uses an image runs its install steps on top of it, and pnpm installs only what changed. Co-authored-by: Alex Dima <alexdima@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pr-workspace-images.yml also runs every day at 05:00 UTC, so that a recent image of main is always available: the images are kept for 2 days, and the pushes that change an input of the images can be days apart. image.ts trusts the images of the scheduled runs, which run on main like the pushes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The privileged ext4/APFS/ReFS image lifecycle and Win32 VHDX interop need creation, mounting, and restore/fallback validation across all three runner platforms; supplied checks cover only static checks and cache inputs.
No open issues 🎉
What changed in this PR
Adds phase-one infrastructure to build prepared workspace images of main for Linux, macOS, and Windows. PR test workflows do not consume the images yet; adoption is deferred to follow-up PRs.
Changes:
- Adds scheduled and input-triggered image builds with two-day artifact retention.
- Introduces image packing, restoration, compatibility checks, and Windows virtual-disk helpers.
- Adds Electron input stamps for reuse, documentation, and a test guarding native-build input parity with cache keys.
| File | Description |
|---|---|
build/lib/test/workspaceImage.test.ts |
Checks native-build inputs against dependency-cache key inputs. |
.github/workflows/workspace_image/vhd.ps1 |
Creates, mounts, and detaches Windows workspace disks. |
.github/workflows/workspace_image/Vhd.cs |
Provides Windows virtual-disk API bindings. |
.github/workflows/workspace_image/README.md |
Documents image design, trust checks, and planned adoption. |
.github/workflows/workspace_image/image.ts |
Implements image preparation, packing, discovery, and restoration. |
.github/workflows/pr-workspace-images.yml |
Builds and uploads prepared images for all three platforms. |
.github/workflows/node_modules_cache/README.md |
Documents reuse of stamped Electron installations. |
.github/actions/setup-electron/action.yml |
Stamps prepared Electron and skips preparation when inputs match. |
Review effort: Balanced
vhd.ps1 and Vhd.cs only build and attach the Windows images, so they move to workspace_image/win32. The jobs download the scripts into the same folders, so that image.ts finds vhd.ps1 in win32 both in the repository and on the runners. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
force-pushed
the
lszomoru/agents/phase1-build-workspace-images-main
branch
from
November 5, 2026 09:30
4c61b12 to
c8b5449
Compare
Ladislau Szomoru (lszomoru)
marked this pull request as ready for review
November 5, 2026 11:33
Ladislau Szomoru (lszomoru)
enabled auto-merge (squash)
November 5, 2026 11:33
Sandeep Somavarapu (sandy081)
approved these changes
Nov 5, 2026
Ladislau Szomoru (lszomoru)
deleted the
lszomoru/agents/phase1-build-workspace-images-main
branch
November 5, 2026 11:39
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of #345429: build the workspace images of
mainfor Linux, macOS and Windows, without changing any PR check. Nothing uses the images yet: the test workflows (pr-linux-test.yml,pr-darwin-test.yml,pr-win32-test.yml) adopt them one platform at a time in follow-up pull requests, which can then measure the gains on each platform. The design is in.github/workflows/workspace_image/README.md.Changes
pr-workspace-images.yml(new): builds a disk image of a ready workspace ofmain(dependencies, Electron, Playwright browsers,.git) on the runners of the test jobs, and uploads it as an artifact kept for 2 days. It runs every day at 05:00 UTC, when an input of the install, of the native builds or of the prepared Electron changes onmain, onworkflow_dispatch, and onworkflow_call.workspace_image/(new):image.tsbuilds, packs and restores the images (dependency-free, as the jobs run it before they check out);win32/vhd.ps1andwin32/Vhd.cscreate and attach the Windows VHDX with the virtual disk API.setup-electron: stamps the Electron that it prepares in.build/electron.stamp, and keeps an Electron prepared from the same inputs, as an image holds. Today's jobs start from an empty workspace, so they prepare Electron as before;lookup-onlyis unchanged. This lands now because a change tosetup-electrondoesn't rebuild the images.workspaceImage.test.ts(new): checks thatNATIVE_BUILD_INPUTSinimage.tsmatches the inputs ofcomputeNodeModulesBaseCacheKey.Differences from #345429
image.ts depscommand: build: remove the install-state fast path andinstall-fast#346049 removed the install state (build/npm/installStateHash.ts,.postinstall-state) that it compared. A job that uses an image will run its install steps on top of it, and pnpm installs only what changed.image.tstrusts the images of scheduled runs.workspace_image_branchinput onmain.actions: readfor them inpr.yml, theworkspace_image/**entry inbuild/ripple/vscode.jsonc, and thedetectMissingCaches.test.tsupdate for Windows.How to test
pushtrigger for the branch, since dropped: run 42001446886 built all three platforms, and run 42002398690 built them again after the move of the Windows scripts intowin32/. Images built from a branch are never used: jobs only use images ofmain.main;gh workflow run pr-workspace-images.ymlalso builds the images on demand.setup-electronchanged: they exercise the stamp with an empty workspace.Validation run locally:
./node_modules/.bin/tsc --noEmit --strict --module nodenext --moduleResolution nodenext --target es2024 --lib es2024,dom --types node --skipLibCheck --erasableSyntaxOnly --noUnusedLocals --noUnusedParameters .github/workflows/workspace_image/image.ts: passed./node_modules/.bin/eslint .github/workflows/workspace_image/image.ts build/lib/test/workspaceImage.test.ts: passedcd build && node --test lib/test/workspaceImage.test.ts lib/test/detectMissingCaches.test.ts lib/test/detectChanges.test.ts: passed (23 tests)go run github.com/rhysd/actionlint/cmd/actionlint@latest -shellcheck= .github/workflows/pr-workspace-images.yml: only the custom runner labels are reported