Repository navigation
Conversation
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>
|
Review at The release path works. I ran a full dry release from P2P2-1. Nothing checks the fragments in the repo before the release runs.
P3P3-1. Headings and link references are found line by line, so some valid Markdown gets reshaped.
P3-2. One line per fragment does not fit how entries are written here.
P3-3. The PR's own fragment uses the issue number, not the PR number.
Checked by runningAll runs used
CI is green at Re-check at
|
| 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
left a comment
There was a problem hiding this comment.
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
mainat2f7c19d.mainis now at6234f1f, 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, andtest/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 inchangelog.d/. The name must be<number>.<Type>.md, with 1 of the 6 types in the exact case. No other file is allowed exceptREADME.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 pointsROOTat a temp folder (test/scripts/test_bump_version.py:121, and thetreefixture at:47-62) or uses a temp clone. Intest/,.github/andMakefile,git grepfindschangelog.donly 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.mdand1471.Fixed.md(a bullet on 2 lines).test/scripts/still gave 415 passed.read_fragments()then raisedChangelogErrorfor each file. -
Fix: Add a test with no fixture, so that it reads the real
changelog.d/.ROOTis the repo root (scripts/bump_version.py:22), and the test module loadsbvat 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 withChangelogErrorwhen I add the wrapped fragment. This check is smaller than the "fragment orno-changeloglabel" 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-4andCONTRIBUTING.md:45say 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 use1350. 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:51now says "you do not need to editCHANGELOG.mdin your pull request". The skill says "UpdateREADME.mdprovider table andCHANGELOG.md." (:161), and its checklist has aCHANGELOG.mditem for the new provider (:178). The packaged copyagent-plugin/cao-contributor/skills/cao-provider/SKILL.mdhas 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.mdfragment. Then runuv run python scripts/sync_skills.pyto 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 initerdir()order (scripts/bump_version.py:155,:287-288). The 2 tests for a failed delete make the delete of4.Fixed.mdfail (test/scripts/test_bump_version.py:598, and:631-632withdelete). Their helpers are namedfail_second_unlinkandfail_second_fragment, so they expect it to be the second delete. On my ext4 disk,iterdir()gives4.Fixed.mdfirst. Thus the failure comes at the first delete, no fragment is gone yet, and the restore at:301-306has 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 secondunlinkcall, whatever its name. I ran such a test. It passes at this head and fails with B11.
- Fix: Read the folder in sorted order,
- (b) The number rule
[1-9][0-9]*. No test uses0.Fixed.mdor07.Fixed.md. With[0-9]+(B13), all tests pass.scripts/release_commit.py:46-48has 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 deletes0.Fixed.md, and thenrelease_commit.pyrefuses that deletion (:93-102).- Fix: Add
0.Fixed.mdand07.Fixed.mdtotest_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.
- Fix: Add
- (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 areAddedbeforeChangedandSecuritylast (:423-424). WithFixedbeforeRemovedin 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:736has 1,590 characters), and Markdown shows them the same as wrapped ones. But authors who prefer to wrap may keep editingCHANGELOG.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, allsuccess. 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.pyandscripts/release_commit.pyfrom the base, they give 26 failed and 41 passed. -
Real changelog: I copied
CHANGELOG.md(the same at this head and onmain) to a temp folder. Then I ranpromoted_changelog("2.5.6")with 7 fragments, 1 for each type exceptFixed, which has 2 (99, whose entry cites#99, and1402). I compared the non-blank lines before and after.- The new lines are the version heading,
### Deprecated,### Removedand the 7 fragment lines.99comes before1402, and the99entry gets no second(#99). - The only removed line is 1
### Changedheading. The secondChangedblock (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_changeloggive the same bytes.
- The new lines are the version heading,
-
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 fileFails 3 tests B2 No split of link references Fails 1 test B3 #Nmatch with no digit boundsFails 1 test B4 Numbers sorted as text Fails 1 test B5 FixedbeforeRemovedinFRAGMENT_TYPESAll 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.mdis not restoredFails 2 tests B16 Blank line between fragment entries Fails 1 test B17 Suffix #Nin place of(#N)Fails 4 tests B18 README.mdis not skippedFails 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 .mdfile underchangelog.d/is acceptedFails 2 tests R7 --untracked-files=noFails 2 tests -
Merge: A test merge with
mainat6234f1fhas no conflicts, andtest/scripts/gives 415 passed on it. -
Not this PR:
CHANGELOG.mdhas no section for 2.5.1 to 2.5.5.[Unreleased](:8-2075) comes directly before## [2.5.0](:2076). The message ofd094b4b(#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.ymlrun,uv lockagainst 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.
…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>
|
Thank you for the careful review. I addressed the requested changes and would appreciate another look.
The stale comment in Fix commit: Could you please take another look? |
Summary
changelog.d/<PR>.<type>.mdentries during the version bump, ordered by Keep a Changelog type and numeric pull request number, merging them into matching hand-written[Unreleased]subsections.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 aschangelog.d/1350.Changed.mdcontaining a single- Description of the change.entry instead of editing the shared changelog. Valid types areAdded,Changed,Deprecated,Removed,Fixed, andSecurity.Validation
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