Verify the changelog in the same mode that generates it - #31
Conversation
The changelog:check script and the release workflow generated CHANGELOG.md in prepend mode (--since-previous-tag --until-release-tag) while changelog:full renders the whole file in replace mode (--all-release-tags). A repo that generates with one mode and verifies with the other has an unsatisfiable gate: the check reports the file as out of date, and regenerating cannot fix it because the two modes legitimately produce different files (replace renders an ## Unreleased section for landed-but-unreleased items; prepend does not). - package.json: changelog:check now runs `npm run changelog:full -- --check`, so generation and verification always use the same replace-mode render. - .github/workflows/release.yml: the CHANGELOG.md generate and check lines now use --mode replace --all-release-tags (keeping --release-version-from-package, --item-url-base, --respect-item-release, --pm-bin, --github-step-summary). The release-notes --stdout line is intentionally left windowed (--since-previous-tag --until-release-tag) because release notes cover only the new release. - changelog:full already used replace mode; the prepend `changelog` script is left in place for release notes. build, typecheck, and the full test suite pass; changelog:check passes against the regenerated CHANGELOG.md.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAligns changelog generation and verification so both use replace mode over all release tags, updates the npm script wiring and release workflow to prevent structural CI mismatches, and records the change in pm history and the changelog itself. Sequence diagram for aligned changelog generation and verificationsequenceDiagram
actor Dev
participant npm as npm_scripts
participant changelog_check as changelog_check
participant changelog_full as changelog_full
participant pm_changelog
Dev->>npm: npm run release:check
npm->>changelog_check: run changelog:check
changelog_check->>changelog_full: npm run changelog:full -- --check
changelog_full->>pm_changelog: pm-changelog --mode replace --all-release-tags --output CHANGELOG.md --check
pm_changelog-->>changelog_full: verify CHANGELOG.md
changelog_full-->>changelog_check: exit status
changelog_check-->>npm: changelog gate result
npm-->>Dev: release:check result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Summary by CodeRabbit
WalkthroughThe change aligns changelog checking and release generation with replace mode across all release tags. It records the completed work in the changelog and project-management history. ChangesChangelog convergence
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
|
|
Greptile SummaryThis PR fixes a structurally unsatisfiable CI gate where
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| package.json | Removes the old changelog (prepend-mode) script, updates changelog:check to delegate to changelog:full -- --check so that the local gate verifies the exact same replace-mode rendering used for the artifact. Clean change. |
| .github/workflows/release.yml | The two CHANGELOG.md lines (generate + check) are switched from --mode prepend --since-previous-tag --until-release-tag to --mode replace --all-release-tags, making them identical in mode. The release-notes --stdout line is intentionally kept windowed. No structural issues. |
| CHANGELOG.md | Regenerated with the new replace-mode rendering; the pm-github-8f60 fix entry is prepended under the current unreleased section. |
| .agents/pm/issues/pm-github-8f60.toon | New PM issue tracking this changelog alignment fix; closed and resolved. Informational only. |
| .agents/pm/history/pm-github-8f60.jsonl | Append-only JSONL audit trail for the PM issue lifecycle (create → note → close → update). No code logic. |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant CI as release.yml
participant Tool as pm-changelog
Note over Dev: Local pre-publish check
Dev->>Tool: "npm run changelog:check<br/>(→ changelog:full -- --check)"
Tool-->>Dev: replace mode, all-release-tags, --check ✓
Note over CI: Release workflow
CI->>Tool: "npx pm-changelog --mode replace<br/>--all-release-tags --github-step-summary"
Tool-->>CI: writes CHANGELOG.md
CI->>Tool: "npx pm-changelog --mode replace<br/>--all-release-tags --check"
Tool-->>CI: verifies CHANGELOG.md ✓
CI->>Tool: "npx pm-changelog --stdout<br/>--since-previous-tag --until-release-tag"
Tool-->>CI: writes RELEASE_NOTES.md (windowed) ✓
CI->>CI: "npm run release:check<br/>(includes changelog:check)"
Note over CI: Both CI gate and local check<br/>now use identical replace-mode rendering
Reviews (7): Last reviewed commit: "chore(scripts): drop the prepend changel..." | Re-trigger Greptile
Nothing referenced it. It rendered `--mode prepend --since-previous-tag --until-release-tag`, which cannot produce the `## Unreleased` section `changelog:check` now requires, so running it produced an artifact the gate rejects. Removing it leaves one generator, `changelog:full`, which is exactly what the check verifies.
|
@coderabbitai full review |
|
|
|
@coderabbitai full review |
|
✅ Action performedFull review finished. |
What this fixes
The daily release generated
CHANGELOG.mdwith--mode prepend --since-previous-tag --until-release-tag, while the CI gate verified it. The two renderings legitimately disagree, so the gate was structurally unsatisfiable rather than merely failing — no regeneration could ever close the diff.They differ in two ways:
--all-release-tagsassigns items carrying an explicitrelease:field to that release window and hoists them; prepend mode orders purely by completion timestamp.## Unreleasedsection for closed-but-unreleased work, which prepend mode with--until-release-tagstructurally cannot produce.This surfaced as a hard CI failure in pm-changelog (identical entries, reordered). A fleet sweep found the same latent mismatch in five repositories; this is pm-github's share.
Changes
changelog:checknow delegates tonpm run changelog:full -- --check, so the gate verifies the exact rendering that produces the artifact and the two cannot drift apart..github/workflows/release.ymlgenerates and checksCHANGELOG.mdwith--mode replace --all-release-tags, keeping every other flag unchanged.--stdoutline is deliberately left windowed (--since-previous-tag --until-release-tag) — notes are scoped to the new release by design.CHANGELOG.mdregenerated after closing the item.Verification
npm run changelog:checkpasses with a clean working tree.pm item
pm-github-8f60Summary by Sourcery
Align changelog generation and verification so CI checks the same rendering used for release artifacts.
New Features:
Bug Fixes:
Enhancements:
CI:
Summary by cubic
Aligns changelog generation and CI verification to the same replace-mode render, and removes the old prepend script. This makes CI check exactly what we ship and prevents unsatisfiable diffs.
Bug Fixes
changelog:checknow runsnpm run changelog:full -- --checkto verify the full replace-mode output..github/workflows/release.ymlto generate and check with--mode replace --all-release-tags; kept release notes windowed (--since-previous-tag --until-release-tag).Refactors
changelogscript;changelog:fullis now the single generator the gate verifies.Written for commit 7983b4d. Summary will update on new commits.