chore: skip build and test steps for documentation-only changes#7654
Open
AKnassa wants to merge 1 commit into
Open
chore: skip build and test steps for documentation-only changes#7654AKnassa wants to merge 1 commit into
AKnassa wants to merge 1 commit into
Conversation
A markdown-only pull request paid for a wasm-pack install, a Playwright browser install and the full end-to-end suite, on every supported platform. Pull requests that touch no source file now skip those steps. Change-file and lint validation still run unconditionally, and anything other than a pull request runs the full pipeline. Fixes microsoft#7339
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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.
What this does
Stops documentation-only pull requests from running the entire build and test pipeline.
Why
Fix a typo in a markdown file today and CI still installs a Rust toolchain and
wasm-pack, builds every package, downloads Playwright browsers, and runs the full end-to-end and validation suites — andci-validate-platformsdoes all of that again across three operating systems.That is slow for contributors and expensive for the project, and none of it can tell you anything about a markdown file.
What changed
Follows the implementation plan from the issue.
ci-validate-pr.yml— a step after checkout works out whether the pull request touches any non-documentation file, and the expensive steps (toolchain install, build, browser install, unit tests, end-to-end tests, final validation) only run when it does. Change-file validation and linting still run every time, unconditionally.ci-validate-platforms.yml— documentation paths are excluded from thepushandpull_requesttriggers. The scheduled and manual runs are untouched, so the full matrix still runs on its own cadence.azure-pipelines-ci.yml— documentation paths excluded from the PR trigger.The detection fails open: anything it is unsure about is treated as source, so a real code change can never be mistaken for docs and skip its tests. Runs that are not pull requests always run the full pipeline.
One question for maintainers, please read
Are
ci-validate-platformsor the Azure PR check configured as required status checks onmain?If they are, a skipped workflow never reports a status, and documentation-only PRs will sit forever on "Expected — waiting for status to be reported" — the exact opposite of the goal. Branch protection settings are not visible in the repository, so this cannot be checked from here.
If they are required, the fix is to keep the workflow running but make its jobs no-op, rather than skipping the workflow. Happy to change it to that shape — just say the word.
How to see it
The detection logic is a small script with its own unit tests (
build/test/, 27 tests, wired intolage test:node), covering documentation-only changes, source changes, mixed changes, renames, deletions, and paths with spaces.Beyond that: open a doc-only PR on a fork and watch the build and test steps report as skipped while lint and change-file validation still run green; then open a mixed docs-and-source PR and watch the full pipeline run.
Fixes #7339