Repository navigation
Feat: Derive the standard matrix from metadata - #190
ModeSevenIndustrialSolutions merged 1 commit into
Conversation
The standard workflows took their Python test matrix and build interpreter from python-build-action, whose embedded copy of build-metadata-action (v0.11.1) fixes the range at 3.10 to 3.14. The multi-arch workflows resolve it from live release data through their own python-metadata job and a pinned v0.13.2. The two lanes therefore disagreed for the same project: dependamerge ran 3.11 to 3.14 on the standard lane while python-nss-ng ran 3.11 to 3.15 on the multi-arch one. build-test.yaml and build-test-release.yaml now carry the same python-metadata job as the multi-arch variants, with the same pin and inputs. It fails on a matrix the jobs cannot expand and warns when requires-python fell back to a default range; the multi-arch jobs gain the same warning, which python-build-action stops giving once it receives python_version. python-tests and python-audit expand its matrix, and python-build and the SBOM use its build version. Nothing reads a matrix or build version from python-build any more. tests/test-python-metadata.sh holds all four workflows to that contract and proves itself against mutated copies; testing.yaml runs it beside the Grype wiring checks. README.md and docs/BRIEF.md describe the shared design. Behaviour that changes for callers of the standard workflows: - Test and audit matrices gain Python 3.15 where the project's requires-python allows it, and no longer include 3.10. - The build and the SBOM use the newest line of that matrix: 3.15 for the same projects, where they used 3.14. - A run has one more job, ahead of the build. 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>
There was a problem hiding this comment.
🔵 Needs a closer look
Missing Testing-run evidence leaves standard/multi-arch interpreter parity and build/SBOM outcomes unverified, requiring maintainer review before merge.
No open issues 🎉
What changed in this PR
Aligns the standard workflows with the multi-architecture workflows by deriving Python versions from the same pinned metadata action, addressing #189’s inconsistent version selection.
Changes:
- Adds metadata jobs to the standard workflows and wires their outputs into builds, tests, audits and SBOM generation.
- Validates standard-lane matrices and adds fallback warnings across all four workflows.
- Adds a mutation-backed contract check to CI and updates the workflow documentation. Prek hook registration remains a documented maintainer follow-up.
| File | Description |
|---|---|
tests/test-python-metadata.sh |
Adds metadata wiring checks and mutation-based validation. |
README.md |
Updates job graphs and Python version selection documentation. |
docs/BRIEF.md |
Records the shared metadata design for both workflow families. |
.github/workflows/testing.yaml |
Runs the new contract check in the existing wiring job. |
.github/workflows/build-test.yaml |
Adds metadata extraction, matrix validation and consumer wiring. |
.github/workflows/build-test-release.yaml |
Adds metadata-driven version selection while preserving release gates. |
.github/workflows/build-test-release-multiarch.yaml |
Adds a warning when Python version selection uses a fallback. |
.github/workflows/build-test-multiarch.yaml |
Adds the same fallback warning to multi-architecture verification. |
Review effort: Balanced
There was a problem hiding this comment.
🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.
The version-source rewiring is internally consistent and preserves existing downstream gates; no actionable defect was found in the supplied diff. The external action's fallback-output contract could not be verified from the offline checkout.
Antagonistic round 1 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.
7b88f25
into
lfreleng-actions:main
Closes #189
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI9c88388c1a26bbc8f3bb9d765a7feea2e096567bbash tests/test-python-metadata.shbash tests/test-python-metadata.sh <base-commit workflows copy> (expected failure)prek run --files <changed files>prek run --all-fileszizmor --persona auditor --offline --no-progress .github/workflows/AISLOP_NO_TELEMETRY=1 aislop scan --base 9c88388 --json . (diagnostics: [])AISLOP_NO_TELEMETRY=1 aislop scan --staged --json . (diagnostics: [])git commit -s (pre-commit and commit-msg hooks)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.
What changed and why
The standard workflows (
build-test.yaml,build-test-release.yaml) got their Python test matrix and build interpreter frompython-build-actionv2.1.2. That action embedsbuild-metadata-actionv0.11.1, which hard-codes the range 3.10 to 3.14. The multi-arch workflows use their ownpython-metadatajob with a pinned v0.13.2, which resolves the range from live release data. So the two lanes gave different answers for the same project.build-test.yaml/build-test-release.yaml: add apython-metadatajob copied from the multi-arch variants: same name, permissions, timeout, harden-runner steps, dual checkout, and the samebuild-metadata-actionpin andwith:block. It needsgerrit-validatein the verify workflow andtag-validatein the release workflow. Its outputs arematrix_json({"python-version": [...]}) andbuild_version. A follow-on step fails with::error::when the matrix isn't JSON with a non-emptypython-versionarray, and emits::warning::whenpython_requires_python_fallbackistrue.python-buildneedspython-metadataand passes itpython_version: needs.python-metadata.outputs.build_version. The job'smatrix_jsonandbuild_python_versionoutputs are removed.artefact_name,artefact_pathandartefact_digestsstay.python-testsandpython-auditaddpython-metadatatoneedsand expand its matrix. Theirif:conditions are unchanged. In the release workflow,python-testsstill waits forpython-audit,sbomandgrype.sbomaddspython-metadatatoneedsand uses itsbuild_version.python-metadata.Multi-arch workflows: the derive step in each
python-metadatajob now gives the same fallback warning. Nothing else changes.tests/test-python-metadata.sh: a contract test written liketests/test-grype-gate-inputs.sh. For all four workflows it checks:python-metadatajob, and it needs the right upstream job;build-metadata-actioncall, with the same pin,# v0.13.2comment, step id andwith:block in every workflow;build_versionoutput and matrix output are wired;matrix_jsonorbuild_python_versionfromneeds.python-build.outputs;python-metadata;python-build-actionandsbom-actionpython_versioncomes fromneeds.python-metadata.outputs.build_version, or, on the multi-arch build legs, frommatrix.python-version;python-metadatalists it inneeds.It then checks 22 or 23 mutated copies of each workflow and fails if any mutant passes.
testing.yaml: theTest: Grype gate wiringjob runs the new script in a new step. The job name is unchanged, so required-check names stay the same.Docs: the README job graphs and multi-arch paragraph, and
docs/BRIEF.mdQ11/Q12, now describe the current design in place.Behaviour that changes for callers
requires-pythonallows it, and no longer include 3.10.Extract Project Metadata), ahead of the build.What I ran
bash tests/test-python-metadata.sh: passes. All mutants are caught (23/23, 23/23, 22/22, 22/22).null, bare-array and string matrices with the fallback flag on and off: errors and warnings appear as intended.prek run --files <changed files>andprek run --all-files: pass. This covers yamllint, actionlint, zizmor, shellcheck, markdownlint, reuse, gha-workflow-linter, check-jsonschema, codespell and both Grype wiring checks. The commit-msg gitlint hook also passed.zizmor --persona auditor --offline .github/workflows/: no findings.--base 9c88388,--staged), telemetry off: emptydiagnostics. aislop scores none of the touched file types (YAML, Markdown, shell), so this gate checks little here.For reviewers
build-metadata-actionv0.13.2 exposespython_requires_python_fallback. I took the output name from the issue, and an absent output would only stop the warning from firing.Testing 🧪acceptance criterion: whether thedependamergestandard leg and thepython-nss-ngmulti-arch leg list the same versions. That shows up in this PR's run. If a consumer fails on its new 3.15 leg, that is a finding about the consumer. Per the issue, the matrix is not narrowed.python-build-actionstill runs its embedded metadata step. Only its matrix output goes unused now (out of scope per the issue).python-metadatachecks out the tagged code aftertag-validate, the same as the multi-arch release workflow.