Skip to content

ci: skip PR checks that the changes cannot affect - #342091

Merged
Logan Ramos (lramos15) merged 1 commit into
mainfrom
lramos15/pr-ci-path-filters
Oct 16, 2026
Merged

Logan Ramos (lramos15) merged 1 commit into
mainfrom
lramos15/pr-ci-path-filters

Conversation

@lramos15

Copy link
Copy Markdown
Member

PR CI jobs on the 1es-vscode-oss-ubuntu-22.04-x64 pool have been waiting up to ~2 hours for a machine. On Oct 16 the pool ran about 3 jobs at a time on average, while every PR run queued 6 jobs there, 4 of them taking 2 minutes or less. This PR skips checks that a pull request's changes can't affect, and moves the Rust checks off the pool.

Changes

  • Shared Detect Changes job (.github/actions/detect-changes). It lists the PR's changed files and sets one output per path rule: cli, copilot-shim, copilot. New cases are one rule plus an if: on the job. Every check runs if the file list fails or comes back incomplete.
  • Rust checks (Linux / CLI, Linux Copilot Shim / Copilot-Shim)
    • Move to GitHub-hosted ubuntu-24.04. CLI ran on hosted ubuntu-22.04 in April (59 of 60 sampled runs passed). Neither job uses a secret or a private feed.
    • Run only when their crate, their workflow or the detector changes. CLI also runs for root package.json and product.json, which cli/build.rs reads.
    • They skip inside the reusable workflow, so the required Linux / CLI check still reports, as skipped.
  • Copilot checks (Test Linux and Windows, Check Test Cache, Check Telemetry)
    • Run only when one of these changes: extensions/copilot/, the API typings, the root ESLint config and rules, the root package files or .npmrc, or the node_modules cache scripts.
    • Core src/vs/** isn't included: these jobs test against a downloaded Insiders build. The Electron jobs still run the Copilot extension host tests against the PR's own build.
  • Git LFS: Compile & Hygiene, Copilot - Check Telemetry, the Rust jobs and Monaco Editor checks no longer download LFS content, which is only the 271 MB Copilot simulation cache. Jobs that read the cache keep it.

Why skip with if: and not paths:

A workflow skipped by on.pull_request.paths leaves its required checks "Waiting for status to be reported", which blocks merging. A job skipped by an if: reports as skipped, which counts as passing (docs). Calls to reusable workflows skip inside the called workflow, so the check name keeps its <caller> / <job> form.

How to test

The Linux 1ES pool is the PR CI bottleneck. Add a shared Detect Changes job that lists the pull request's changed files, and use it to skip checks the changes cannot affect:

- The CLI and Copilot Shim Rust checks run only when their crates, the files their builds read, or their workflows change. They also move to GitHub-hosted ubuntu-24.04 runners. They skip inside the reusable workflow so the required Linux / CLI check still reports.
- The Copilot extension checks run only when extensions/copilot, the API typings, the root ESLint setup, or the root dependencies change. They test against a downloaded Insiders build, and the Electron jobs still run the Copilot tests against the PR's own build.
- Jobs that never read Git LFS content no longer download the 271 MB Copilot simulation cache.

Every check still runs when the changed files cannot be listed.

Co-authored-by: Copilot <[email protected]>

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

The cache dependency filter needs correction, and hosted Rust execution and required-check reporting need live CI confirmation.

1 open finding
What changed in this PR

Reduces PR CI queue pressure by skipping unaffected checks and moving Rust jobs to GitHub-hosted runners.

Changes:

  • Adds shared path detection with run-all fallback.
  • Gates Rust and Copilot checks while preserving required-check names.
  • Removes unnecessary Git LFS downloads.
File Description
.github/​workflows/​pr.yml Adds detection and conditional checks; reduces LFS downloads.
.github/​workflows/​pr-linux-cli-test.yml Adds conditional execution and hosted Rust runners.
.github/​workflows/​monaco-editor.yml Removes LFS downloads.
.github/​actions/​detect-changes/​detect.ts Defines path rules and fallback behavior.
.github/​actions/​detect-changes/​action.yml Exposes detection through a composite action.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

'.npmrc',
'.github/actions/restore-node-modules/',
'.github/workflows/node_modules_cache/',
'build/azure-pipelines/common/computeNodeModulesCacheKey.ts',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lramos15/pr-ci-path-filters

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #342134: the Copilot rule now includes build/npm/dirs.ts and build/azure-pipelines/win32/exec.ps1.

@lramos15
Logan Ramos (lramos15) enabled auto-merge (squash) October 16, 2026 17:20
@lramos15
Logan Ramos (lramos15) merged commit 4441158 into main Oct 16, 2026
50 checks passed
@lramos15
Logan Ramos (lramos15) deleted the lramos15/pr-ci-path-filters branch October 16, 2026 17:22
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 16, 2026
Logan Ramos (lramos15) added a commit that referenced this pull request Oct 16, 2026
* ci: report skipped Rust checks under their required names

When GitHub skips a job, it does not evaluate expressions in the job's name. The Rust jobs skipped inside the shared reusable workflow, whose job name is ${{ inputs.job_name }}, so they reported as 'Linux / inputs.job_name'. The required Linux / CLI check then never reported, which blocks every pull request that does not change the CLI.

Run both Rust checks as jobs with fixed names in pr.yml, and move their shared steps from the reusable workflow into a composite action.

Also run the Copilot checks when build/npm/dirs.ts or build/azure-pipelines/win32/exec.ps1 change. The node_modules cache setup in those jobs uses both files (review feedback on #342091).

Co-authored-by: Copilot <[email protected]>

* ci: use a fixed name for the shared Rust job instead of a composite action

Revert the composite action and fix the skipped check name with a one-line change: the reusable workflow's job is named CLI instead of ${{ inputs.job_name }}. The required Linux / CLI check is unchanged; the Copilot Shim check (not required) reports as Linux Copilot Shim / CLI.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
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.

5 participants