build(changelog): fail the version bump on an empty Unreleased - #89
Conversation
An empty [Unreleased] at release time means the entry policy was skipped, and the plugin's default response is to skip patchChangelog with an info-level log and a green build. Nothing is cut, no heading appears, and the release workflow's heading gate is the first thing that says so - one tag and one push after the mistake. patchEmpty = false turns that into a failed bump with the plugin's own message, at the step where it is cheap. Measured against gradle-changelog-plugin 2.5.0 (kzstd's tree, VERSION_NAME bumped to an unreleased value, Unreleased empty): the default logs ":patchChangelog task skipped due to the missing release note" and succeeds; with patchEmpty = false it fails with MissingReleaseNoteException and leaves the file untouched. Signed-off-by: James Rich <james.a.rich@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe changelog configuration now sets ChangesChangelog Configuration
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change correctly prevents release preparation from silently proceeding without release notes, while preserving normal non-empty changelog handling. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the changelog bright Comment |
Why
The changelog-plugin adoption left
patchEmptyat its default. With an empty## [Unreleased], that default makespatchChangelogskip: an info-level log line, a green build, no section cut, no heading added. The person cutting the release sees success, commitschore(release): x.y.z, tags, and the release workflow's heading gate is the first thing that fails, one tag and one push after the mistake.patchEmpty = falsemoves that failure to the bump itself, with the plugin's own message naming the file and the fix.Measured
Against gradle-changelog-plugin 2.5.0 in kzstd's tree, with
VERSION_NAMEbumped to a value that has no section andUnreleasedempty:patchChangelogBUILD SUCCESSFUL, logs:patchChangelog task skipped due to the missing release notepatchEmpty = falseBUILD FAILED,MissingReleaseNoteException: ... requires release note to be providedNeither case touches the file. A non-empty Unreleased still patches as before.
What changed
One property in the
changelog {}block, with a comment saying why. No CHANGELOG entry: nothing a consumer of the published artifact can observe changes.A deps-only release now needs a one-line entry under Unreleased before it can be cut, which is the policy CONTRIBUTING already states.
Summary by CodeRabbit