Skip to content

feat(release): collect CHANGELOG fragments at release (#1350) - #1469

Open
fanhongy wants to merge 6 commits into
mainfrom
feat/1350-changelog-fragments
Open

fanhongy wants to merge 6 commits into
mainfrom
feat/1350-changelog-fragments

Conversation

@fanhongy

Copy link
Copy Markdown
Collaborator

Summary

  • Collect changelog.d/<PR>.<type>.md entries during the version bump, ordered by Keep a Changelog type and numeric pull request number, merging them into matching hand-written [Unreleased] subsections.
  • Validate fragments before changing release files; replace the changelog atomically and restore the changelog, fragments, and version carriers if a release step fails.
  • Stage only deletions of valid fragment files with the release commit, so the changelog and fragment cleanup land together in the atomic commit-and-tag push.
  • Document the fragment format, remove the unused cliff.toml, and retain GitHub's generated release notes.

Why

Pull requests editing the [Unreleased] section collide needlessly. For a notable change, add a file such as changelog.d/1350.Changed.md containing a single - Description of the change. entry instead of editing the shared changelog. Valid types are Added, Changed, Deprecated, Removed, Fixed, and Security.

Validation

  • The real release bump is exercised with every fragment type, multiple PR numbers, hand-written notes, collection, and a second bump to confirm idempotence; an end-to-end test commits and pushes the bump and fragment deletion to a local bare remote.
  • Invalid filenames, invalid types, malformed entries, write failures, and partial deletion are covered with byte-for-byte rollback assertions.
  • The full CI-shaped suite passes on the final head: 29,744 passed, 163 skipped, 23 deselected, 8 xfailed, with 93.59% coverage (80% required). Release and scripts tests, lint, and the mypy ratchet also pass.

Refs #1350. Merging duplicate type headings moves their hand-written entries together and places other headings after the Keep a Changelog types. The proposed CI check requiring a fragment or a no-changelog label for source changes follows separately, as does the stale release-workflow comment describing the changelog update.

🤖 Generated with Claude Code

fanhongy and others added 3 commits November 23, 2026 11:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fanhongy

fanhongy commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Review at 13fd77a

The release path works. I ran a full dry release from main's tree with seven fragments, one of each type plus two Fixed. The bump promoted [Unreleased], merged the fragments under the right headings in PR order, and deleted them. release_commit.py then committed the bump with the seven deletions and pushed the commit and tag to a local bare repo. No hand-written line was dropped or doubled. A failed bump rolls back every file, and a re-run then works. git-cliff is no longer used anywhere, so deleting cliff.toml is safe. One gap below, plus three small notes.

P2

P2-1. Nothing checks the fragments in the repo before the release runs.

  • Where: read_fragments() in scripts/bump_version.py. It is called only by the release bump. No test or CI job runs it on the repo's own changelog.d/.
  • Problem: a bad fragment merges with green CI. It fails only later, in release.yml's bump step, after the preflight passed. Every scheduled release is then red until a fix PR lands. The likely bad fragment is a wrapped bullet, because that is how CHANGELOG.md entries are written (see P3-2). A lowercase type (1470.fixed.md) or a stray .gitkeep fails the same way. Nothing is pushed, so this fails safe, but late. The PR body defers the "fragment required" CI check. This is a different, smaller check: is each fragment that exists valid.
  • Evidence (validated: yes). A wrapped-bullet fragment in the PR tree, then the PR's own tests, then the bump:
    bash reviews/validation-1469/rollback_and_bad_fragment.sh
    -- PR test suite (test/scripts) with the bad fragment in the tree:
    415 passed in 4.52s
    -- release bump with the bad fragment:
    ChangelogError: Invalid changelog fragment '1470.Fixed.md': expected one '- ' entry
    exit=1
    
    grep -rln "changelog\.d\|read_fragments" test/ .github/ Makefile finds only the two test files, and both use temp trees.
  • Fix: one small test that runs bump_version.read_fragments() on the real ROOT, so CI fails on the PR that adds the bad fragment. For example in test/scripts/test_bump_version.py: def test_repository_fragments_are_valid(): bump_version.read_fragments().

P3

P3-1. Headings and link references are found line by line, so some valid Markdown gets reshaped.

  • Where: TYPE_HEADING and LINK_REFERENCE in promoted_changelog().
  • Problem: three inputs give a wrong section when fragments exist. None of them is in today's CHANGELOG.md, so this is a hardening note.
    • A link reference in the middle of [Unreleased] ([x]: https://...): everything after it is treated as "link references". A later ### Fixed stays where it is, and the fragments get a second ### Fixed above it.
    • ### Fixed with a trailing space is an "unknown" heading. It gets a second ### Fixed next to it.
    • A ### Fixed line inside a fenced code block is taken as a heading. Blank lines are added inside the fence, and the fragment lands after the code block, under ### Added.
  • Evidence (validated: yes): python3 reviews/validation-1469/edge_probe.py <worktree> (full output in edge_probe.log). For the mid-section link reference: -- duplicate type headings in 1.0.1: {'### Fixed': 2}.
  • Fix (optional): skip fenced blocks when looking for headings, strip trailing spaces from the heading type, and take link references only from the end of the section.

P3-2. One line per fragment does not fit how entries are written here.

  • Where: the len(lines) != 1 check in read_fragments(), and changelog.d/README.md.
  • Problem: most [Unreleased] entries on main are wrapped paragraphs. A count gives 196 of 217 entries over more than one line. Those authors cannot move their entry into a fragment, so they keep editing CHANGELOG.md and the merge conflicts this PR targets stay.
  • Evidence: reviews/validation-1469/entry_lines.log: entries=217 one_line=21 multi_line=196 (a rough split on lines that start with - ).
  • Fix (optional): accept one bullet plus indented continuation lines (each starting with two spaces), or say in the README that long entries still go in CHANGELOG.md.

P3-3. The PR's own fragment uses the issue number, not the PR number.

Checked by running

All runs used env -i with an empty HOME, under timeout 300, in copies under $KIROCREW_SCRATCH. Scripts and logs are in reviews/validation-1469/.

Check Result
test/scripts/ at 13fd77a 415 passed
New tests with scripts/bump_version.py and scripts/release_commit.py reverted to the base 2f7c19dc 26 failed, 41 passed (tests-reverted.log)
Dry release from main's tree: 7 fragments (all 6 types, 99 and 1402 both Fixed, one with bold, code and a link), real uv lock, then release_commit.py to a local bare repo Bump 2.5.4 -> 2.5.5. Release commit has the 4 version files plus 7 fragment deletions. Commit and tag pushed together (dry_release.log)
Lines before and after that bump (check_lines.py) No line dropped or doubled. Added: the version heading, ### Deprecated, ### Removed, the 7 fragment lines. Gone: one ### Changed, because the two ### Changed blocks on main are merged into one (as the PR body says). 99 is listed before 1402. A fragment that cites its own number gets no second (#N)
Rule 4a: start from the latest release tag v2.5.5 git diff --stat v2.5.5 origin/main -- CHANGELOG.md is empty, so the run above is the first release from the released changelog
No fragments Same bytes as before the PR, apart from the new headings
Bad names: 7.fixed.md, fix-typo.Fixed.md, 07.Fixed.md, .gitkeep, a folder, two bullets, a wrapped bullet Each refused with ChangelogError before any file changes
Bump with no uv on PATH Fails with FileNotFoundError. git status is clean after it: version files, changelog and fragments all restored. A re-run with uv then works
Docs CONTRIBUTING.md, changelog.d/README.md and docs/RELEASING.md match what the code does. No file still mentions cliff.toml or git-cliff
  • Not checked: release_preflight.py against GitHub (it needs the API; the PR only edits its docstring), assert_release_version.py against the indexes, the real release.yml run, and the full suite (CI ran it).
  • Not this PR, but it affects the next release: main's pyproject.toml says 2.5.4, while the tag v2.5.5 and its GitHub Release already exist. A patch bump from main makes 2.5.5 again, as my dry run did.

CI is green at 13fd77a (all 29 checks pass).

Re-check at 378a5fa

Item At 378a5fa How I checked
P2-1: nothing checks the repo's fragments Fixed test_repository_fragments_are_valid runs read_fragments() and promoted_changelog() on the real tree. With my wrapped-bullet changelog.d/1470.Fixed.md added, test/scripts/ gives FAILED test_repository_fragments_are_valid (1 failed, 429 passed). Without it: 430 passed. CI's unit job runs pytest test/, so this test runs on every PR.
P3-3: the PR's own fragment uses the issue number Fixed Renamed to changelog.d/1469.Changed.md.
P3-1: headings and link references found line by line Open Not changed. Optional.
P3-2: one line per fragment vs the house style Open Not changed. Optional.

The cao-provider skill copies now point to a fragment instead of CHANGELOG.md, and a new test pins the fragment name rule in both scripts. That covers @haofeif's skill and number-rule P3s.

Vote: ✅ score 2 (P3-1 and P3-2, both optional follow-ups).

Suggest approval at 378a5fa: CI is all green (29 pass). @haofeif's change request stays theirs to clear.

independently reviewed by Kiro Crew

@haofeif haofeif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review at 13fd77a: Request changes (0 P1, 1 P2, 3 P3)

Thank you, @fanhongy. This PR moves notable changes out of the shared [Unreleased] section. A PR adds changelog.d/<PR>.<type>.md with one bullet. The release bump merges the fragments into the promoted section and deletes them, and release_commit.py commits the deletions with the version files. The PR also deletes the unused cliff.toml and documents the format. This follows the Q3 plan in #1350 (comment 7061530440). That plan uses fragments with no new tool, collected by scripts/bump_version.py, and keeps the release notes that GitHub generates. The plan also asks for a CI check that a PR which changes src/ has a fragment or a no-changelog label. The PR body defers that check.

The release path works. With no fragments, the bump gives the same bytes as before. I found 1 P2. Nothing checks the fragments in the repo before a release, so a bad fragment merges with green CI and then stops each release run. The fix is a 3-line test. The 3 P3s are a number rule that the PR's own fragment breaks, a skill that still says to edit CHANGELOG.md, and 3 rules with no test that fails when they break. I also give 1 trade-off about one-line fragments.

  • The PR is based on main at 2f7c19d. main is now at 6234f1f, 5 commits ahead (#1452, #1454, #1419, the v2.5.5 release #1467 and the agent-plugin repin). Those commits change none of the files of this PR. A test merge has no conflicts, and test/scripts/ gives 415 passed on it.
  • All 29 checks pass at 13fd77a.
  • The Kiro Crew review (comment 7117958714) is at the same head (vote Hold, score 6). I agree with its P2-1. My verdict on each of its claims is below. There are no other reviews and no inline comments.

Findings

P2-1: A bad fragment merges with green CI, then stops each release run (scripts/bump_version.py:149-181, :277)

  • Source: this PR. Kiro P2-1 reports the same gap.

  • Problem: read_fragments() checks each file in changelog.d/. The name must be <number>.<Type>.md, with 1 of the 6 types in the exact case. No other file is allowed except README.md. The text must be UTF-8 with no BOM, and it must be 1 line that starts with - . The release job is the only place that runs these checks on the real folder (main() at :277, run by .github/workflows/release.yml:116). Each PR test points ROOT at a temp folder (test/scripts/test_bump_version.py:121, and the tree fixture at :47-62) or uses a temp clone. In test/, .github/ and Makefile, git grep finds changelog.d only in the 2 changed test files.

  • Impact: The first check of a new fragment happens in the release job, after the preflight job passed. The release runs each Monday on a schedule (release.yml:25) or on a manual dispatch. Each run that passes the preflight then fails at "Bump version and promote the changelog" until a fix PR lands. Nothing is pushed, so the failure is safe, but no release ships in that time. A wrapped bullet is the most likely error, because 196 of the 217 entries in [Unreleased] today use more than 1 line. A lowercase type is another.

  • Evidence: I added 2 bad fragments to the PR tree, 1470.fixed.md and 1471.Fixed.md (a bullet on 2 lines). test/scripts/ still gave 415 passed. read_fragments() then raised ChangelogError for each file.

  • Fix: Add a test with no fixture, so that it reads the real changelog.d/. ROOT is the repo root (scripts/bump_version.py:22), and the test module loads bv at import (test/scripts/test_bump_version.py:40).

    def test_repository_fragments_are_valid():
        bv.read_fragments()
        bv.promoted_changelog("0.0.0")

    The second line also runs the merge on the real CHANGELOG.md, so it checks that the file has exactly 1 ## [Unreleased] heading (scripts/bump_version.py:189-193). I ran this test. It passes at this head, and it fails with ChangelogError when I add the wrapped fragment. This check is smaller than the "fragment or no-changelog label" check that the PR body defers. It checks only the fragments that exist.

P3-1: The PR's own fragment uses an issue number, but the rule asks for a PR number (changelog.d/1350.Changed.md)

  • Source: this PR. Kiro P3-3 reports the same.
  • Problem: changelog.d/README.md:3-4 and CONTRIBUTING.md:45 say that <PR> is the pull request number. #1350 is an issue, and this PR is #1469. The 2 examples (changelog.d/README.md:9, CONTRIBUTING.md:47) also use 1350. The bump adds (#<number>) when the entry does not cite its number (scripts/bump_version.py:212-213), so this entry will end with (#1350). GitHub links that to the issue, so the cost is small. But the first fragment breaks its own rule, and the next contributors will copy it.
  • Fix: Rename the file to changelog.d/1469.Changed.md, and use a PR number in the 2 examples. Or, if an issue number is also acceptable, say so in both files. A contributor knows the PR number only after the PR is open, so an issue number is easier to use.

P3-2: The cao-provider skill still says to edit CHANGELOG.md (skills/cao-provider/SKILL.md:161, :178)

  • Source: this PR. It changes the contributor rule, but not this skill.
  • Problem: CONTRIBUTING.md:51 now says "you do not need to edit CHANGELOG.md in your pull request". The skill says "Update README.md provider table and CHANGELOG.md." (:161), and its checklist has a CHANGELOG.md item for the new provider (:178). The packaged copy agent-plugin/cao-contributor/skills/cao-provider/SKILL.md has the same 2 lines. Hand-written notes still work, so nothing breaks. But an agent that follows the skill still edits the shared section, where PRs conflict.
  • Fix: Point both lines to a changelog.d/<PR>.Added.md fragment. Then run uv run python scripts/sync_skills.py to update the packaged copy (skills/cao-contributing/SKILL.md:260).

P3-3: 3 rules have no test that fails when they break

  • Source: this PR.
  • (a) The restore of a deleted fragment. main() deletes the fragments in iterdir() order (scripts/bump_version.py:155, :287-288). The 2 tests for a failed delete make the delete of 4.Fixed.md fail (test/scripts/test_bump_version.py:598, and :631-632 with delete). Their helpers are named fail_second_unlink and fail_second_fragment, so they expect it to be the second delete. On my ext4 disk, iterdir() gives 4.Fixed.md first. Thus the failure comes at the first delete, no fragment is gone yet, and the restore at :301-306 has nothing to do. With the restore removed (B11), all tests pass. The order depends on the file system, so I cannot say which path CI takes.
    • Fix: Read the folder in sorted order, sorted(directory.iterdir()). Then the delete order is the same on each machine. With this change, all 43 tests in the file pass, and B11 fails 2 of them. Another fix is to make the tests fail the second unlink call, whatever its name. I ran such a test. It passes at this head and fails with B11.
  • (b) The number rule [1-9][0-9]*. No test uses 0.Fixed.md or 07.Fixed.md. With [0-9]+ (B13), all tests pass. scripts/release_commit.py:46-48 has a second copy of this rule. If the 2 copies drift apart, the bump can delete a fragment that the commit step then refuses, and the release stops after the bump. B13 is such a drift. With it, the bump accepts and deletes 0.Fixed.md, and then release_commit.py refuses that deletion (:93-102).
    • Fix: Add 0.Fixed.md and 07.Fixed.md to test_invalid_name_or_type_refuses_without_changes (test/scripts/test_bump_version.py:497-498). Add 1 test that gives the same names to both patterns and expects the same result.
  • (c) The order of the type headings. The all-types test takes its expected order and text from bv.FRAGMENT_TYPES (test/scripts/test_bump_version.py:412-415, :425-432). Its only literal order checks are Added before Changed and Security last (:423-424). With Fixed before Removed in the constant (B5), all tests pass.
    • Fix: Write the Keep a Changelog order as a literal tuple in the test.

Trade-off (no severity)

One line for each fragment (Kiro P3-2). Today, 196 of the 217 entries in [Unreleased] use more than 1 line. A fragment must be 1 line (scripts/bump_version.py:175-180).

  • Option A: keep the rule. The parser stays simple. Long one-line entries are already in the file (CHANGELOG.md:736 has 1,590 characters), and Markdown shows them the same as wrapped ones. But authors who prefer to wrap may keep editing CHANGELOG.md, and those PRs can still conflict.
  • Option B: accept more lines that start with 2 spaces. Authors can keep the wrapped style. The parser must then handle the extra lines, and the (#N) must go at the end of the last line.

Claims

Claim (PR body) Verdict Evidence
PRs that edit [Unreleased] collide Agreed This is the problem that #1350 records.
Fragments are collected in Keep a Changelog type order and numeric PR order, and merged into the matching hand-written subsections True promoted_changelog sorts each type by number (scripts/bump_version.py:234) and adds the fragments to the hand-written block of the same type. My run on the real file agrees (Evidence). B4 and B14 each fail a test.
Fragments are validated before any release file changes True read_fragments() and promoted_changelog() run at :277-278, before the try at :282.
The changelog is replaced atomically True _write_changelog writes a temp file in the same folder, then calls os.replace (:251-261).
The changelog, fragments and version carriers are restored if a release step fails True The restore is at :289-310. The test for a deleted fragment depends on the folder order (P3-3a).
Only deletions of valid fragment files are staged with the release commit True scripts/release_commit.py:93-105. git add -A gets only the deletion paths (:105). R3, R4, R5 and R6 each fail a test.
The changelog and the fragment cleanup land together in the atomic push True test_real_bump_and_release_commit_push_fragment_deletion (test/scripts/test_release_commit.py:187) pushes both to a bare remote.
The fragment format is documented True CONTRIBUTING.md:43-51, changelog.d/README.md and docs/RELEASING.md:144-150. The cao-provider skill is not updated (P3-2).
cliff.toml is unused True At the base, only the docstring at scripts/release_preflight.py:22 named cliff.toml. No script or workflow read it.
The release notes that GitHub generates are kept True The PR does not change release.yml, and :151 still sets generate_release_notes: true.
Add a file such as changelog.d/1350.Changed.md with 1 - entry and 1 of the 6 types The types are correct. The number breaks the stated rule The types match FRAGMENT_NAME (scripts/bump_version.py:32). #1350 is an issue (P3-1).
The real release bump is tested with each type, more than 1 PR number, hand-written notes and a second bump True test/scripts/test_bump_version.py:396-438 runs main() with a fake uv and a short changelog that the test writes. My run covers the real file.
Invalid names, types and entries, write failures and partial deletion have byte-for-byte rollback tests Partly true Each case has a test. But the partial-deletion tests can fail at the first delete (P3-3a), and no test uses 0.Fixed.md or 07.Fixed.md (P3-3b).
Full suite: 29,744 passed, 93.59% coverage, and lint and the mypy ratchet pass Not compared All 29 CI checks pass at this head. Unit Tests (3.12) gives 30,042 passed.
Duplicate type headings merge, and other headings go after the Keep a Changelog types True See the run on the real file. B6 fails a test.
The fragment-or-label CI check and the stale release workflow comment follow separately Not in this PR The comment at release.yml:138-141 still says that the script "refuses a commit carrying anything but the version files". A later fix is fine.
Claim (Kiro Crew) Verdict Evidence
The release path works. A dry release with 7 fragments merged them in order, deleted them, and pushed the commit and the tag to a bare repo True My run on the real file and the end-to-end test agree. I did not run uv lock against the network.
Before and after the bump, no line is dropped or doubled, and only 1 ### Changed is gone True My run on the real file gives the same lines.
git-cliff is not used, so deleting cliff.toml is safe True See the PR body table.
P2-1: nothing checks the fragments in the repo before the release True My P2-1. My git grep gives the same result.
P3-1: a link reference in the middle of [Unreleased], a heading with a trailing space, and a heading in a fenced block each change the section True, but none is in the file today I made all 3. The first 2 give 2 ### Fixed headings. The third adds blank lines in the fence and puts the fragment after the fence. Today's [Unreleased] has no fence, no link reference and no heading with a trailing space.
P3-2: 196 of 217 entries use more than 1 line True My count is the same. See the trade-off.
P3-3: the PR's own fragment uses the issue number True My P3-1.
The new tests with the base scripts: 26 failed, 41 passed True I got the same result.
Rule 4a: CHANGELOG.md is the same at v2.5.5 and on main True The tag v2.5.5 points at d094b4b, and git diff d094b4b 6234f1f -- CHANGELOG.md is empty.
With no fragments, the output is the same as before the PR True The head and the base give the same bytes for the real file.
Bad names, a folder, 2 bullets and a wrapped bullet are each refused before any change True The checks are at scripts/bump_version.py:155-180, before any write. I ran a lowercase type and a wrapped bullet. The PR tests cover 3 bad names, a folder and 2 bullets. A wrapped bullet fails the same 1-line check. No PR test uses 0.Fixed.md or 07.Fixed.md (P3-3b).
With no uv on PATH, each file is restored True This is the missing-uv case of test_every_snapshotted_file_is_restored_on_any_exception (test/scripts/test_bump_version.py:337, :343).
The docs match the code, and no file names cliff.toml or git-cliff Partly true The 3 changed docs match the code. 2 old CHANGELOG.md entries (:980, :2715) and the test that checks that release.yml has no git-cliff (test/scripts/test_bump_version.py:183-185) still name the tool. These are correct. But the cao-provider skill still says to edit CHANGELOG.md (P3-2).
main's pyproject.toml says 2.5.4, but v2.5.5 exists No longer true #1467 (d094b4b) set 2.5.5 on main, and the tag v2.5.5 now points at d094b4b.
CI is green, 29 checks True All 29 pass at 13fd77a.

Evidence

  • CI: 29 check runs at 13fd77a, all success. Unit Tests (3.12) is job 138094767703 with 30,042 passed. Unit Tests (3.11) is job 138094767531 with 30,040 passed.

  • Tests: The 2 changed test files give 67 passed at this head. With scripts/bump_version.py and scripts/release_commit.py from the base, they give 26 failed and 41 passed.

  • Real changelog: I copied CHANGELOG.md (the same at this head and on main) to a temp folder. Then I ran promoted_changelog("2.5.6") with 7 fragments, 1 for each type except Fixed, which has 2 (99, whose entry cites #99, and 1402). I compared the non-blank lines before and after.

    • The new lines are the version heading, ### Deprecated, ### Removed and the 7 fragment lines. 99 comes before 1402, and the 99 entry gets no second (#99).
    • The only removed line is 1 ### Changed heading. The second Changed block (58 lines) moves to the end of the first one.
    • The headings in the new section are in the order Added, Changed, Deprecated, Removed, Fixed and Security. The text before [Unreleased] and the text from ## [2.5.0] on do not change. There is no run of 2 blank lines.
    • With no fragments, the head and the base promoted_changelog give the same bytes.
  • Mutants: I made 26 small changes, one at a time, and ran the 2 changed test files for each. 22 of them fail at least 1 test. B5, B11 and B13 pass all tests (P3-3). B19 also passes, but it does not change the result.

    Mutant Change Result
    B1 The [Unreleased] section runs to the end of the file Fails 3 tests
    B2 No split of link references Fails 1 test
    B3 #N match with no digit bounds Fails 1 test
    B4 Numbers sorted as text Fails 1 test
    B5 Fixed before Removed in FRAGMENT_TYPES All pass
    B6 Other headings go first Fails 1 test
    B7 A symlink is accepted Fails 1 test
    B8 A BOM is accepted Fails 1 test
    B9 More than 1 line is accepted Fails 1 test
    B10 Fragments are not deleted Fails 4 tests
    B11 A deleted fragment is not restored All pass
    B12 Notes before the first heading are dropped Fails 1 test
    B13 Number rule [0-9]+ All pass
    B14 A hand-written type block with no fragment is dropped Fails 1 test
    B15 CHANGELOG.md is not restored Fails 2 tests
    B16 Blank line between fragment entries Fails 1 test
    B17 Suffix #N in place of (#N) Fails 4 tests
    B18 README.md is not skipped Fails 1 test
    B19 Fragments deleted before the changelog write All pass. On an error, the rollback restores both, so the result is the same
    R1 The second path of a rename is not skipped Fails 1 test
    R2 Each untracked file is skipped Fails 2 tests
    R3 Any deleted path is accepted Fails 3 tests
    R4 Deletions are not staged Fails 1 test
    R5 Only unstaged deletions are accepted Fails 1 test
    R6 Any deleted .md file under changelog.d/ is accepted Fails 2 tests
    R7 --untracked-files=no Fails 2 tests
  • Merge: A test merge with main at 6234f1f has no conflicts, and test/scripts/ gives 415 passed on it.

  • Not this PR: CHANGELOG.md has no section for 2.5.1 to 2.5.5. [Unreleased] (:8-2075) comes directly before ## [2.5.0] (:2076). The message of d094b4b (#1467) says "CHANGELOG.md is not promoted, matching #899 and #946". So the next bump puts the notes for 2.5.1 to 2.5.5 under the new version, with or without this PR.

Not checked

  • A real release.yml run, uv lock against the network, and the publish.
  • release_preflight.py. The PR changes only its docstring.
  • The full suite on my machine. CI ran it.
  • The Kiro scripts in reviews/validation-1469/. They are not in the PR.

fanhongy and others added 3 commits November 24, 2026 08:14
…ent rules

- Validate real repository fragments and the changelog merge before release.
- Use the pull request number in the fragment and examples.
- Sync the provider skill's fragment instructions into shipped packages.
- Make deletion deterministic and test second-delete rollback.
- Pin the number rules, pattern parity, and changelog heading order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Catch up with main after the changelog fragment review fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fanhongy

Copy link
Copy Markdown
Collaborator Author

Thank you for the careful review. I addressed the requested changes and would appreciate another look.

  • P2-1: A fixture-free test now checks the real changelog.d/ and runs promoted_changelog("0.0.0"). A wrapped entry and a lowercase type each fail that test with ChangelogError in isolated copies.
  • P3-1: The fragment is now changelog.d/1469.Changed.md, and both contributor examples use PR feat(release): collect CHANGELOG fragments at release (#1350) #1469.
  • P3-2: The provider skill now asks for a one-line changelog.d/<PR>.Added.md fragment, including its checklist. The shipped and plugin copies are synchronized.
  • P3-3(a): Collection order is deterministic, and both rollback tests fail on the second fragment deletion regardless of filesystem order. Removing the restore fails two tests.
  • P3-3(b): Invalid zero and leading-zero numbers are tested; a parity test checks valid and invalid filenames against both release-stage patterns. The shared rule could be one constant without a large refactor, but I left the two scripts unchanged apart from ordering.
  • P3-3(c): The all-types test pins the Keep a Changelog order literally; swapping Fixed and Removed fails it.
  • Trade-off: I kept option A. One-line fragments keep the parser small and the merge exact; long one-line entries already exist, and authors accustomed to wrapped prose can still write a long line.

The stale comment in .github/workflows/release.yml is outside this PR's changes and will follow separately.

Fix commit: 05cb840d652fb8e49fb0833f681f70e389941b4a.
Main catch-up merge commit: ac3bae5a62819a2393663e4cb31eed8f46371f0d.
Black style follow-up commit: 378a5fa231268699d7a2508a0a149c7d6cefc3a6.
Checks at ac3bae5a62819a2393663e4cb31eed8f46371f0d: the related tests pass (430), and the full CI-shaped Python 3.12 suite passes (30,048 passed, 161 skipped, 8 xfailed, 93.62% coverage). Skill sync, plugin package and link checks, and the mypy ratchet pass. At the style follow-up head, Black, isort, Ruff, and the focused release tests (82) pass.

Could you please take another look?

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants