ci: use dorny/paths-filter to fulfil Required checks without paths/paths-ignore triggers#4810
ci: use dorny/paths-filter to fulfil Required checks without paths/paths-ignore triggers#4810
Conversation
|
@copilot in |
|
@copilot and leave |
|
@copilot use the |
Done in f232207.
Reverted in f232207.
Switched to |
|
@copilot don't gate on |
Fixed in bcc73b5. Removed |
|
@copilot revert the last commit, and refactor the filters into a
Then, change the
|
Done in 954bbbb. The last commit has been reverted and replaced with a
|
d4bf177 to
cbcbeb7
Compare
Done in 8aafd82. Added a |
8aafd82 to
1222e55
Compare
Agent-Logs-Url: https://github.com/canonical/mir/sessions/f8d59ba9-a3a5-4a1b-ac4c-d54464a9f833 Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Agent-Logs-Url: https://github.com/canonical/mir/sessions/720030d8-3d9f-41c7-9b76-ee733f0600fc Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Agent-Logs-Url: https://github.com/canonical/mir/sessions/16961f16-7ced-418a-9c38-68f0d01551ea Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
… outputs Agent-Logs-Url: https://github.com/canonical/mir/sessions/d5e0bd2a-f791-4ea4-b0a5-62ec8940996a Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Agent-Logs-Url: https://github.com/canonical/mir/sessions/19cb03be-5fd7-40c0-af6d-64cd341aa759 Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
Agent-Logs-Url: https://github.com/canonical/mir/sessions/e09c5aa7-9163-4038-b2a8-dd5971de9d63 Co-authored-by: Saviq <231077+Saviq@users.noreply.github.com>
10b8df2 to
1220045
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates several required CI workflows to avoid GitHub branch protection deadlocks caused by paths: / paths-ignore: on pull_request triggers (which can prevent check runs from being created). It centralizes path gating in .github/filters.yaml and moves path-based logic into job-level if: conditions using dorny/paths-filter@v3.
Changes:
- Remove
paths/paths-ignore(and some non-defaultpull_request.types) from workflow triggers so checks are always created. - Add
.github/filters.yamland usedorny/paths-filter@v3to compute ashould-runoutput used to gate expensive jobs. - Introduce lightweight “check-paths” / “filter-first” steps or jobs across workflows.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/tics.yml |
Adds a check-paths job and gates TICS execution via needs.check-paths.outputs.should-run. |
.github/workflows/symbols-check.yml |
Adds a check-paths job and gates CheckSymbols via needs.check-paths.outputs.should-run. |
.github/workflows/spread.yml |
Runs paths-filter early in GetMatrix and gates BuildAndTest based on filter outputs. |
.github/workflows/snap.yml |
Runs paths-filter early in arches and gates mir-libs (and transitively snap) based on filter outputs. |
.github/workflows/automatic-doc-checks.yml |
Adds a check-paths job and gates the reusable documentation-checks workflow call. |
.github/filters.yaml |
Introduces centralized, named filters used by the updated workflows. |
|
We could cut down the unnecessary runs even further with |
TICS Quality Gate✔️ PassedNo changed files applicable for TICS analysis quality gating. TICS / TICS / Run TICS analysis |
Workflows using
paths:/paths-ignore:on thepull_request:trigger never create a check run when no matching files change, breaking "Required checks" in branch protection — PRs touching only docs or CI files get stuck forever.What's new?
Converts affected workflows to use
dorny/paths-filter@v3for path-based gating, moving the logic into job-levelif:conditions instead of trigger filters:paths:/paths-ignore:fromon: pull_request:triggers (and drop non-defaulttypes:fromsnap.ymlandtics.yml).github/filters.yaml: centralises all path-filter definitions into named sections —documentation(doc/**+ workflow file),code(src/**+include/**),snap(snap/**+ workflow file),spread(spread**+ workflow file),symbols(include/**.h+ workflow file),tics(workflow file only), andtools(tools/**); each workflow's own file is included so changes to it always trigger its CIsnap.yml:dorny/paths-filterruns as the first step in the existingarchesjob using the shared filters file (no checkout needed — the action fetches the file via the GitHub API);should-runis set whencodeorsnapfiles change; downstream jobs (mir-libs,snap) are gated onarches.outputs.should-run; thesnapjob'sif:uses an inlineevent_name/repositorycheck to restrict secret-requiring steps to same-repo PRsspread.yml: same approach in the existingGetMatrixjob;should-runis set whencode,spread, ortoolsfiles change;BuildAndTestis gated onGetMatrix.outputs.should-runsymbols-check.yml: a lightweightcheck-pathsjob uses the shared filters file;should-runis set whensymbolsfiles changeautomatic-doc-checks.yml: a lightweightcheck-pathsjob uses the shared filters file;should-runis set whendocumentationfiles changetics.yml: a lightweightcheck-pathsjob uses the shared filters file;should-runis set whencodeorticsfiles change forpull_requestevents; non-PR events (push,merge_group,workflow_dispatch) always run; theTICSjob retains its existing repo-ownership guardclose-snap.yml: left unchanged — it is not a required checkdorny/paths-filterruns unconditionally for all event types (push,merge_group,pull_request), so path-based gating applies consistently regardless of how the workflow is triggered. Noactions/checkoutis required in the filter-only jobs sincedorny/paths-filter@v3fetches the filters file directly from the GitHub API.How to test
Open a PR that changes only docs or CI files (e.g. a
doc/change) and confirm the affected workflows now appear as skipped (not absent) checks.Open a PR that changes only
.github/workflows/snap.ymlor.github/workflows/spread.ymland confirm those workflows still run despite not being covered by thecodefilter.Open a PR that changes only
src/orinclude/files and confirmsnap,spread,symbols-check, andticsall trigger as expected.Open a PR that changes only
doc/or unrelated CI files and confirmticsappears as a skipped check rather than absent.Checklist