Skip to content

ci: keep the CVE issue body current when only versions or the date change - #162

Merged
seberm merged 1 commit into
bitcoinix:masterfrom
ostermayer:cve-report-refresh-body
Oct 28, 2026
Merged

seberm merged 1 commit into
bitcoinix:masterfrom
ostermayer:cve-report-refresh-body

Conversation

@ostermayer

@ostermayer ostermayer commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #63. seberm's review there noted that a pin bump that only changes package versions writes nothing to the pinned issue, so the body keeps old versions and an old scan date and nobody can tell how current it is. Same for a plain rerun with the same findings.

What changed in test/ci/cve-report.sh:

  • The new body is rendered first and compared with the stored one. Same pairs and a different body: gh issue edit only, no comment. Identical body: nothing is written. Different pairs: comment first, then edit, as before.
  • The comparison ignores trailing newlines. gh issue view --jq .body prints one, and the stored body of CVE scan: tracking issue #157 ends with one more newline than the file we wrote, so a strict compare would edit on every run.
  • The first clean scan on a fresh issue goes through the same edit-only path, so that message is gone.
  • The header comment and SECURITY.md say the body shows the last run and comments go out only when the set of pairs changes.

test/ci/cve-tests.py: previous_report() now writes the body exactly as the script renders it, so the "no change" tests check real idempotence. test_version_only_change_does_not_notify and test_removing_one_vulnerable_version_does_not_resolve_finding now expect one edit and no comment. New: test_new_summary_refreshes_body_without_comment, test_refresh_keeps_human_part, test_trailing_newline_from_gh_is_not_a_change.

Two side effects worth knowing: with an oversized summary the fallback body carries the run URL, so that case edits the body on every run, and an oversized set now fails the job even when the pairs didn't change. Both seem right, the artifact pointer stays current and a set that can't be stored shouldn't pass quietly.

Tested

  • python3 test/ci/cve-tests.py test/ci: 29 tests pass. CI runs the same file as the cve-tools check.
  • shellcheck passes, bash -n passes.
  • The trailing newline claim is checked against the live body of CVE scan: tracking issue #157.

Opus 5.5 wrote the change from my spec. Codex (GPT-6 Astra, xhigh) reviewed it and found no defects, and confirmed the comparison can't flap because the API returns the raw Markdown body. The Nix modules aren't touched, so the GLM 5.3 (max) audit of the tree at ac10adb is for completeness: four findings in modules/, none in the files this PR touches. Astra as the second opinion confirmed three (one is #133, two are small leads I'll file separately) and marked one needs-info. DeepSeek V4.1 Flash 1017 wasn't run on this CI-only change.

@github-actions github-actions Bot added area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets labels Oct 27, 2026
@seberm seberm added the type: maintenance No user-visible change: refactor, CI, deps, tooling, docs-only label Oct 27, 2026
…ange

cve-report.sh wrote nothing when the set of package/CVE pairs was
unchanged, so after a pin bump that only moved versions, or after a plain
rerun, the pinned issue kept the old versions and the old scan date and a
reader could not tell how current it was.

Render the new body first and compare it with the stored one. Same pairs
and a different body: edit the body without a comment. Same body: write
nothing. Different pairs: comment first, then edit, as before. The
comparison ignores trailing newlines because gh prints one that GitHub
does not store the same way. SECURITY.md says the body shows the last run.
Tests cover the refresh, idempotence and that the human part survives.
@seberm
seberm force-pushed the cve-report-refresh-body branch from ac10adb to 39038ce Compare October 28, 2026 19:26
@seberm
seberm enabled auto-merge October 28, 2026 19:28
@seberm
seberm merged commit a9cbc97 into bitcoinix:master Oct 28, 2026
9 checks passed
@ostermayer
ostermayer deleted the cve-report-refresh-body branch November 8, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets type: maintenance No user-visible change: refactor, CI, deps, tooling, docs-only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants