Skip to content

feat(scripts): release:notes --advisory lists GHSA fixes and credits their reporters - #2788

Merged
cliffhall merged 3 commits into
v2/mainfrom
v2/feat/2766-release-notes-advisory
Oct 25, 2026
Merged

cliffhall merged 3 commits into
v2/mainfrom
v2/feat/2766-release-notes-advisory

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2766

What changed

npm run release:notes gains a repeatable --advisory "<GHSA-id>: <markdown>" (scripts/release-notes.mjs). For each advisory it:

  • Renders a bullet under ### Security fixes at the top of What's Changed, ending in the advisory link (* <markdown> ([GHSA-…](…/security/advisories/GHSA-…))), and moves the generated PR list under ### Other changes — the 1.0.3 / 2.12.0 shape. The markdown is used verbatim, so the maintainer bolds the lead clause as those releases do.
  • Credits its reporters from credits_detailed — reporter and finder credits on User accounts, in every credit state (pending included), with the same maintainer-by-permission exclusion as issue reporters. They merge into the Thanks list one line per person, * @user (#123, GHSA-…). Issue reporters still sort by issue count then name; advisory-only reporters follow, by name. The section now appears when only advisory reporters exist, with a lead-in matching what it credits ("issues", "issues and vulnerabilities", or "vulnerabilities").
  • Aborts when no vulnerabilities[].patched_versions names the release version, and on any failed advisory lookup (fail-fast, before generate-notes or any Release create).
  • Warns, but carries on, when the advisory is a draft.

The release skill's step 3a documents the option.

Acceptance check

Previewing --version 2.12.0 with its three advisories against the live API, then diffing against the published 2.12.0 body (CRLF stripped): the security bullets and the whole Thanks list match byte for byte. The only differences are the two hand-written blocks — the intro sentence under ### Security fixes and the ### New configuration section — which this PR leaves to the maintainer.

Not included

The optional generic --section "<markdown>" from the issue (for "New configuration" and the security intro). The issue marked it as fine to split off, so it isn't in this PR.

Tests

scripts/release-notes.test.mjs: argument parsing and validation (bad id, empty markdown, duplicates); credit filtering by type, user type and state; section insertion with and without a What's Changed heading; Thanks ordering and the three lead-ins; end-to-end merge of issue and advisory reporters with one permission lookup per person; patched-version mismatch aborts; draft warns; lookup failure aborts before any Release is created. npm run local:gate is green.

🤖 Generated with Claude Code

…their reporters (#2766)

A GHSA fix lands as a merge from the advisory's private fork, so
generate-notes never lists it, and its reporter filed no issue, so the
Thanks section never credited them. Each --advisory "<GHSA-id>: <markdown>"
adds a bullet under ### Security fixes (PRs move under ### Other changes)
and merges the advisory's reporter/finder credits, in every credit state,
into the Thanks list. An advisory whose patched versions do not name the
release, or whose lookup fails, aborts the run; a draft only warns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 25, 2026
@cliffhall cliffhall linked an issue Oct 25, 2026 that may be closed by this pull request
5 tasks
@cliffhall
cliffhall requested a balanced review from Copilot October 25, 2026 01:46

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.

🟡 Changes recommended

CRLF note bodies produce duplicate What's Changed headings and omit the required Other changes section.

1 open issue
What changed in this PR

Adds advisory support to the release-notes helper so security fixes and their reporters appear alongside generated PR changes, addressing #2766.

Changes:

  • Adds repeatable --advisory arguments, security-fix bullets, and merged reporter credits.
  • Validates patched versions, aborts failed lookups, and warns about draft advisories.
  • Documents the option and adds focused regression coverage.
File Description
scripts/​release-notes.test.mjs Tests advisory parsing, formatting, credits, and failure paths.
scripts/​release-notes.mjs Implements advisory lookup, validation, security sections, and reporter merging.
.claude/​skills/​release/​SKILL.md Documents advisory options and remaining manual release-note edits.

Review effort: Balanced

Comment thread scripts/release-notes.mjs Resolved
@cliffhall

Copy link
Copy Markdown
Member Author

Copilot round 1: one finding (CRLF heading match), fixed in c04ea45 with a CRLF test. Requesting round 2.

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.

🟡 Changes recommended

The patched-version guard discards comparison operators and accepts release versions explicitly excluded by a range.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread scripts/release-notes.mjs Resolved
@cliffhall

Copy link
Copy Markdown
Member Author

Copilot round 2: one finding (patched-version guard ignored comparison operators), fixed in 741c7e8 with exclusive-bound regression cases. Requesting round 3.

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.

🟢 Approval recommended

The implementation matches the requested scope, addresses both prior findings, and includes focused regression coverage with no unresolved blocking issues.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 3 was clean (no inline comments, no open or suppressed findings). Both earlier findings — the CRLF heading match and the patched-range bounds — were fixed in this PR.

@cliffhall
cliffhall merged commit bf73152 into v2/main Oct 25, 2026
11 checks passed
@cliffhall
cliffhall deleted the v2/feat/2766-release-notes-advisory branch October 25, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release:notes: add --advisory to list GHSA fixes and credit their reporters

2 participants