Repository navigation
Test: Stop hard-coding action pins - #208
ModeSevenIndustrialSolutions merged 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the shared action-pin validation changes.
No open issues 🎉
What changed in this PR
Removes hard-coded action-pin expectations from the Grype and Python metadata tests, addressing #207 so uniform Dependabot updates do not require test edits. Workflow pins remain unchanged.
Changes:
- Adds a shared helper that validates matching full lowercase commit SHAs and version comments at or above the required release floors.
- Updates both test scripts to use the helper while retaining input, ID, and wiring checks.
- Adds mutation self-tests for uniform upgrades, inconsistent pins, invalid references, missing comments, and versions below the floor.
| File | Description |
|---|---|
| tests/test-python-metadata.sh | Uses shared pin validation with the build-metadata release floor. |
| tests/test-grype-gate-inputs.sh | Uses shared pin validation with the Grype release floor. |
| tests/action_pins.py | Adds shared pin checks, call-site diagnostics, and mutation self-tests. |
Review effort: Balanced
There was a problem hiding this comment.
🤖 Antagonistic review by agent: 1 finding(s) for the human reviewer.
The shared pin checks support uniform upgrades while retaining wiring checks and regression cases. One local validation gap remains: changes confined to the new helper do not trigger the existing pre-commit contract check.
Antagonistic round 1 of 3. Revision requested from Code Monkey.
Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.
Check that Grype and Python metadata calls share a full commit pin and version comment at or above their supported release floor. Exercise uniform bumps and pin drift without coupling the wiring checks to the current releases. Include the shared pin helper in the Grype contract hook selector so helper-only edits run the wiring checks and mutation tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
2892310 to
c5de664
Compare
There was a problem hiding this comment.
🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.
The shared pin checks allow uniform upgrades while retaining SHA validation, version floors, cross-workflow consistency and wiring checks. No actionable defects found in the reviewed diff.
Antagonistic round 2 of 3.
Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.
55c9ecb
into
lfreleng-actions:main
Closes #207
Authored by an AI agent; human review required; changes the lint gate, .pre-commit-config.yaml
hightier), routed togpt-6.2-solvia GitHub Copilot CLI93610919c6ca8ef89408ef1abb385e416bb7fc40.pre-commit-config.yaml, which decides the checks the repository runs; theprecommit-edits-oklabel on the issue granted it; review every hook changeprek run grype-gate-inputs --files tests/action_pins.pyTMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 prek run grype-gate-inputs --files tests/action_pins.pyTMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-grype-gate-inputs.shTMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-grype-sbom-binding.shTMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-python-metadata.shTMPDIR="$PWD/../artefacts" prek install -t pre-commit -t commit-msggit diff --check 93610919c6ca8ef89408ef1abb385e416bb7fc40TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 AISLOP_NO_TELEMETRY=1 prek run --files .pre-commit-config.yaml tests/action_pins.py tests/test-grype-gate-inputs.sh tests/test-python-metadata.sh >TMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop ci --changes --base 93610919c6ca8ef89408ef1abb385e416bb7fc40 > ../artefacts/aislop-before.json 2> ../artefacts/aislop-before.stderrAISLOP_NO_TELEMETRY=1 aislop doctorTMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop scan --changes --base 93610919c6ca8ef89408ef1abb385e416bb7fc40 --include tests/action_pins.py --explain-scopeTMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop scan tests --explain-scopegit --no-pager diff --checkTMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop scan tests --include action_pins.py --json > ../artefacts/aislop-helper-before.json 2> ../artefacts/aislop-helper-before.stderrTMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 prek run grype-gate-inputs --files .github/workflows/build-test.yaml tests/test-grype-gate-inputs.shTMPDIR="$PWD/../artefacts" UV_CACHE_DIR="$PWD/../artefacts/uv-cache" UV_TOOL_DIR="$PWD/../artefacts/uv-tools" UV_TOOL_BIN_DIR="$PWD/../artefacts/uv-bin" uv tool install ruff==0.17.6 > ../artefacts/rufPATH="$PWD/../artefacts/uv-bin:$PATH" TMPDIR="$PWD/../artefacts" RUFF_NO_CACHE=1 AISLOP_NO_TELEMETRY=1 aislop scan tests --include action_pins.py --json > ../artefacts/aislop-helper-ready.json 2> ../ajq -e '.coverage.supportedFiles == 1 and (.engines.lint.skipped == false) and .diagnostics == []' ../artefacts/aislop-helper-ready.jsonTMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 AISLOP_NO_TELEMETRY=1 git commit -s --amend -m 'Test: Stop hard-coding action pins' -m 'Check that Grype and Python metadata calls share a full comTMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-grype-gate-inputs.sh && TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-grype-sbom-binding.sh && TMPDIR="$PWD/PATH="$PWD/../artefacts/uv-bin:$PATH" TMPDIR="$PWD/../artefacts" RUFF_NO_CACHE=1 AISLOP_NO_TELEMETRY=1 aislop ci --changes --base 93610919c6ca8ef89408ef1abb385e416bb7fc40 > ../artefacts/aislop-final.jjq -e '.diagnostics == []' ../artefacts/aislop-final.jsonPATH="$PWD/../artefacts/uv-bin:$PATH" TMPDIR="$PWD/../artefacts" RUFF_NO_CACHE=1 AISLOP_NO_TELEMETRY=1 aislop scan tests --include action_pins.py --json > ../artefacts/aislop-helper-final.json 2> ../ajq -e '.coverage.supportedFiles == 1 and (.engines.lint.skipped == false) and .diagnostics == []' ../artefacts/aislop-helper-final.jsongit log --raw --format=%h 93610919c6ca8ef89408ef1abb385e416bb7fc40..HEADgit --no-pager diff --check 93610919c6ca8ef89408ef1abb385e416bb7fc40TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 AISLOP_NO_TELEMETRY=1 prek run --files .pre-commit-config.yaml tests/action_pins.py tests/test-grype-gate-inputs.sh tests/test-python-metadata.sh >The
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.
Round 1 of revision, on its base. It answers antagonistic review round 1: #208 (review).
What changed
The Grype and Python metadata contract tests now check that each action's calls agree on a full commit SHA and version comment at or above the required floor. Wiring checks no longer copy the current pins. Mutation tests cover uniform upgrades, drift, malformed references, and older versions. No workflow pins changed.
Antagonistic review
Fixed the local validation gap in
.pre-commit-config.yaml: the existinggrype-gate-inputshook now also matchestests/action_pins.py. A helper-only hook run skipped before the fix and passed afterward. The existing workflow and shell-script selectors still trigger the hook.Validation
All three workflow contract scripts, including their mutation tests, and all applicable
prekhooks over the four changed files passed. The repository-levelaislopscan excludestests/by default, so I also scanned the Python helper directly with Ruff enabled and confirmed zero diagnostics. The amended head awaits a fresh review.