ci: run every job when CI plumbing changes - #1286
Open
ogenstad wants to merge 1 commit into
Open
Conversation
A change to a workflow file or to the path filters themselves could previously leave jobs skipped, so a bad edit landed green and broke the next unrelated PR instead. Three concrete gaps, confirmed by simulating dorny/paths-filter against the old filters: - ci.yml only: `documentation` skipped, because `documentation_all` never included `ci_config`. - file-filters.yml only: `markdown-lint`, `action-lint`, `uv-lock-check` and `documentation` skipped, because `github_workflows` was `.github/workflows/*.yml`, which does not match a file one level up. - define-versions.yml only: `python-lint`, `unit-tests`, `integration-tests` and `validate-generated-documentation` skipped, because `ci_config` listed only `ci.yml` - so a bad `UV_VERSION` pin, consumed by every Python job, went untested. Widen `ci_config` to all of `.github/workflows/**` plus `.github/file-filters.yml`, point `github_workflows` at it, and fold it into `documentation_all` and `documentation_generated_all`. Every output that gates a job now includes it. Also parenthesize the `validate-generated-documentation` condition. It read `... && A || B`, and `&&` binds tighter than `||`, so `documentation_generated == 'true'` alone satisfied the whole expression and bypassed the `always() && !cancelled() && !contains(needs.*.result, 'failure')` guards. Latent before; the change above makes that output true on every CI-config change, which would have started firing it. Verified with `yamllint -s .` and `actionlint`, plus a picomatch simulation showing zero skipped jobs for all three CI-config cases and no change in selectivity for python-only, docs-only or generated-docs-only changes.
Deploying infrahub-sdk-python with
|
| Latest commit: |
f1552a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ac237a37.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://pog-em-run-jobs-on-ci-change.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## stable #1286 +/- ##
=======================================
Coverage 84.16% 84.16%
=======================================
Files 147 147
Lines 13045 13045
Branches 1930 1930
=======================================
Hits 10979 10979
Misses 1503 1503
Partials 563 563
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
ogenstad
marked this pull request as ready for review
August 26, 2026 18:57
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.
Why
Path filtering in
files-changeddecides which jobs run. Today a change to the CI plumbing itself does not turn on every job, so a bad edit to a workflow can land green and then break the next unrelated PR - the job that would have caught it was skipped on the PR that introduced it.Three concrete gaps, confirmed by simulating
dorny/paths-filterwith picomatch against the current filters:.github/workflows/ci.ymldocumentation.github/file-filters.ymlmarkdown-lint,action-lint,uv-lock-check,documentation.github/workflows/define-versions.ymlpython-lint,unit-tests,integration-tests,validate-generated-documentation,documentationThe third is the worst of them:
define-versions.ymlpins theUV_VERSIONthat every Python job consumes, and a bad pin there was never exercised by unit or integration tests.This is observable in history. #1192, a
ci.yml-only PR, showsdocumentationskipped in run 29730072415.Goal: any change to the CI plumbing runs the full pipeline.
Non-goals: no change to job selectivity for ordinary code, docs, or dependency PRs. Scoped to workflows and the filter file, not all of
.github/**-dependabot.yml,labeler.yml,CODEOWNERS, and issue templates do not affect whether a job runs correctly, and including them would mean a full pipeline on every label tweak.What changed
Behavioral changes:
.github/workflows/**or to.github/file-filters.ymlnow runs every CI job, so a broken job definition fails on the PR that introduces it.Implementation notes:
.github/file-filters.yml: widenedci_configto.github/workflows/**plus.github/file-filters.yml, pointedgithub_workflowsat it, and folded it intodocumentation_allanddocumentation_generated_all. Every output that gates a job now includes*ci_config..github/workflows/ci.yml: parenthesized thevalidate-generated-documentationcondition. It read... && A || B, and&&binds tighter than||, sodocumentation_generated == 'true'alone satisfied the whole expression and bypassed thealways() && !cancelled() && !contains(needs.*.result, 'failure')guards. Latent before this PR; the filter change makes that output true on every CI-config change, which would have started firing it.What stayed the same: no job definitions, runners, timeouts, or
needsedges changed. The onlyci.ymledit is the parenthesization above.How to review
Two files, 8 insertions. The load-bearing question is whether the widened
ci_configover-triggers - see the simulation table below for the answer.Worth extra scrutiny:
github_workflowsis now an alias toci_config, soaction-lintalso fires on.github/file-filters.ymlchanges. That is intentional (actionlint lints the whole workflow directory regardless of what changed) but it does widen that job's trigger.How to test
This PR is its own test case: it changes both
ci.ymlandfile-filters.yml, so every job in the pipeline should run on it. Previouslydocumentationwould have been skipped.Static checks:
Both pass. Filter behavior was verified by flattening the YAML anchors and matching sample changed-file sets with
picomatchusing{dot: true}, the same optionsdorny/paths-filteruses:.github/workflows/ci.ymldocumentation.github/file-filters.ymlmarkdown-lint,action-lint,uv-lock-check,documentation.github/workflows/define-versions.ymlpython-lint,documentation,validate-generated-documentation,unit-tests,integration-testsinfrahub_sdk/client.pyyaml-lint,markdown-lint,action-lint,uv-lock-check,documentationdocs/docs/guides/foo.mdxdocs/docs/infrahubctl/branch.mdxImpact & rollout
documentationjob (roughly 5 minutes,ubuntu-22.04), anddefine-versions.ymlPRs now run unit and integration tests. That is the point of the change: CI-config PRs are rare, and the alternative is discovering the breakage on someone else's PR.Checklist
ci/skip-changelog).AGENTS.mddocuments local commands, not CI path filtering.Follow-up, not in this PR
ci.ymlexportshelm: ${{ steps.changes.outputs.helm_all }}, but nohelm_allfilter exists and nothing consumes the output, so it is always empty. Harmless today, but it is the kind of line someone later gates a job on. Deliberately left out of scope.Summary by cubic
Makes any change to the CI plumbing run the full pipeline. Previously, editing a workflow or the path-filter file could silently skip jobs — for example, a
define-versions.yml-only change skipped unit and integration tests, letting a badUV_VERSIONpin land and break the next unrelated PR.ci_configfromci.ymlalone to all of.github/workflows/**plus.github/file-filters.yml, and folded it into every output that gates a job.github_workflowsatci_config, soaction-lintalso fires when the filter file changes.validate-generated-documentationcondition, which previously read... && A || Band let the docs check bypass thealways() && !cancelled() && !contains(...)guards.Written for commit f1552a8. Summary will update on new commits.