ci(root): add path filters to skip irrelevant jobs per PR#9041
Open
gokulhost wants to merge 2 commits into
Open
ci(root): add path filters to skip irrelevant jobs per PR#9041gokulhost wants to merge 2 commits into
gokulhost wants to merge 2 commits into
Conversation
804ece5 to
0c1ac17
Compare
0c1ac17 to
0d1ba26
Compare
zahin-mohammad
previously approved these changes
Jun 17, 2026
Adds a `changes` job using dorny/paths-filter to detect which file groups changed. Downstream jobs skip when their files are unaffected: - unit-test, browser-test: skip when only Dockerfile/infra files change - docker-build, dockerfile-check: skip when only source modules change - verify-vendor-integrity: skip when modules/argon2 is untouched - code-quality, verify-npm-packages: always run On push to master and workflow_dispatch the changes job is skipped, causing all downstream jobs to run unconditionally via the `needs.changes.result == 'skipped'` guard. Action pinned to SHA (fbd0ab8f # v4.0.1) matching internal convention used in bitgo-retail and mobile-native. Ref: WCN-974 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0d1ba26 to
c37ee2f
Compare
Marzooqa
previously approved these changes
Jun 18, 2026
Adds an `all-checks` job (if: always()) that aggregates every skippable job. It passes when each dependency result is `success` or `skipped`, and fails on `failure` or `cancelled` — so no broken job can sneak through. `changes` is explicitly listed in needs: if the path-filter job itself errors, its result is `failure` (not `skipped`), which the jq check rejects and blocks the merge. Branch protection should require `all-checks` instead of the individual job names so that CI-only PRs (tests intentionally skipped) can merge while still blocking PRs where tests actually fail. Ref: WCN-974 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5cc3e9d to
35067e9
Compare
Contributor
Author
|
Branch protection update needed to unblock CI-only PRs The required checks ( |
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.
Summary
Adds a
changesjob usingdorny/paths-filterthat detects which file groups changed on a PR. Downstream jobs declareneeds: [changes]and skip when their relevant files are untouched. Anall-checksumbrella job aggregates all results so branch protection has a single, reliable gate.How it works
flowchart TD PR([pull_request event]):::event --> changes changes["changes\ndorny/paths-filter\n─────────────────\noutputs: source / docker / vendor"]:::filter changes -->|source=true| unit-test changes -->|source=true| browser-test changes -->|docker=true| docker-build changes -->|docker=true| dockerfile-check changes -->|vendor=true| verify-vendor-integrity changes -. always runs .-> verify-npm-packages changes -. always runs .-> code-quality unit-test:::job --> all-checks browser-test:::job --> all-checks docker-build:::job --> all-checks dockerfile-check:::job --> all-checks verify-vendor-integrity:::job --> all-checks verify-npm-packages:::job --> all-checks code-quality:::job --> all-checks changes --> all-checks all-checks{"all-checks\nif: always()\n──────────────────────────────\n✅ pass → all results are success or skipped\n❌ fail → any result is failure or cancelled"}:::gate classDef event fill:#6366f1,color:#fff,stroke:none classDef filter fill:#0ea5e9,color:#fff,stroke:none classDef job fill:#64748b,color:#fff,stroke:none classDef gate fill:#16a34a,color:#fff,stroke:noneOn
pushto master orworkflow_dispatch, thechangesjob is skipped (itsif:condition excludes non-PR events). Every downstream job seesneeds.changes.result == 'skipped'and runs unconditionally — full CI on every master merge, no exceptions.What skips and when (PR events only)
unit-test(×3 Node versions)Dockerfile,.dockerignore,.github/**,renovate.json, etc. changedbrowser-testdocker-buildDockerfile,.dockerignore, ormodules/**changesdockerfile-checkdocker-buildverify-vendor-integritymodules/argon2/**changescode-qualityverify-npm-packagesWhy
all-checksis secureall-checksexplicitlyneeds: [changes]. This means:failure→ jq check rejects it →all-checksfails ❌skipped→ jq check accepts it →all-checkspasses ✅changesitself errors → its result isfailure(notskipped) →all-checkscatches it and fails ❌GitHub job results are exactly one of
success | failure | cancelled | skipped. Onlysuccessandskippedpass. A real failure can never sneak through.Required: branch protection update (admin action)
Branch protection currently requires the individual job names. To make this work, a repo admin needs to replace those with
all-checksas the single required check. The individual jobs still run and report status — they just aren't the merge gate anymore.Expected savings on infra-only PRs
Before: ~12 min wall time (blocked on
docker-build+browser-test+unit-test×3)After: ~3 min wall time (only
changes+code-quality+verify-npm-packagesrun)Test plan
Dockerfile— verifyunit-testandbrowser-testare skipped,docker-buildruns,all-checkspassesmodules/sdk-core/src— verifydocker-buildis skipped,unit-testandbrowser-testrun,all-checkspassesall-checksfails and blocks mergeCloses WCN-974