#65845 Increase the specificity of workflow path filtering - #9457
#65845 Increase the specificity of workflow path filtering#9457johnbillion wants to merge 10 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This comment was marked as off-topic.
This comment was marked as off-topic.
| - 'src/**.php' | ||
| - 'tests/**.php' |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| - 'src/**.php' | ||
| - 'tests/**.php' |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| - 'src/**.css' | ||
| - 'src/**.js' | ||
| - 'src/**.json' | ||
| - 'src/**.php' |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com>
ac253e9 to
6f35729
Compare
|
I'm working on reviving this one for 7.2 release.
|
|
@adimoldovan Could you please take a look at the approach? |
|
This PR is ready for re-reviews. |
adimoldovan
left a comment
There was a problem hiding this comment.
Reviewed against 6f35729. I left an inline suggestion based on the current approach.
But I suggest changing the approach to use exclude paths instead of include.
The two directions do not fail the same way: a list of includes that misses a path skips the check and we miss coverage. In time this list will become stale and someone needs to know to add new code paths in this list.
GitHub reads paths in order, and a positive pattern after a negative one puts the path back, so this fits in a single list. For coding-standards.yml:
paths:
- '**'
# Documentation and repository metadata.
- '!**.md'
- '!.editorconfig'
- '!.gitignore'
- '!.git-blame-ignore-revs'
- '!.mailmap'
# Local environment and editor configuration.
- '!.devcontainer/**'
- '!docker-compose.yml'
- '!wp-cli.yml'
- '!.env.example'
- '!jsdoc.conf.json'
- '!tsconfig.json'
# Other workflows.
- '!.github/**'
- '.github/workflows/coding-standards.yml'
- '.github/workflows/reusable-coding-standards-*.yml'|
Thanks @adimoldovan—the Sass gap is real. I verified that I also agree with the failure-mode argument for exclusions. A missing include silently loses coverage. A missing exclude causes one unnecessary run, which is visible. Before changing the PR’s shape, I want to replay the proposed exclusion lists against the same 12 months of trunk history—1,800 commits—used to measure the current version. The include lists avoided roughly 790 runs per year. If exclusions save about the same amount, they win on safety without a meaningful efficiency trade-off. GitHub’s documentation confirms that ordered negative and positive patterns work for both Transparency in AI usage: I used Claude Code Opus 5 to verify the Sass claim against the Gruntfile and workflow files. |
|
@adimoldovan I switched the seven broad filters to exclusion-first in 70b7fc1. I replayed both versions across the same 1,789 trunk commits from July 25th, 2025 through July 25th, 2026:
The earlier estimate of roughly 790 avoided runs came from an earlier PR revision. The coverage fixes added since then reduced the current comparison baseline to 665. The 34 extra runs are the intended safety margin. They cover changes such as Sass, certificates, fonts, and environment files. A Sass-only change now triggers the build test, and a new source file type runs the seven converted workflows by default. I also verified the workflow files with AI use: |
|
I updated the original PR body to make this change easier to understand and review. @adimoldovan I'd love another review please |
Note from @lancewillett September 4, 2026: I’m taking over this PR from @johnbillion to finish validation and shepherd it through commit.
Purpose
Reduce unnecessary pull-request workflow runs without silently losing coverage.
Today, a PHPUnit-only change can also trigger end-to-end, performance, and build-process testing. Narrow include lists save runs, but new source paths can remain untested until someone updates each list.
Approach
This PR updates nine workflow filters:
wp-cli.yml.This also closes an existing Sass gap. A pull request changing only
src/wp-admin/css/colors/*/colors.scssnow triggers build-process testing.Review focus
Validation
Historical replay and targeted checks
For each of 1,789 first-parent trunk commits from July 25th, 2025 through July 25th, 2026, I evaluated its changed paths using GitHub’s documented ordered path-filter behavior.
No historical commit or currently tracked path covered by the include version was missed. The 34 additional runs cover Sass, certificates, fonts, and environment files—the intended safer failure mode.
Targeted fixtures also confirmed:
.github/**.actionlint.Definition of done
.github/**.actionlintand targeted path-filter tests.Use of AI tools
Claude Code (Opus 5) and Codex (GPT-5) helped verify build inputs, replay historical filters, and validate the changes.