Skip to content

Test: Stop hard-coding action pins - #208

Merged
ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-207
Nov 25, 2026
Merged

ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-207

Conversation

@lf-releng-code-monkey-bot

@lf-releng-code-monkey-bot lf-releng-code-monkey-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #207

Authored by an AI agent; human review required; changes the lint gate, .pre-commit-config.yaml
Command Exit
prek run grype-gate-inputs --files tests/action_pins.py 0
TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 prek run grype-gate-inputs --files tests/action_pins.py 0
TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-grype-gate-inputs.sh 0
TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-grype-sbom-binding.sh 0
TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 bash tests/test-python-metadata.sh 0
TMPDIR="$PWD/../artefacts" prek install -t pre-commit -t commit-msg 0
git diff --check 93610919c6ca8ef89408ef1abb385e416bb7fc40 0
TMPDIR="$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 > 0
TMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop ci --changes --base 93610919c6ca8ef89408ef1abb385e416bb7fc40 > ../artefacts/aislop-before.json 2> ../artefacts/aislop-before.stderr 0
AISLOP_NO_TELEMETRY=1 aislop doctor 0
TMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop scan --changes --base 93610919c6ca8ef89408ef1abb385e416bb7fc40 --include tests/action_pins.py --explain-scope 0
TMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop scan tests --explain-scope 0
git --no-pager diff --check 0
TMPDIR="$PWD/../artefacts" AISLOP_NO_TELEMETRY=1 aislop scan tests --include action_pins.py --json > ../artefacts/aislop-helper-before.json 2> ../artefacts/aislop-helper-before.stderr 0
TMPDIR="$PWD/../artefacts" PYTHONDONTWRITEBYTECODE=1 prek run grype-gate-inputs --files .github/workflows/build-test.yaml tests/test-grype-gate-inputs.sh 0
TMPDIR="$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/ruf 0
PATH="$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> ../a 0
jq -e '.coverage.supportedFiles == 1 and (.engines.lint.skipped == false) and .diagnostics == []' ../artefacts/aislop-helper-ready.json 0
TMPDIR="$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 com 0
TMPDIR="$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/ 0
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.j 0
jq -e '.diagnostics == []' ../artefacts/aislop-final.json 0
PATH="$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> ../a 0
jq -e '.coverage.supportedFiles == 1 and (.engines.lint.skipped == false) and .diagnostics == []' ../artefacts/aislop-helper-final.json 0
git log --raw --format=%h 93610919c6ca8ef89408ef1abb385e416bb7fc40..HEAD 0
git --no-pager diff --check 93610919c6ca8ef89408ef1abb385e416bb7fc40 0
TMPDIR="$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 > 0

The github-code-monkey-bot workflow 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 existing grype-gate-inputs hook now also matches tests/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 prek hooks over the four changed files passed. The repository-level aislop scan excludes tests/ by default, so I also scanned the Python helper directly with Ruff enabled and confirmed zero diagnostics. The amended head awaits a fresh review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

Comment thread tests/test-grype-gate-inputs.sh Resolved
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the workflow contract-test updates.

No open issues 🎉

Review effort: Balanced

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 55c9ecb into lfreleng-actions:main Nov 25, 2026
107 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-207 branch November 25, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality Updates to code-quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test: Stop hard-coding action pins

2 participants