Skip to content

Test: Require one shared metadata action pin #200

Description

Summary

The Grype gate wiring check, tests/test-grype-gate-inputs.sh (hook grype-gate-inputs), compares every lfreleng-actions/repository-metadata-action call with a commit hardcoded in the test. Replace that with a consistency rule: every call pins a full commit SHA, and all four workflows pin the same one. Also fix the failure summary, which miscounts. Line numbers are from 742a4b1 on main; if main has moved, find the same text.

Why

main is failing the hook right now. Dependabot moved all four workflows to f4417bda9e73aa169709682d07d6083453275c58 # v0.5.5, but it cannot update the test, which still expects ff822d06a64404a54feb79f8e27b687cc76d1c83 (v0.5.4):

::error file=/code/.github/workflows/build-test.yaml::jobs.repository-metadata does not pin lfreleng-actions/repository-metadata-action@ff822d06a64404a54feb79f8e27b687cc76d1c83
(and the same for build-test-multiarch.yaml, build-test-release.yaml, build-test-release-multiarch.yaml)
4 problem(s) across 4 workflow(s) ❌

Every Dependabot bump of this action breaks the hook the same way, so the fix is to stop hardcoding the version, not to bump it again. The value of the check is that all call sites move together; that survives as a consistency rule. The same change is being made in workflows-template, go-workflows and docker-workflows.

Changes

All in tests/test-grype-gate-inputs.sh:

  1. Drop METADATA_PIN (line 70).
  2. Per workflow (check_metadata, ~line 267, does not pin {METADATA}@{METADATA_PIN}): require the ref after @ to be a full 40-character lowercase hex commit SHA. A tag (@v0.5.5) or a short SHA fails.
  3. Across workflows: after checking every workflow in VERIFY + RELEASE, fail if their metadata calls pin more than one SHA. Report each workflow with the pin it has and a note saying how many different pins there are, so the lagging one is obvious.
  4. Self-test: a lone workflow can no longer fail by pinning a different valid SHA, so the "repository-metadata-action on v0.3.3" mutant (~lines 485–486) must become a check of two workflows: the clean one, and a copy re-pinned to 2206d754f65f1a90f57b49be546712c5f594def2, expecting the cross-workflow rule to fail. Add per-workflow mutants for a tag pin and a short-SHA pin. Every mutant must still be caught.
  5. Summary line (~line 643): {failures} problem(s) across {len(VERIFY + RELEASE)} workflow(s) prints the number of workflows checked, not the number with problems. Count the distinct workflows that have problems instead.
  6. Header comment: where it describes the metadata pin ("pin the same metadata action"), say that every workflow pins it to one shared commit SHA.

Out of scope

  • No workflow changes. Do not edit anything under .github/workflows/; the v0.5.5 pins there are correct.
  • Leave the grype-scan-action pin, its "grype-scan-action pinned elsewhere" mutant, and every other check exactly as they are.
  • tests/test-python-metadata.sh also has a METADATA_PIN, but for build-metadata-action; it is unrelated, so leave it alone.
  • Do not edit .pre-commit-config.yaml, AGENTS.md, LICENSE*, REUSE.toml or .gitlint.

Acceptance criteria

  • A single commit with the subject Test: Require one shared metadata action pin, which is also the PR title
  • git grep -nE 'METADATA_PIN|ff822d06' tests/test-grype-gate-inputs.sh prints nothing
  • bash tests/test-grype-gate-inputs.sh passes against the current workflows and reports every mutant caught
  • Against a scratch copy of .github/workflows/ where one workflow's metadata call is moved back to ff822d06a64404a54feb79f8e27b687cc76d1c83 # v0.5.4, the script fails, names every metadata call site, and the summary counts the workflows that have problems
  • prek run --all-files passes, and aislop ci --changes adds no findings

