Skip to content

build(changelog): fail the version bump on an empty Unreleased - #89

Merged
jamesarich merged 1 commit into
mainfrom
build/changelog-patch-empty
Sep 18, 2026
Merged

jamesarich merged 1 commit into
mainfrom
build/changelog-patch-empty

Conversation

@jamesarich

@jamesarich jamesarich commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The changelog-plugin adoption left patchEmpty at its default. With an empty ## [Unreleased], that default makes patchChangelog skip: an info-level log line, a green build, no section cut, no heading added. The person cutting the release sees success, commits chore(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 = false moves 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_NAME bumped to a value that has no section and Unreleased empty:

setting patchChangelog heading written
default BUILD SUCCESSFUL, logs :patchChangelog task skipped due to the missing release note no
patchEmpty = false BUILD FAILED, MissingReleaseNoteException: ... requires release note to be provided no

Neither 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

  • Chores
    • Empty Unreleased changelog content now causes the patch task to fail instead of completing without generating a heading.

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>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: bb08348d-cfa3-4275-8a62-f13379402463

📥 Commits

Reviewing files that changed from the base of the PR and between 5b70424 and 9f72642.

📒 Files selected for processing (1)
  • build.gradle.kts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The changelog configuration now sets patchEmpty = false. The patch task fails when Unreleased has no content instead of completing without creating a heading.

Changes

Changelog Configuration

Layer / File(s) Summary
Empty patch validation
build.gradle.kts
The changelog configuration sets patchEmpty = false, so empty Unreleased content causes the patch task to fail.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 9f726

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: the build now fails when the Unreleased changelog section is empty.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

A rabbit checks the changelog bright
Empty patches stop tonight
No heading hides below
The task now tells us so
Fresh notes make the patching go

Comment @coderabbitai help to get the list of available commands.

@jamesarich
jamesarich added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 83ff11e Sep 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant