Repository navigation
ci: keep the CVE issue body current when only versions or the date change - #162
Merged
Merged
Conversation
…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
force-pushed
the
cve-report-refresh-body
branch
from
October 28, 2026 19:26
ac10adb to
39038ce
Compare
seberm
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:gh issue editonly, no comment. Identical body: nothing is written. Different pairs: comment first, then edit, as before.gh issue view --jq .bodyprints 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.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_notifyandtest_removing_one_vulnerable_version_does_not_resolve_findingnow 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 thecve-toolscheck.bash -npasses.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.