Activity

  1. lf-releng-code-monkey-bot commented on Nov 23, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 An AI agent has proposed a change for this issue: pull request #201 (head 3860c97). The Copilot review of it has findings (1 unresolved review thread; assessment: changes recommended). 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.

  2. lf-releng-code-monkey-bot commented on Nov 23, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 Round 1: an AI agent revised pull request #201 (head 5e9cc35). Round 1: one Copilot finding, fixed. - Fixed: the shared-pin self-test re-pinned a copy to the v0.3.3 SHA unconditionally. If all workflows pinned that SHA, the copy matched the clean workflow and the self-test exited 1 on valid workflows. I confirmed this with a scratch copy: the previous head failed (84/85). The copy now falls back to another full SHA when the clean pin already equals v0.3.3. The fix passes that scratch case and the real workflows (85/85 each). - No rebase: the branch stays on 742a4b1, which is still main's head, and the PR is mergeable. - Checks: no failing checks reported. I ran the test script, prek on the changed file, gitlint through the commit hooks, and aislop, and all passed. Remaining: Copilot's review of the new head.. The Copilot review of it has findings (1 unresolved review thread; assessment: changes recommended). 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.

  3. lf-releng-code-monkey-bot commented on Nov 23, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 Round 2: an AI agent revised pull request #201 (head bd2b16f). Round 2: one Copilot finding, fixed. - Fixed: the two metadata-pin diagnostics printed a malformed ref verbatim, so a YAML ref holding \n::warning::forged split the ::error line and forged a runner command. I reproduced it on a scratch copy. Both messages in tests/test-grype-gate-inputs.sh now use {pin!r}, and the scratch case stays on one line. - No rebase: the branch stays on 742a4b1, which is still main's head, and the PR is mergeable. - Checks: none failing. The test script passes on the real workflows (85/85 mutants per verify workflow). The v0.5.4 scratch case fails as the issue requires. prek on the changed file, gitlint and aislop ci all pass. - Remaining: Copilot's review of the new head.. The Copilot review of it is clean. An antagonistic review was requested from the review bot.

  4. added
    code-quality
    CI
    on Nov 23, 2026
  5. ModeSevenIndustrialSolutions commented on Nov 24, 2026

    @ModeSevenIndustrialSolutions
    MemberAuthor

    #204 has merged, and #201 now conflicts with main. Rebase #201 onto main (7d14141) and resolve the conflict.

    It is one hunk in tests/test-grype-gate-inputs.sh. To keep the old check passing, #204 moved the METADATA_PIN line to the v0.5.5 commit (f4417bda…); this issue removes that constant. Resolve it in favour of this change:

    • keep the FULL_SHA pattern and the shared-pin rule;
    • leave no METADATA_PIN, ff822d06 or f4417bda in tests/test-grype-gate-inputs.sh.

    Nothing else in #201 needs to change. tests/test-python-metadata.sh gained checks in #204 and keeps its own METADATA_PIN, for build-metadata-action; that file stays out of scope here.

    Keep the single commit and its subject. After the rebase, bash tests/test-grype-gate-inputs.sh and bash tests/test-python-metadata.sh should both pass against the workflows on main.

  6. lf-releng-code-monkey-bot commented on Nov 24, 2026

    @lf-releng-code-monkey-bot
    Contributor

    🐒 Round 3: an AI agent revised pull request #201 (head f8ecba6). Round 3: rebased as the maintainer asked. There were no review findings or failing checks. - Rebased onto main 7d14141 because #204 merged and the PR conflicted. The one hunk was #204's METADATA_PIN = "f4417bda…" line. I resolved it for this change: FULL_SHA and the shared-pin rule stay, with no METADATA_PIN/ff822d06/f4417bda left in tests/test-grype-gate-inputs.sh. The file is byte-identical to the previous head. The branch is still one commit with the same subject. - Re-signed the commit with -s. The carried-over bot sign-off went over gitlint's body length locally, and the workflow replaces the trailer anyway. - Ran: bash tests/test-grype-gate-inputs.sh (85/85 mutants) and bash tests/test-python-metadata.sh, both passing against main's workflows. The v0.5.4 scratch case fails as required. prek on the changed file and gitlint pass. aislop exits 0 but scans no shell files. - Remaining: Copilot's review of the new head.. The Copilot review of it is clean. An antagonistic review was requested from the review bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIcode-quality

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions