Repository navigation
Description
Gap
ci-lint precheck reports one GEN-005 finding on .github/actions/check-changes/action.yaml:
[GEN-005] APPROVED EXCEPTION .github/actions/check-changes/action.yaml
what: runs.steps[0]: run: step violates the shell budget (more than one line)
fix: replace runs.steps[0] with a single call to a Python script, e.g. 'run: uv run --no-project --script ...'
That step is 50 lines of bash that resolve a base reference and diff it:
- an explicit
baseRefis used as given; when it is not an object in the checkout a::warning::is printed and, withuseFallback: true(the default), the comparison falls back toHEAD~1; - with no
baseRef, the event decides:pull_request→origin/<base branch>,push→github.event.beforeunless the push was forced, everything else (workflow_dispatch,schedule, merge queue) → the merge base with the default branch (chore: fix small issues found during the grind run and CI speed-up #13); - a
pushwhosebeforeis not in the checkout compares against the empty tree; - the result is written to
$GITHUB_OUTPUTashasChangedFilesand a compact JSONchangedFileslist.
This gate is on the path of every PR and push, and it is the decision point for the two data validators, the docs job and the Qt XML check — a shell block that had no test of its own.
Call sites (coverage map)
| Caller | Inputs used |
|---|---|
ci.yml validate-data (× 2) |
baseRef: origin/<base_ref>, glob on the compat / rtmp-services JSON |
ci.yml update-documentation |
baseRef: origin/<base_ref>, glob docs/sphinx |
push.yaml (× 3) |
baseRef: github.event.before, globs incl. !(cmake*) |
scheduled.yaml |
baseRef: steps.nightly-checks.outputs.lastNightly, glob **/en-US.ini |
qt-xml-validator, run-swift-format (composite actions) |
checkGlob on frontend/forms/**/*.ui |
None of those jobs install Python before the step — validate-data is a bare ubuntu-latest with only actions/checkout — so the action has to bring uv itself, exactly as .github/actions/generate-docs does after #2681.
Work
ci/check_changes.py(uv run --no-project --script, standard library only) does the resolution and the diff; the action's step becomes one line and gains a pinnedastral-sh/setup-uvstep (with thesave-cacheexpression and the CACHE-013pr-<N>cache-suffix).ci/test_check_changes.pypins the module against a real git fixture: explicitbaseRef, no-match, empty glob, pushbefore, forced push, dispatch merge base, invalidbaseRefwith and withoutuseFallback, the diff filter, both caller globs, and a file name with a space.- The GEN-005
[[exceptions]]block for the action is deleted with the port.
Two deliberate differences, both in the callers' favour: the glob is passed to git diff as one argument, so a path with a space stays one entry (the shell word-split it), and the one extglob call site, !(cmake*) in push.yaml, becomes git's own :(exclude,top)cmake* — the same "everything except the top-level cmake* entries" that bash expanded to, without needing a shell.
Evidence
Before the change the module and the fixture test were run against the old bash step (bash -e -o pipefail, same env contract) over 12 base-reference/glob cases; the outputs agree on all 12, including the !(cmake*) expansion and the fatal: bad revision exit when useFallback is false.
ci-lint precheckbefore:11 violation(s), 490 approved exception(s), 10 needs_reviewci-lint precheckafter:11 violation(s), 489 approved exception(s), 10 needs_review, with nocheck-changesfinding leftci/test_ci_toml.py41 tests OK,ci/test_uv_run.py5 tests OK,ruff checkclean
RED 306b97572 (test only: 17 tests, 3 failures + 14 errors — module missing, step still a run: | block, exception still present), GREEN 12b07d4c5. No docs/features.md line: build tooling only.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 27, 2026
Claiming: the check-changes shell-budget port.
Plan (one PR, two commits, local RED evidence):
306b97572:ci/test_check_changes.pypins the action's base-reference rules against a real git fixture (17 tests; 3 failures + 14 errors on master — the module does not exist, the step is still arun: |block, and the GEN-005 block is still in ci.toml).12b07d4c5:ci/check_changes.pydoes the work, the action's step is oneuv run --no-project --scriptline with a pinned setup-uv step (its callers install nothing), and the ci.toml GEN-005 block is deleted.ci-lint precheck490 -> 489 approved exceptions, same 11 violations, no new finding.Already verified locally: the old bash step and the new module were diffed over 12 base-reference/glob cases (both agree, including the
!(cmake*)expansion and thebad revisionexit), plusci/test_ci_toml.py,ci/test_uv_run.pyandruff check. PR opens now.zackees commentedon Oct 27, 2026
Opened #2684 (branch
infra/check-changes-python, base master, 2 commits): RED306b97572(17 tests: 3 failures + 14 errors on master), GREEN12b07d4c5(17 tests OK,ci-lint precheck490 -> 489 approved exceptions with no new finding). Watching it through PR CI.zackees commentedon Oct 27, 2026
Landed: #2684 merged into
masteras190d3098e(2026-10-27 20:13Z, merge-queue run green).What changed:
.github/actions/check-changes/action.yaml's 50-linerun: |block is now oneuv run --no-project --script ci/check_changes.py --check-glob …call; the action brings its own pinnedastral-sh/setup-uvstep;ci/check_changes.pykeeps the base-reference rules (explicitbaseRef+useFallbackwarning, pushbefore,pull_requestorigin/<base>, dispatch/schedule merge base, empty-tree fallback,diffFilter);ci/test_check_changes.pypins them against a real git fixture; the GEN-005 exception for the action is gone fromci.toml.Verified on the queued head before merge:
Validate Data 🕵️(bothcheck-changescalls, 19 s) andFormat 🔍 / checks(qt-xml-validator→check-changes) passed, CI Gate ✅.ci-lint precheckon master now reads11 violation(s), 489 approved exception(s), 10 needs_review— the burn-down moves 490 → 489. Nothing outstanding on this issue.zackees commentedon Oct 27, 2026
Landed: #2684 merged as
190d3098e(merge-queue run green) —.github/actions/check-changes/action.yaml's inlinerun: |block is nowci/check_changes.py, and its GEN-005 exception is gone (ci-lint precheck490 -> 489). Nothing left on the issue; closing.ci: One Python call resolves the changed-file gate (GEN-005, refs obs…