Skip to content

changelog: one fragment file per change instead of a shared latest.md - #467

Open
KonradBreitsprecherBkd wants to merge 3 commits into
mainfrom
dev/changelog_fragments
Open

KonradBreitsprecherBkd wants to merge 3 commits into
mainfrom
dev/changelog_fragments

Conversation

@KonradBreitsprecherBkd

@KonradBreitsprecherBkd KonradBreitsprecherBkd commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Every PR appended its changelog entry to the same spot in docs/changelog/versions/latest.md, so any two PRs with entries conflicted (e.g. #439) and needed a rebase + force push. Now each PR adds a file of its own:

 docs/changelog/
+├── assemble.py                  # renders the fragments, validates them, generates the version list
+├── unreleased/
+│   ├── README.md                # how to write a fragment
+│   └── changed/
+│       ├── build-identity-settings.md
+│       ├── sim-step-handler-switch.md
+│       └── version-macros-committed.md
 ├── overview.rst                 # version list now generated (versions-toctree.inc), newest first
 └── versions/
-    ├── latest.md                # checked in, edited by every PR
+    ├── latest.md                # generated by docs/conf.py, git-ignored
     └── 5.0.8.md

Sections are the folders notes/ (free-form, goes first), added/, changed/, deprecated/, removed/, fixed/. A fragment is one or more - list items.

Release flow, matching the delivery steps:

 start of delivery ("Update Release date in Changelog")
-  edit latest.md: UNRELEASED -> date
+  SilKit/ci/finalize_changelog.py --date YYYY-MM-DD
+    unreleased/*/*.md -> versions/<version>.md, delete fragments
 delivery build, promote, ...
 end of delivery
   bump_version.py X.Y.Z
     patch SilKitVersionMacros.h
-    rename latest.md -> <current>.md, reset latest.md, edit overview.rst
+    (refuses to run before the changelog is finalized)
State latest.md in the docs
development # [5.0.9] - UNRELEASED + fragments yes
finalized, no new fragments # [Unreleased], empty no (released docs start with 5.0.9)
finalized, new fragments # [Unreleased] + fragments yes
after bump # [5.0.10] - UNRELEASED + fragments yes

The installed CHANGELOG.md is versions/<version>.md once finalized, else latest.md.

Also: the PR template asks for a fragment instead of Changelog.md, check_files_changed.py treats fragment-only PRs like the former latest.md-only PRs (no builds), and docs/development/release.md describes the flow.

Evidence

  • Before: two PRs each adding a bullet under ## Changed in latest.md → conflict on whichever merges second.
    After: they add two different files → no conflict.
  • Whole flow in a scratch worktree, each state with a local Sphinx build (no warnings):
    • bump_version.py 5.0.10 before finalizing → error: docs/changelog/versions/5.0.9.md does not exist; finalize the changelog first
    • dev: # [5.0.9] - UNRELEASED, toctree latest.md, 5.0.8.md, …
    • finalize_changelog.py --date 2026-12-15 → 5.0.9.md with # [5.0.9] - 2026-12-15, fragments deleted, toctree 5.0.9.md, 5.0.8.md, … (no latest)
    • new fragment → # [Unreleased], toctree latest.md, 5.0.9.md, …
    • finalize again → error: … 5.0.9.md already exists; bump the version first
    • bump_version.py 5.0.10 → # [5.0.10] - UNRELEASED with the new fragment
  • Invalid fragments fail assemble.py --check with a per-file message.

Merge Danger

Door: two-way

Revert restores latest.md and the old bump script.

Blast Radius: contributors, release process

  • Open PRs that still edit latest.md get a modify/delete conflict once: move the entry into a fragment and git rm docs/changelog/versions/latest.md.
  • Needs a sil-kit-pkg change first: update-changelogs.yml and scripts/silkit_tgz.py read latest.md from the sil-kit checkout, which no longer exists there.
  • sil-kit-delivery README: the "Update Release date in Changelog" step becomes "finalize the changelog"; "Publish the release draft" copies from versions/<version>.md.

🤖 Generated with Claude Code

Every PR appended its entry to the same spot in
docs/changelog/versions/latest.md, so any two PRs with changelog entries
conflicted and needed a rebase and force push.

Each PR now adds docs/changelog/unreleased/<section>/<name>.md.
docs/changelog/assemble.py renders them; the docs build generates
latest.md from them (no longer checked in), and bump_version.py writes
them to versions/<version>.md and deletes them at release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Before, the release manager replaced UNRELEASED with the release date in
latest.md, so the release's docs and packages showed it. The fragments
have no such place: docs/changelog/unreleased/RELEASE_DATE now holds it,
and bump_version.py uses it as default date and deletes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Replaces RELEASE_DATE. The delivery's first step, which used to set the
date in latest.md, now runs SilKit/ci/finalize_changelog.py: it writes
the fragments to versions/<version>.md with the release date and deletes
them, so the delivery build carries the final changelog. bump_version.py
at the end of the delivery only bumps the version, and refuses to run
before the changelog is finalized.

Fragments merged between the two belong to the next version; latest.md
shows them as [Unreleased], and is left out of the docs while there are
none. The docs build generates the version list of overview.rst, so
neither script edits it. The installed CHANGELOG.md is the finalized
page if there is one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
@KonradBreitsprecherBkd KonradBreitsprecherBkd added the status: wip Work in progress. Not ready for review yet. label Dec 2, 2026
@MariusBgm

Copy link
Copy Markdown
Collaborator

@KonradBreitsprecherBkd thought about this a bit. if we keep the meta infos / the changelog fragments in the commit messages of the PR branch, there wouldnt be any conflicts.
Say each PR should contain a changelog fragment:

context: some description

long form of the message

Changelog:
changed:
- foo
- bar
fixed:
- quux
End Changelog

then we could just run a single 'update changelog' workflow that collects commit messages on main and assembles a new changelog file with the {changed, fixed, added, removed, admonitions} entries.
--> no files to have conflicts. no change log conflicts. central changelog generation on main

@KonradBreitsprecherBkd

Copy link
Copy Markdown
Contributor Author

This would work as well. Ideally, we could craft a push on main triggered workflow that incorporates each fragment rightaway. This would need a commit on main though, not sure if this is feasible. No matter which variant we choose in the end, I'd like to enforce it. This way we get rid of the "check the git history and compare it to the changelog" step we currently need on a release. No noteworthy changes must be communicated with an empty section:

Changelog:
End Changelog

So it is more or less ensured that the author thought about it.

@KonradBreitsprecherBkd

KonradBreitsprecherBkd commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

I’ve weighed the different ideas against each other. The "commit message" approach sounds elegant, but it has a few drawbacks:

  1. Squash-merging. On the main branch, only the squash message counts, and this is written or modified by the person performing the merge, which happens after the review.
  2. Lack of review. A code fragment appears in the diff, allowing for line-by-line comments. A commit message, by contrast, cannot be reviewed in this way, and the final squash message is only generated at the moment the "merge" button is clicked.
  3. No room for corrections on main. If there’s a typo or an incorrect section, it has to be overwritten later, for instance, during a finalization step. With a code fragment, this would simply be handled via a follow-up PR consisting of a single line.
  4. Reverts. If a PR is reverted, the revert also removes the associated code fragment. An entry in a commit message, however, remains in the history.

@KonradBreitsprecherBkd KonradBreitsprecherBkd added status: needs discussion Proposal for internal changes. We need to agree on the approach before a detailed review. and removed status: wip Work in progress. Not ready for review yet. labels Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs discussion Proposal for internal changes. We need to agree on the approach before a detailed review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants