Repository navigation
ci: One Python call resolves the changed-file gate (GEN-005, refs #2683) - #2684
Merged
Merged
Conversation
RED: ci/test_check_changes.py pins the base-reference rules of .github/actions/check-changes/action.yaml against a git fixture, and fails on master: the module ci/check_changes.py does not exist yet, the action's step is still a 50-line 'run: |' shell block, and ci.toml still carries its GEN-005 exception.
.github/actions/check-changes/action.yaml ran a 50-line shell block that resolved a base reference from the event and diffed it. The step is now 'uv run --no-project --script ci/check_changes.py --check-glob <input>', the module keeps the same base-reference rules (explicit baseRef with the useFallback warning, a push's before commit, pull_request's origin/<base>, and the dispatch/schedule merge base), the action installs uv itself because ci.yml's validate-data and push.yaml install nothing before it, and the GEN-005 exception for the action is deleted. ci-lint precheck: 11 violation(s), 490 -> 489 approved exception(s).
Member
Author
|
Handed off to the coordinator. PR CI is green on Not stamped with the local gate: PR CI already ran the full Linux lanes on this head, and any rebase would drop a stamp anyway. Local evidence in the body (12-case differential against the old bash step, 17 fixture tests, |
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.
Refs #2683.
Refs #962..github/actions/check-changes/action.yaml's step was 50 lines ofbashthat resolved a base reference from the event and diffed it — a GEN-005 finding with no test of its own, on the path of every PR and push (and the decision point for the two data validators, the docs job and the Qt XML check).What changed
ci/check_changes.py(new,uv run --no-project --script, standard library only) keeps the shell's rules exactly: an explicitbaseRefas given (with the::warning::+useFallback→HEAD~1path), apush'sgithub.event.beforeunless forced,pull_request'sorigin/<base>, the merge base with the default branch forworkflow_dispatch/schedule/merge queue (chore: fix small issues found during the grind run and CI speed-up #13), the empty-tree fallback,--diff-filter, and the samehasChangedFiles/ compact-JSONchangedFilesoutputs.uv run --no-project --script ci/check_changes.py --check-glob "${{ inputs.checkGlob }}"— and the action gains a pinnedastral-sh/setup-uvstep, because its callers do not install Python first (ci.yml'svalidate-datais a bareubuntu-latestwith onlyactions/checkout;push.yamlandscheduled.yamllikewise). The step carries thesave-cacheexpression and the CACHE-013pr-<N>cache-suffix.ci.toml: the GEN-005[[exceptions]]block for the action is deleted.ci/test_check_changes.py(new) pins the module against a real git fixture.Two deliberate differences, both in the callers' favour: the glob reaches
git diffas one argument, so a path with a space stays one entry (the shell word-split it), and the one extglob call site!(cmake*)inpush.yamlbecomes git's:(exclude,top)cmake*— the same "everything except the top-level cmake* entries" bash expanded to, without needing a shell.RED
306b97572—ci/test_check_changes.pyonly: 17 tests, 3 failures + 14 errors on master (noci/check_changes.pyto import, the step is still arun: |block, the ci.toml exception is still present).GREEN
12b07d4c5—uv run python -m unittest ci/test_check_changes.py→ 17 tests OK.bash -e -o pipefail, same env contract) and the module were run over 12 base-reference/glob cases — valid and invalidbaseRef(with and withoutuseFallback),pushbefore, forced push, dispatch merge base, empty glob,diffFilter,plugins/rtmp-services/data/*.json,frontend/forms/**/*.ui,!(cmake*). Outputs agree on all 12, including thefatal: bad revisionexit whenuseFallback: false.ci-lint precheck:11 violation(s), 490 → 489 approved exception(s), 10 needs_review, and nocheck-changesfinding remains.ci/test_ci_toml.py41 tests OK,ci/test_uv_run.py5 tests OK,uv run --no-project ruff checkclean.No
docs/features.mdline: build tooling only.