Skip to content

feat(release): open the release notes with a notice written above the entries - #355

Merged
allen0099 merged 1 commit into
masterfrom
feat/354-release-notice
Sep 29, 2026
Merged

allen0099 merged 1 commit into
masterfrom
feat/354-release-notice

Conversation

@allen0099

Copy link
Copy Markdown
Owner

Closes #354

What

A release can now open with a notice, e.g. "0.3.9 is the last 0.3.x release". It is written by hand into CHANGELOG.md directly under ## [Unreleased], above the first ### heading or - entry.

  • release_notes() splits that text off (_split_notice) and puts it verbatim at the top of the release body, before the first section.
  • promote() already kept it under the new ## [X.Y.Z] heading, so it stays on record in CHANGELOG.md; the fresh ## [Unreleased] has none, so a notice appears in one release only.
  • Previously such a paragraph failed the release ("neither a ### heading nor a - list entry").

Rules kept strict

  • A paragraph anywhere else in the section still fails the run.
  • A section with a notice but no entries (or only empty headings) is an error: a notice alone is nothing to release.
  • Fragments cannot carry a notice; it goes through review as a CHANGELOG.md edit.

Docs

docs/DEVELOPMENT.md (changelog/release section) and changelog.d/README.md. No changelog fragment: this changes release tooling, not the library.

Tests

New tests in tests/test_changelog_release.py: notice verbatim (multi-paragraph), notice before loose entries, prose below a heading still rejected, no-entry releases rejected, and an end-to-end main() run with fragments that checks both the release notes and the rewritten changelog. Removing the split, the empty check, or the heading-spacing fix each fails 5, 3 and 2 tests respectively.

… entries

Text directly under ## [Unreleased], above the first heading or entry, is
copied verbatim to the top of the GitHub release notes and kept under the
version's heading in CHANGELOG.md. It used to fail the release as a line
that is neither a heading nor an entry. A section with a notice but no
entries is still nothing to release.

Closes #354
@allen0099
allen0099 merged commit 47548e2 into master Sep 29, 2026
12 checks passed
@allen0099
allen0099 deleted the feat/354-release-notice branch September 29, 2026 06:53
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.

Allow a release notice above the changelog entries in the GitHub release notes

1 participant