Commit Graph

685 Commits

Author SHA1 Message Date
Alexandru Dima ba2a3ee737 ci: pre-initialize fontconfig to fix Pango threaded-FcInit crash in smoke tests (#323015)
Symbolizing the intermittent Electron-startup SIGSEGV crash dumps (Ubuntu debug
symbols + frame-pointer walk) shows the fault is an upstream Pango concurrency
bug, not a VS Code bug:

    pango:      fc_thread_func -> init_in_thread -> FcInit()   (pangofc-fontmap.c)
    fontconfig: FcInit -> FcConfigParseAndLoadFromMemory -> _FcConfigParse
    libexpat:   XML_ParseBuffer -> libc  (NULL deref, SIGSEGV)

Pango >= 1.52's pango_fc_font_map_init() unconditionally spawns a
"[pango] fontconfig" thread that runs FcInit(); that races with the
Electron/Chromium main thread's own fontconfig use during startup and corrupts
fontconfig's global config while it is being parsed. The threaded design is a
known-bad area upstream (pango#784 "single fontconfig thread introduces a hang
... seems to be due to a race condition", pango#872), and there is no env var to
disable it (still present in Pango 1.56).

It only manifests in our CI because the race window is microscopic: it needs a
cold process, two threads hitting first-time FcInit() simultaneously, and a slow
machine. Our smoke job is a near-perfect trigger — fresh contended runners, a
wiped fontconfig cache + custom FONTCONFIG_FILE (so FcInit re-parses cold), and
~25 cold Electron starts per run. (This also explains why the expat version was
irrelevant and why dropping the config DOCTYPE made it worse: it is pure timing,
not parser/content.)

Fix: initialize fontconfig once, single-threaded, from an ELF constructor that
runs before main() (and thus before any thread exists), via a tiny LD_PRELOAD
shim. Pango's later threaded FcInit() then finds fontconfig already initialized
and returns immediately, so the concurrent parse never happens and the race is
eliminated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-25 22:53:43 +00:00
Alexandru Dima 84e743a053 Revert "ci: drop external DTD from minimal fontconfig to avoid expat NULL-deref crash" (#323009)
Revert "ci: drop external DTD from minimal fontconfig to avoid expat NULL-der…"

This reverts commit 70c0a5de8e.
2026-06-25 21:33:19 +00:00
Raymond Zhao c740f81b31 feat: add MSRC trailer check (#322988) 2026-06-25 11:47:11 -07:00
Alexandru Dima 70c0a5de8e ci: drop external DTD from minimal fontconfig to avoid expat NULL-deref crash (#322909)
The Linux smoke-test job works around the expat 2.6.1 fontconfig NULL-deref
CVEs by pointing FONTCONFIG_FILE at a minimal config with <include> removed.
However that config still declared an external DTD:

    <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">

fontconfig feeds that DTD to expat as an external *parameter* entity, which
still hits the not-yet-backported CVE-2026-32776 / CVE-2026-32778 crash paths
on expat 2.6.1 even with <include> gone. This was observed in CI as a SIGSEGV
inside libexpat (called from libfontconfig) during Chromium browser-process
font initialization, which crashed Electron at startup. Because the smoke-test
launch used no timeout, that crash surfaced only as an opaque 120s Mocha
"before all" hook timeout.

fontconfig does not require the DOCTYPE, so drop it to remove the last
external-entity codepath. The full workaround can be removed once the runner
ships libexpat >= 2.7.5 (the step already auto-disables itself in that case).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-25 15:06:31 +02:00
Henning Dieterichs a4f90ca16a Fetch oidc token just before uploading 2026-06-22 12:14:06 +02:00
Alexandru Dima 044134364a ci: split Electron PR test jobs into unit/integration and smoke (#322145)
* ci: split Electron test jobs into unit/integration and smoke

The Linux, Windows and macOS Electron PR test jobs are the slowest in CI,
dominated by the smoke test run. Split each into two parallel jobs - one
running unit + integration tests, the other running smoke tests - to cut
wall-clock time.

Done via two new parameters on the reusable workflows
(unit_and_integration_tests and smoke_tests, both defaulting to true) so
Browser and Remote jobs are unchanged. Artifact names get a -smoke suffix
on the smoke-only job to avoid upload collisions.

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

* ci: gate build and diagnostics to correct Electron test phase

Follow-up to the Electron job split. Ensure each half only does the work
it needs:

- Gate "Build integration tests" on unit_and_integration_tests so the
  smoke-only job skips it.
- Scope the before/after diagnostics steps to their phase (combined with
  always()) so they don't run in the wrong job.
- Move the Copilot extension build into the smoke phase (gated on
  smoke_tests) instead of compiling it unconditionally; align Linux,
  Windows and macOS on the same ordering.

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

* ci: drop space and parens from Electron-Smoke job name

The Windows 1ES runner builds its JobId label from job_name, producing
"windows-test-Electron (Smoke)-...". The space and parentheses prevented
the runner from picking up the job. Rename the smoke job to Electron-Smoke
on all three platforms so the JobId is a plain slug.

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

* Fixes

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-19 23:40:20 +02:00
Alexandru Dima 3980424ce8 Refactor restore-node-modules action for lookup-only functionality (#322140)
refactor: update restore-node-modules action to support lookup-only functionality

- Replaced 'extract' input with 'lookup-only' to allow cache entry checks without downloading or extracting.
- Updated action logic to conditionally extract node_modules based on the new 'lookup-only' input.
- Adjusted workflow files to utilize 'lookup-only' for cache-warming jobs on Linux, macOS, and Windows.
2026-06-19 19:38:47 +00:00
Alexandru Dima 37e7e85b10 Optimize node_modules caching for CI & PR checks (#322074)
* CI: speed up node_modules cache with zstd + shared scripts

Switch the Linux/macOS node_modules cache from single-threaded gzip
(tar -czf) to multi-threaded zstd. The "Create node_modules archive"
step was spending ~5min of single-core gzip on a multi-GB tree on every
cache miss; zstd -T0 uses all cores and decompresses much faster, so
cache-hit jobs benefit too. Windows stays on 7-Zip (already threaded).

Extract the archive/extract commands into shared per-platform scripts
under .github/workflows/node_modules_cache/ (cache.sh / cache.ps1, each
dispatching on an archive|extract argument) so the format and flags live
in one place instead of being duplicated across ~8 workflows. Bump
build/.cachesalt to invalidate existing gzip caches.

Also remove the obsolete extensions/copilot CI workflows
(copilot-setup-steps.yml, ensure-node-modules-cache.yml, pr.yml) and the
unused build/listBuildCacheFiles.js, and drop their now-stale entries
(plus lit-html and signals-core) from .eslint-allowed-javascript-files.

* ci: seed copilot node_modules cache on main and rename cache keys

Add copilot-linux and copilot-windows jobs to pr-node-modules.yml so the
copilot node_modules cache is populated on main. Rename the copilot cache
keys to copilot-node_modules-linux / copilot-node_modules-windows in pr.yml.

* ci: extract node_modules cache into composite actions

Factor the repeated node_modules cache plumbing into two local composite
actions, restore-node-modules and save-node-modules, and migrate all
workflows that used the cache.sh/cache.ps1 archive flow (pr, pr-node-modules,
pr-{linux,darwin,win32}-test, copilot-setup-steps, component-fixtures,
css-order-scan).

- restore-node-modules computes the key, restores the cache, optionally
  extracts on a hit, and exports the resolved key via $GITHUB_ENV.
- save-node-modules archives node_modules and saves it to the cache, reusing
  the key exported by restore so callers don't repeat the prefix.
- Bespoke install steps stay in the workflows, so per-job env/secrets never
  cross the action boundary.
- Only seed the cache on branch pushes (component-fixtures skips PRs, whose
  caches aren't shared).

* save the node_modules cache for now to test it

* ci: fix node_modules cache save dropping the archive

cache.sh wrote its archive as cache.tzst, but actions/cache reserves that
name for its own tarball and passes --exclude cache.tzst, so our archive was
excluded and an empty (~200 B) cache was saved on Linux/macOS. Rename the
archive to node-modules.tzst and bump build/.cachesalt to invalidate the
broken cache entries.

* empty commit

* Remove again saving to the node modules cache from PR steps
2026-06-19 17:21:43 +02:00
Henning Dieterichs 7533927257 improved cssOrderScan 2026-06-17 19:10:01 +02:00
Alex Ross 28af4cff05 Remove API version concept (#321391)
* Remove API version concept

* CCR feedback
2026-06-16 10:18:47 +00:00
Henning Dieterichs a2c29d6297 Fixes css-order-scan 2026-06-16 10:50:08 +02:00
Robo 26129ae2c5 ci: restore chat pipeline to windows-latest (#321364)
* ci: restore chat pipeline to windows-latest

* chore: remove node-gyp override

* chore: restore node-gyp override with comment

* refactor: rm dependency on key:sqlite

The module locks the node-gyp dependency to 8.x due to
its transitive sqlite3 native module dependency this in turn
blocks using newer windows CI, refs https://github.com/microsoft/vscode/issues/321267

The module can be replaced with built-in sqlite support
from Node.js without losing the on-disk cache format has
already been committed.

* chore: restore minimist

* chore: set sqlite busy timeout

* fix: decode json-buffer values for keyv cache compat
2026-06-16 16:47:48 +09:00
Henning Dieterichs 1edc47c502 Implements css order scanning for component fixtures 2026-06-15 23:05:31 +02:00
Alexandru Dima 7e9654b0a9 ci: pin chat-lib tests to windows-2022 (#321263)
The "chat-lib tests (windows-latest)" job started failing at the
"Extract chat-lib" step (npm ci in extensions/copilot). npm ci builds
the native sqlite3@5.1.7 module — a transitive dependency of the
@keyv/sqlite devDependency — via `prebuild-install -r napi || node-gyp
rebuild`. prebuild-install finds no matching prebuilt, so it falls back
to node-gyp, which fails on the runner because the GitHub-hosted
windows-latest label now resolves to the Windows Server 2025 + Visual
Studio 2026 image, whose VS 18 toolchain the bundled node-gyp cannot
detect ("unknown version undefined ... could not find a version of
Visual Studio 2017 or newer").

This was the only npm ci job exposed to the new image: every other
Windows npm ci job runs on self-hosted pools pinned to windows-2022
(still VS 2022), and all other copilot npm ci jobs run on Linux/macOS.
Pin this matrix entry to windows-2022 to match, as recommended by the
runner-images migration notice (actions/runner-images#14017).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-13 03:47:48 -07:00
Alex Ross 7c1dd895f5 Convert mock-llm-server.js to ts (#320567)
* Convert mock-llm-server.js to ts

* Ad eslint rule for no new js files

* Message
2026-06-09 15:08:47 +02:00
Alex Ross 5d49491aca Lots of logging for chat smoke tests and enable in PR builds (#320108)
* Lots of logging for chat smoke tests

* PR test workflows: build extensions/copilot before smoke tests

* PR test workflows: drop duplicate copilot compile from linux/win32 (was already built before integration tests)

* smoke tests: remove musl Claude binary on Linux glibc runner

The musl variant is probed first by @anthropic-ai/claude-agent-sdk and
fails to exec on glibc (ENOENT from missing ELF interpreter), which
caused the Test Claude session tests to time out.
2026-06-08 10:11:27 -07:00
Paul db6041c278 Disable chat perf main trigger (#319022) 2026-05-29 18:02:53 +00:00
Paul 4810972048 Run chat performance pipeline on commit (#318868) 2026-05-28 20:35:17 -07:00
Robo 843588fd83 chore: bump electron 42 header version for msvc compatibility (#318587) 2026-05-28 01:12:00 +00:00
Robo 1897fa3403 ci: fix windows node_modules cache for pr pipeline (#318558) 2026-05-27 15:18:48 +00:00
Robo 8748be1f1a feat: update to Electron v42 (#316661)
* feat: update to Electron v42

* chore: drop support for arm 32-bit server

* chore: update types/node to v24.x

* chore: temporarily lock the target version for build/

* chore: update v8-source-location.patch

* chore: fix clippy

* chore: cleanup armhf server ci config

* fix: broken lock file

* fix: c++ version requirement for sysroot builds

* fix: msvc compilation of native modules

* fix: handle rejections for fire-and-forget loadurl

* fix: windows build

* ci: fix teardown of daemon process on windows

```
2026-05-15T20:55:09.7717127Z Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76
```

* chore: update deb and rpm dependencies

* chore: update version info

* spec: improve reliablity of offscreencanvas tests

* spec: retry EPERM failures on teardown

* chore: update x86_64 rpm deps

* ci: exclude server binskim for armhf

* temp: bump distro

* test: ignore deprecation warnings treated as errors

* chore: update lockfile

* fix: externalize electron from auth extension bundles

 Error: Cannot find module 'c:\Users\cloudtest\AppData\Local\Temp\vscode-sanityQvCaze\vscode-server-win32-x64-web\extensions\github-authentication\dist\install.js'
     at Module._resolveFilename (node:internal/modules/cjs/loader:1476:15)
     at wrapResolveFilename (node:internal/modules/cjs/loader:1049:27)
     at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1073:10)
     at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1094:12)
     at Module._load (node:internal/modules/cjs/loader:1262:25)
     at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
     at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
     at node:internal/main/run_main_module:33:47 {
   code: 'MODULE_NOT_FOUND',
   requireStack: []
 }

 Node.js v24.15.0

* test: make wsl sanity tests reliable

* chore: bump electron@42.1.0

* temp: bump distro

* chore: bump electron@42.2.0

* chore: bump distro

* chore: update debian dependencies

* Revert "test: make wsl sanity tests reliable"

This reverts commit b3f2b63e83.

* test: do not fail for deprecation warnings

* chore: patch node24 server binary for wsl1

* chore: address review feedback

* chore: revert global navigation error handler in browserview

* chore: bump distro
2026-05-27 14:57:41 +02:00
Henning Dieterichs 1c6a9e3f28 Fixes https://github.com/microsoft/vscode/issues/316959 2026-05-18 16:05:21 +02:00
Henning Dieterichs 54b4a0eaca ci: run component fixtures on release/* branches 2026-05-13 20:37:23 +02:00
dependabot[bot] 6a252b13fe Bump actions/download-artifact from 7 to 8 (#312121)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-12 18:59:03 +00:00
Rob Lourens 37ad80f8e5 Fix the node_modules cache (#315585) 2026-05-10 18:34:39 -07:00
Dmitriy Vasyura 44669e93e8 Run copilot extension lint in PR CI (#315368) 2026-05-08 21:40:38 +00:00
Henning Dieterichs 94197da951 Deletes unneeded screenshot-test.yml 2026-05-08 13:19:23 +02:00
Henning Dieterichs 66bdcf97c7 Renames component fixture ci workflow to "component-fixtures.yml" / Component Fixture Screenshots & Tests (#315218)
Renames component fixture ci workflow to "component-fixtures.yml" / Component Fixture Screenshots & Tests
2026-05-08 12:47:58 +02:00
Henning Dieterichs ca2ded47a8 updates component explorer 2026-05-07 18:43:10 +02:00
Henning Dieterichs 8ff4538da0 Fail CI if a component fixture throws & enable node_module caching 2026-05-07 12:44:16 +02:00
Henning Dieterichs 8f4ed8d714 Do no fail component explorer check if fixture had errors 2026-05-05 01:51:38 +02:00
Henning Dieterichs 83b3a75bba Fixes component fixture errors (#314164)
* Fixes component fixture errors

* refactor: replace empty mock with MockChatModeService in chat fixture services
2026-05-04 22:43:25 +02:00
Henning Dieterichs b4399bee94 Fixes 2026-05-04 19:15:19 +02:00
Henning Dieterichs bb81c9c9bb Improves screenshot experience for forks 2026-05-04 19:15:19 +02:00
Raymond Zhao d84f2e3008 fix: save extensions cache on misses (#313560)
* fix: restore built-in extensions cache on main workflow

* Add prepare step
2026-04-30 19:04:07 +00:00
Matt Bierner ac56466f75 Merge branch 'main' into dev/mjbvz/copilot-ts-go 2026-04-29 14:56:18 -07:00
Michael Lively 41499ac00a ci: drop VSCODE_OSS token conditional from pr.yml compile job (#313314)
Follow-up to #313128. The VSCODE_OSS fallback isn't needed for the
api.github.com calls in core-ci — secrets.GITHUB_TOKEN already
authenticates those reads with permissions: contents: read (added in
#304929), so we don't hit the anonymous rate limit on 1ES.
2026-04-29 14:41:25 -07:00
Matt Bierner 062d81fead Make sure we install root build tools 2026-04-29 13:53:28 -07:00
Michael Lively 7a833e177b ci: switch PR workflows back to 1ES self-hosted runners with JobId (#313128)
* ci: switch PR workflows back to 1ES self-hosted runners with JobId

Re-applies #311975 (reverted in #312033). Adds per-run+attempt JobId
labels to scope 1ES agents to specific GitHub Actions runs and prevent
intermittent runner cancellations.

Also switches the pr.yml compile job's GITHUB_TOKEN from the
ephemeral repo-scoped runner token to secrets.VSCODE_OSS so cross-repo
GitHub API release fetches (vscode-js-debug, vscode-js-debug-companion,
vscode-js-profile-visualizer, etc.) authenticate properly. On 1ES pools
the shared egress IPs hit the anonymous 60/hr api.github.com rate limit
and produced 403 fan-out across PRs last time.

* ci: fall back to GITHUB_TOKEN for fork PRs

Match the historical pattern from before #255987 — fork PRs can't
access secrets.VSCODE_OSS, so use the conditional to pick GITHUB_TOKEN
for forks.
2026-04-29 10:51:12 -07:00
Matt Bierner 371c4a0a73 Use root eslint for copilot 2026-04-28 15:20:59 -07:00
Henning Dieterichs a080227496 Improve screenshot diff logic for pull requests and pushes; add job summary step 2026-04-24 19:59:43 +02:00
Matt Bierner 1a54933643 Revert "Use main eslint config for copilot extension too" 2026-04-23 15:17:22 -07:00
Matt Bierner 74fca4377e Merge pull request #311606 from microsoft/dev/mjbvz/advisory-swallow
Use main eslint config for copilot extension too
2026-04-23 14:29:25 -07:00
dependabot[bot] fd6a74635f Bump actions/cache from 4 to 5 (#312122)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-23 08:30:49 -07:00
Henning Dieterichs 6e04312650 Add detailed diff output for blocks-ci screenshot mismatch errors 2026-04-22 19:55:25 +02:00
Paul cc33dc6e7c Fixes for the chat perf pipeline (#311605) 2026-04-21 19:11:30 -07:00
Matt Bierner a261ac606a Remove extra copilot lint check
These lint checks should already be handled by the full pr lint checks
2026-04-20 23:21:22 -07:00
Ben Villalobos 79e5111feb Allow cherry-pick bot PRs in engineering system changes check (#311475)
* Allow cherry-pick bot PRs in engineering system changes check

Add an exception for PRs created by vs-code-engineering[bot] whose title
starts with [cherry-pick] and that carry the cherry-pick-artifact label.

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

* Fetch cherry-pick-artifact label via API at runtime

The label is applied ~2s after PR creation, so the webhook payload may
not include it. Fetch current labels from the API instead, gated behind
cheap event-payload checks to avoid extra API calls on unrelated PRs.

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

* Add label retry loop and consolidate guard expressions

Retry the cherry-pick-artifact label check up to 3 times (2s apart) to
handle the ~2s delay between PR creation and label application.

Consolidate the repeated exception guards into a single 'allowed' step
with a 'blocked' output, simplifying downstream conditions.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 21:23:32 +00:00
Ben Villalobos 6159ac50a6 ci: allow copilot extension version bump in engineering system check (#311122) 2026-04-18 00:09:51 +00:00
Paul ec992baa49 Add performance tests (#309700) 2026-04-17 21:23:43 +00:00