fix(release): rebuild the release PR body and draft notes from the changelog - #221
Merged
Merged
Conversation
…angelog The 5.1.0 pull request body lists 4 entries. Its changelog lists 38. release-please generates the body from the commits since the *last* release, and the last release was 5.1.0-beta - so once the beta is folded into the changelog, the body still describes only what came after it. github-release then copies that body into the draft release, so the published 5.1.0 notes would have omitted the 33 changes that are the release. Folding the changelog fixed the file and left both of the things people actually read. The body and the draft are now rebuilt from CHANGELOG.md, which is the merged and deduplicated list. Only the text between release-please's `---` delimiters is replaced, and the heading comes from the changelog, which is the shape release-please writes. That structure is load-bearing: github-release parses the body to find the release, and an earlier hand-edit of it is why the 5.1.0-beta draft had to be created manually. Verified against the live #217 and its branch: the rebuilt body carries 38 entries, release-please's own PullRequestBody.parse still reads one release at version 5.1.0 with 38 notes entries, no blank line splits a list, and splicing twice leaves 38. Co-Authored-By: Claude <noreply@anthropic.com>
Merged
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.
You were right and I was looking at the wrong artifact.
#217's pull request body lists 4 entries. Its changelog lists 38.
Why, and why it matters more than it looks
release-please generates the body from the commits since the last release —
and the last release was
5.1.0-beta. So once the beta is folded into thechangelog, the body still describes only what came after it.
github-releasethen copies that body into the draft release. So thepublished 5.1.0 release notes would have shipped with those 4 lines, omitting
the 33 changes that are the release. Folding the changelog fixed the file and
left both of the things people actually read.
Fix
The body and the draft notes are rebuilt from
CHANGELOG.md, which is themerged and deduplicated list.
Only the text between release-please's
---delimiters is replaced; the headingcomes from the changelog, which is the shape release-please writes. That
structure is load-bearing —
github-releaseparses the body to find therelease, and an earlier hand-edit of it is exactly why the 5.1.0-beta draft had
to be created manually.
Verified against the live #217 and its branch
The parse check runs release-please's own
PullRequestBody.parseover therebuilt body — the check that would have caught the breakage that forced the
manual draft. Splicing twice leaves 38, so a re-run is a no-op.
🤖 Generated with Claude Code