Uh oh!
There was an error while loading. Please reload this page.
fix: seed an empty CHANGELOG.md so the first release is well-formed - #5
Merged
Conversation
release-please's Changelog updater treats any pre-existing content as
prior changelog body when it finds no version heading in it. It demotes
H1 to H2 and appends the result below the new entry
(src/updaters/changelog.ts):
if (lastEntryIndex === -1) {
if (content) {
return `${header()}\n${entry}\n\n${adjustHeaders(content).trim()}\n`;
} else {
return `${header()}\n${entry}\n`;
}
}
Seeding `# Changelog` therefore produces a stray `## Changelog` heading
below the first release's entries, which then persists for the life of
the file. Confirmed against the generated 0.1.0 notes on the Release PR,
and yo61/gh-release-stats carries the same artifact on main from its own
first release.
bootstrap seeded that heading into every generated project, so the defect
propagated. Seed an empty file instead, which takes the updater's clean
branch, and empty this repo's own CHANGELOG.md so 0.1.0 is well-formed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AwbmT2rzfYtPqoHPMPWLZtThere was a problem hiding this comment.
The PR removes the pre-seeded changelog heading from both the template and this repository, and the bootstrap reset now leaves CHANGELOG.md empty so release-please can generate the first changelog without demoting a seed heading. I found no blocking correctness or contract issues in the changed paths.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
The generated 0.1.0 notes on #1 end with a stray
## Changelogheading below the release entries. It is not a release-please bug — it is the seed content.src/updaters/changelog.tstreats any pre-existing content as prior changelog body when it finds no version heading in it, demoting H1 to H2 and appending it below the new entry:So a seed of
# Changelogbecomes## Changelog, parked under the first release's entries, where it then persists for the life of the file. An empty seed takes the second branch and is clean.bootstrapseeded that heading into every generated project, so the defect propagated rather than being local to this repo —yo61/gh-release-statscarries the same artifact onmainat line 36, from its own first release.yo61/unifictldoes not, which is consistent with its changelog having been seeded differently.Changes
bootstrapwrites an emptyCHANGELOG.mdinstead ofprintf '# Changelog\n', with the reasoning recorded at the call site.CHANGELOG.mdis emptied so the pending 0.1.0 release is well-formed.Not touched: the artifact already committed to
gh-release-stats. Removing it there is a separate, cosmetic change to a shipped file.Verification
Generated a project from this branch with
./bootstrap --defaultsand confirmed itsCHANGELOG.mdis 0 bytes, then ran the updater's exact logic over both seeds:./scripts/test-bootstrap.shpasses both the flat and DDD cases;shellcheckandshfmt -i 2 -bn -ci -srclean.