Skip to content

Release notes from per-PR changelog.d fragments#5685

Merged
norman-abramovitz merged 5 commits into
cloudfoundry:developfrom
nabramovitz:feat/release-notes-fragments
Jul 23, 2026
Merged

Release notes from per-PR changelog.d fragments#5685
norman-abramovitz merged 5 commits into
cloudfoundry:developfrom
nabramovitz:feat/release-notes-fragments

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Follow-on to #5684. Release notes now accumulate continuously as per-PR fragment files instead of being written at release time.

How it works

  • Each PR adds its own fragment changelog.d/NNNN-<slug>.md (./build/release-notes.sh new picks the next sequence number and slugs the branch name). The fragment body uses the release-notes section headers directly — [Breaking Changes] / [Features] / [BugFixes] / [Chores] / [Security Updates] — so one file can feed multiple sections.
  • make stamp tag assembles the fragments (header-grouped, sections in layout order, only populated sections; [Breaking Changes] leads when present) and embeds the result in the annotated tag body. With no fragments the tag body falls back to a pointer line.
  • make publish uses the tag body as the GitHub release notes (--notes-from-tag); NOTES=<file> still overrides. The previous CHANGELOG.md section extraction is superseded — the tag is the notes carrier.
  • make sweep (new plain verb) removes the consumed fragments after publishing; the removal commit rides the next PR. The directory is empty right after every release — fragments live one cycle.

Concurrent PRs picking the same NNNN are harmless: the slug keeps filenames distinct, ties sort alphabetically. Unknown section headers fail assembly loudly.

release.yml

One added step before make publish: re-fetch the tag object. actions/checkout resolves the tag ref to its commit, which silently drops the annotation that now carries the notes; the fetch also covers workflow_dispatch runs where the tag was never checked out.

Verification

  • build/test-release-notes.sh: numbering, slug sanitizing, header-grouped assembly order, populated-sections-only, unknown-section and stray-content failures (7/7).
  • Live: fragment → assemble → annotated tag body → make publish DRYRUN=yes shows --notes-from-tag (and --notes-file when NOTES= is set); make sweep DRYRUN=yes clean.
  • Full make check gate green; zizmor clean on release.yml.

This PR carries its own fragment as the first real entry, and bumps to v5.0.0-dev.144.

Per-PR fragment files changelog.d/NNNN-<slug>.md carry release-note
entries under [Breaking Changes]/[Features]/[BugFixes]/[Chores]/
[Security Updates] headers. build/release-notes.sh provides new
(next-sequence fragment), assemble (header-grouped concatenation in
layout order), and sweep (git rm after a release consumes them).
Fragments are transient — they ride each PR and live one release cycle.
stamp tag now embeds the assembled changelog.d fragments in the
annotated tag body (pointer-line fallback when none exist); publish
consumes it with --notes-from-tag unless NOTES=<file> overrides. The
CHANGELOG.md extraction is superseded — the tag is the notes carrier.
New plain verb 'make sweep' removes consumed fragments post-publish.
Includes this change's own fragment.
actions/checkout resolves the tag ref to its commit, dropping the
annotation whose body now carries the release notes. Fetch the real
tag object so --notes-from-tag sees them; also covers
workflow_dispatch runs where the tag was never checked out.

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Minor issues that can be adjusted with follow on PRs

  1. Tag needs to be created at the beginning of the development cycle
    This might mean draft PRs are created first or adding a make slug.
  2. Redo the stamp vocabulary so the make steps is readable
  3. Add an optional review release notes make vocabulary.
  4. Resolve version number collisions when PRs are done out of order.

This might mean the version number - slug conversion is part of the final review process.
There is still a sequencing order issue but the window is smaller.

@norman-abramovitz
norman-abramovitz merged commit 8cbeed0 into cloudfoundry:develop Jul 23, 2026
22 checks passed
@nabramovitz
nabramovitz deleted the feat/release-notes-fragments branch July 23, 2026 12:38
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.

2 participants