You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address remaining PR #982 review comments on update-changelog
- Fix tag reconciliation to check all changelog headers, not just the top
one, avoiding false backfill when a draft header exists above the latest
tag (addresses P1 comment r2938063401)
- Extend prerelease collapsing to trigger for explicit prerelease versions
- Add commit message format to auto-commit step
- Simplify Step 3 tag-ahead check as a verification of Step 2
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy file name to clipboardExpand all lines: .claude/commands/update-changelog.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,10 +202,10 @@ When a new version is released:
202
202
203
203
1. Get the latest git tag: `git tag -l 'v*' --sort=-v:refname | head -5`
204
204
2. Get the most recent version header in CHANGELOG.md (the first `## [vVERSION]` after `## [Unreleased]`)
205
-
3.**Compare them.** If the latest git tag does NOT match the latest changelog version header, there are tagged releases missing from the changelog. For example:
206
-
- Latest tag: `v9.6.0-rc.4`
207
-
- Latest changelog version: `## [v9.6.0-rc.3]`
205
+
3.**Compare them.** If the latest git tag does NOT appear anywhere in the changelog version headers, there are tagged releases missing from the changelog. **Important**: Don't just compare against the _top_ changelog header — a version header may exist _above_ the latest tag if it was stamped as a draft before tagging. Check whether the tag's version appears in _any_`## [vX.Y.Z]` header. For example:
206
+
- Latest tag: `v9.6.0-rc.4`, and no `## [v9.6.0-rc.4]` header exists anywhere in CHANGELOG.md
208
207
-**Result: `v9.6.0-rc.4` is missing and needs its own section**
208
+
- But if `## [v9.7.0-rc.0]` is the top header (a draft, not yet tagged) and `## [v9.6.0-rc.4]` exists below it, then nothing is missing — the top header is simply a pre-release draft
209
209
210
210
4. For EACH missing tagged version (there may be multiple):
211
211
a. Find commits in that tag vs the previous tag: `git log --oneline PREV_TAG..MISSING_TAG`
@@ -222,10 +222,9 @@ When a new version is released:
222
222
223
223
1. Run `git log --oneline LATEST_TAG..origin/main` to find commits after the latest tag (LATEST_TAG is the most recent git tag, i.e., the same one identified in Step 2)
224
224
2.**Extract ALL PR numbers** from commit messages: `git log --oneline LATEST_TAG..origin/main | grep -oE "#[0-9]+" | sort -u`
225
-
3. Also check `git log --oneline origin/main..LATEST_TAG` to see if the tag is ahead of origin/main
226
-
4. If the tag is ahead, entries in "Unreleased" section may actually belong to that tagged version
227
-
5. For each PR number, check if it's already in CHANGELOG.md: `grep "PR #XXX" CHANGELOG.md`
228
-
6. For PRs not yet in the changelog:
225
+
3. If Step 2 found no missing tagged versions, verify no tag is ahead of main: `git log --oneline origin/main..LATEST_TAG` should be empty. If not, entries in "Unreleased" may belong to that tagged version — Step 2 should have caught this, so re-check.
226
+
4. For each PR number, check if it's already in CHANGELOG.md: `grep "PR #XXX" CHANGELOG.md`
227
+
5. For PRs not yet in the changelog:
229
228
- Get PR details: `gh pr view NUMBER --json title,body,author --repo shakacode/shakapacker`
230
229
-**Never ask the user for PR details** — get them from git history or the GitHub API
231
230
- Validate that the change is user-visible (per the criteria above). Skip CI, lint, refactoring, test-only changes.
@@ -237,7 +236,7 @@ If the user passed `release`, `rc`, `beta`, or an explicit version string as an
237
236
238
237
1. Auto-compute the next version (see "Auto-Computing the Next Version" above), or use the explicit version provided
239
238
2. Insert the version header immediately after `## [Unreleased]`
240
-
3. For `rc`/`beta`: collapse prior prerelease sections of the same base version into the new section
239
+
3. For `rc`/`beta` or an explicit prerelease version (e.g., `9.7.0-rc.10`): collapse prior prerelease sections of the same base version into the new section
241
240
4. Update version diff links at the bottom of the file
242
241
5.**Verify** the computed version looks correct
243
242
@@ -269,7 +268,7 @@ If no argument was passed, skip this step — entries stay in `## [Unreleased]`.
269
268
- Verify the working tree only has `CHANGELOG.md` changes; if there are other uncommitted changes, warn the user and stop
270
269
- Verify the current branch is `main` (`git branch --show-current`); if not, warn the user and stop
271
270
- Create a feature branch (e.g., `changelog-v9.6.0-rc.1`)
272
-
- Stage only `CHANGELOG.md` (`git add CHANGELOG.md`) and commit
271
+
- Stage only `CHANGELOG.md` (`git add CHANGELOG.md`) and commit with message `Update CHANGELOG.md for vX.Y.Z` (using the stamped version)
273
272
- Push and open a PR with the changelog diff as the body
274
273
- If the push or PR creation fails, the CHANGELOG is already stamped locally — fix the issue and retry manually
275
274
- Remind the user to run `bundle exec rake create_release` (no args) after merge to publish and auto-create the GitHub release
0 commit comments