fix(release): stop dropping release-notes headings and first bullet - #1046
Conversation
Release notes are carried in the annotated tag message, but two defects combined to truncate them. v2.35.0 shipped with only its last bullet. - `git tag -a -F` used git's default cleanup, which strips lines starting with '#' as commentary, deleting the markdown headings. Pass --cleanup=verbatim in both tag-creation paths. - The workflow read the tag with %(contents:body), which omits the first paragraph as a "subject". Once the headings were gone that paragraph was the first bullet, so it was discarded too. Use %(contents). %(contents) is non-empty for tags made by the `make release tag=vX.Y.Z` fallback, whose whole message is just the version, so guard against passing that to GoReleaser as release notes and keep its default changelog for that path. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Claude finished @ToreMerkely's task in 2m 1s —— View job Code Review — release notes fix
This is a clean, well-diagnosed fix. The root-cause writeup matches the code: git's default Correctness ✅
Consistency ✅
Minor notes (non-blocking)
Static checksOnly shell/YAML/Makefile changed — no Go sources touched — so Nice work 👍Thorough root-cause analysis with the two defects cleanly separated (including the observation that defect 2 was latent behind defect 1), honest verification notes about what was and wasn't empirically confirmed, and explanatory comments left inline in both scripts so the next person doesn't re-introduce the bug. The guard addition shows the interaction between the two fixes was thought through rather than each fixed in isolation. |
Release notes are carried in the annotated tag message. Two defects combined to truncate them —
v2.35.0published with only its last bullet, losing the# Breaking changesheading, the breaking-change bullet, and the# Improvementsheading.Root cause
git tag -a -Fstripped the headings. Both tag-creation paths (bin/release-interactive.sh,Makefilereleasetarget) omitted--cleanup, so git's default cleanup removed every line starting with#as commentary.%(contents:body)then ate the first bullet. The workflow read the tag body with%(contents:body), which omits the message's first paragraph as a "subject". With the headings already gone, that paragraph was the first bullet.Defect 2 was latent on its own: had the headings survived,
%(contents:body)would have swallowed# Breaking changesinstead.Changes
bin/release-interactive.shandMakefile— pass--cleanup=verbatimtogit tag -a..github/workflows/release.yml— read%(contents)instead of%(contents:body).make release tag=vX.Y.Zfallback path, which tags with the version as the entire message.%(contents)is non-empty there, so without the guard GoReleaser would receivevX.Y.Zas the whole release body instead of falling back to its default changelog.Verification
Defect 2 is confirmed against the real
v2.35.0tag:%(contents)returns both bullets where%(contents:body)returns only the second.The
--cleanup=verbatimbehaviour is not empirically verified here — it rests on git's documented default (--cleanup=stripremoves commentary) plus the observed symptom (headings present indist/release_notes.md, absent from the pushed tag). The next release exercises it for real; worth a look at the tag message before the workflow runs.The already-published
v2.35.0release body has been corrected by hand. Its annotated tag still carries the stripped message.🤖 Generated with Claude Code