Skip to content

Feat(sonatype): Expose scan results from the lane - #228

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

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

Conversation

@lf-releng-code-monkey-bot

Copy link
Copy Markdown
Contributor

Closes #226

Authored by an AI agent; human review required
Command Exit
bash tests/scan-summary-steps.sh 0
tests/workflow-steps.sh 0
prek run --files .github/workflows/sonatype-lifecycle.yaml .github/workflows/workflow-tests.yaml README.md tests/scan-summary-steps.sh 1
prek run --files .github/workflows/sonatype-lifecycle.yaml .github/workflows/workflow-tests.yaml README.md tests/scan-summary-steps.sh 0
uvx zizmor --offline --persona auditor .github/workflows/sonatype-lifecycle.yaml .github/workflows/workflow-tests.yaml 0
AISLOP_NO_TELEMETRY=1 aislop scan --base a2c5ea848360155fe91447e5e4a7fac11f159edd --json 0
git commit -s (pre-commit and commit-msg hooks incl. gitlint) 0
bash tests/scan-summary-steps.sh 0
tests/workflow-steps.sh 0
bash tests/python-warning-steps.sh 0
prek run --files .github/workflows/sonatype-lifecycle.yaml .github/workflows/workflow-tests.yaml README.md tests/scan-summary-steps.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.


Carries what sonatype-lifecycle-scan-action v0.3.0 reports through the sonatype-lifecycle.yaml lane, so a caller's vote or comment step can link to the scan.

What changed

  • Pin: the Sonatype Lifecycle scan step now pins lfreleng-actions/sonatype-lifecycle-scan-action@e457b6bf235973c91888b7ab645593f635209875 # v0.3.0 (the release commit, not the annotated tag object).
  • scan_summary input: outcome (default), full or none, passed to the action as summary. A new Validate scan_summary input step in gerrit-validate rejects anything else. The description says what full costs: the result file becomes a run artifact, and a failed upload fails the scan.
  • Outputs: the scan step gets id: scan; jobs.scan.outputs and the workflow's outputs gain scan_id, report_url and result_category (the action's cli_exit_category), in the style of go_version. Each description says the value is Nexus IQ data to pass through env: and never expand in a run: block, and that it is empty with scan_mode: 'sbom'.
  • SBOM path: a new Summarise Go SBOM upload step, gated exactly like the upload step, writes a short job-summary section: the SBOM was uploaded for the application, Nexus IQ evaluates it asynchronously, and the result is on the server. It receives only the application id, not nexus_iq_password.
  • README: a new Nexus IQ scan results section documents the input and outputs, the cost of full, that the job summary is as visible as the run, and the env: rule for the outputs.
  • Tests: tests/scan-summary-steps.sh (33 cases) runs the validation and SBOM-summary steps lifted from the lane and checks the wiring (step id, SHA pin form, summary input, outputs climbing step → job → workflow). It follows tests/workflow-steps.sh, but sits in its own file because that harness is executable and this workflow cannot edit executable files. workflow-tests.yaml runs it.

Checks run

  • bash tests/scan-summary-steps.sh: 33/33 passed
  • tests/workflow-steps.sh: 119/119 passed; bash tests/python-warning-steps.sh: passed
  • prek run --files <changed files>: all hooks passed (including actionlint, zizmor, shellcheck, markdownlint, reuse, gitlint at commit)
  • uvx zizmor --offline --persona auditor on both changed workflows: no findings
  • aislop scan --base <base> with telemetry off: empty diagnostics

For reviewers

  • Output name: the issue asks for "the result category"; I named it result_category and mapped it to the action's cli_exit_category. Rename to cli_exit_category if mirroring the action's name is preferred.
  • full and egress: with scan_summary: full the action uploads an artifact from inside the hardened scan job. I could not check whether the organisation egress allow-list covers the artifact upload endpoints; if it does not, full will fail under block mode.
  • iq_cli_version default (2.13.0-01) says it mirrors the action's default. I could not read v0.3.0's action.yaml from here, so please confirm the default did not change in this release.
  • Output values come from the action; whether it sets them when the scan step fails (e.g. a policy failure) depends on the action, and the descriptions do not promise it.
  • docs/BRIEF.md and the example callers are unchanged; the examples could later show a vote/comment step consuming report_url through env:.

Carry what sonatype-lifecycle-scan-action v0.3.0 reports through the
sonatype-lifecycle.yaml lane, so a caller's vote or comment step can
link to the scan:

- Pin the action at v0.3.0 by commit SHA.
- Add a scan_summary input ('outcome', 'full' or 'none', default
  'outcome'), validated in gerrit-validate and passed to the action
  as summary. Its description says what 'full' costs: the result
  file becomes a run artifact, and a failed upload fails the scan.
- Give the scan step an id and expose scan_id, report_url and
  result_category (the action's cli_exit_category) as workflow
  outputs. Their descriptions mark them as Nexus IQ data, to pass
  through env: and never expand in a run: block.
- On scan_mode 'sbom', which skips the action, write a short job
  summary section: the SBOM was uploaded for the application, Nexus
  IQ evaluates it asynchronously and the result is on the server.
  The three outputs are empty on that path.

tests/scan-summary-steps.sh covers the validation, the wiring and the
sbom summary. It sits beside tests/workflow-steps.sh, which is an
executable file this change could not edit, and workflow-tests.yaml
runs it. The README documents the input and outputs.

Co-authored-by: Copilot <[email protected]>
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.

🔵 Needs a closer look

The new scan_summary: full IQ artifact uploads and downloads still need credentialed end-to-end validation against the organization’s effective egress policy in the block-mode hardened scan job.

No open issues 🎉

What changed in this PR

Exposes Sonatype Lifecycle scan results through the reusable workflow so callers can link to Nexus IQ reports in votes or comments, addressing #226.

Changes:

  • Updates the scan action to v0.3.0 and adds validated scan_summary control.
  • Exposes scan_id, report_url, and result_category outputs, plus a separate summary for asynchronous Go SBOM uploads.
  • Documents result handling and adds automated validation and wiring checks.
File Description
tests/​scan-summary-steps.sh Adds checks for input validation, action wiring, outputs, and SBOM summaries.
README.md Documents summary options, outputs, visibility, and safe handling.
.github/​workflows/​workflow-tests.yaml Runs the new scan-result tests in CI.
.github/​workflows/​sonatype-lifecycle.yaml Updates the action pin and adds summary control, result outputs, and SBOM reporting.

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.

No concrete defects found in the supplied diff: input validation, output wiring, and SBOM summary behavior match the documented change. The external action's implementation and artifact-upload compatibility with the egress allow-list could not be verified from the offline materials.

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.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 7068945 into lfreleng-actions:main Nov 26, 2026
16 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-226 branch November 26, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat(sonatype): Expose scan results from the lane

2 participants