Skip to content

Verify the changelog in the same mode that generates it - #31

Merged
unbraind merged 2 commits into
mainfrom
converge-changelog-on-replace-mode
Aug 9, 2026
Merged

unbraind merged 2 commits into
mainfrom
converge-changelog-on-replace-mode

Conversation

@unbraind

@unbraind unbraind commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

What this fixes

The daily release generated CHANGELOG.md with --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:

  • Ordering — replace mode with --all-release-tags assigns items carrying an explicit release: field to that release window and hoists them; prepend mode orders purely by completion timestamp.
  • Selection — replace mode emits an ## Unreleased section for closed-but-unreleased work, which prepend mode with --until-release-tag structurally 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:check now delegates to npm run changelog:full -- --check, so the gate verifies the exact rendering that produces the artifact and the two cannot drift apart.
  • .github/workflows/release.yml generates and checks CHANGELOG.md with --mode replace --all-release-tags, keeping every other flag unchanged.
  • The release-notes --stdout line is deliberately left windowed (--since-previous-tag --until-release-tag) — notes are scoped to the new release by design.
  • CHANGELOG.md regenerated after closing the item.

Verification

  • npm run changelog:check passes with a clean working tree.
  • Build, typecheck and the full test suite pass.

pm item

Summary by Sourcery

Align changelog generation and verification so CI checks the same rendering used for release artifacts.

New Features:

  • Add pm item and history entries for issue pm-github-8f60.

Bug Fixes:

  • Ensure changelog verification in CI matches the replace-mode, all-release-tags generation to avoid unsatisfiable diffs.

Enhancements:

  • Update npm changelog:check script to delegate to the full replace-mode changelog command with check enabled.
  • Regenerate CHANGELOG.md to record the convergence of changelog generation and verification configuration.

CI:

  • Adjust release workflow to generate and validate CHANGELOG.md using replace mode across all release tags while keeping release notes scoped to the current window.

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:check now runs npm run changelog:full -- --check to verify the full replace-mode output.
    • Updated .github/workflows/release.yml to generate and check with --mode replace --all-release-tags; kept release notes windowed (--since-previous-tag --until-release-tag).
  • Refactors

    • Removed the unused prepend changelog script; changelog:full is now the single generator the gate verifies.

Written for commit 7983b4d. Summary will update on new commits.

Review in cubic

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Aligns 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 verification

sequenceDiagram
    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
Loading

File-Level Changes

Change Details Files
Align changelog verification with the full-generation path to prevent structural mismatches.
  • Change changelog:check npm script to delegate to changelog:full with the --check flag.
  • Ensure local and CI changelog verification use the same mode and tag selection options.
package.json
Update the release workflow to generate and verify CHANGELOG.md using replace mode over all release tags while keeping release notes windowed.
  • Switch pm-changelog invocations that write and check CHANGELOG.md from prepend mode with windowed tags to replace mode with all-release-tags.
  • Leave the pm-changelog invocation that writes RELEASE_NOTES.md using stdout with since-previous-tag and until-release-tag to keep notes scoped to the new release.
.github/workflows/release.yml
Record the pm item and document the convergence change in the changelog and pm history.
  • Add a Fixed entry describing convergence of changelog generation and verification on replace mode.
  • Create pm-github-8f60 issue and history records under .agents/pm.
CHANGELOG.md
.agents/pm/history/pm-github-8f60.jsonl
.agents/pm/issues/pm-github-8f60.toon

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 33e24725-7fdb-4d05-9180-bd6534ff9e3a

📥 Commits

Reviewing files that changed from the base of the PR and between a3a65ea and 7983b4d.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-github-8f60.jsonl
  • .agents/pm/issues/pm-github-8f60.toon
  • .github/workflows/release.yml
  • CHANGELOG.md
  • package.json

Summary by CodeRabbit

  • Bug Fixes
    • Improved changelog generation to consistently rebuild the complete changelog.
    • Added validation to ensure changelogs remain current and reproducible.
    • Updated release automation to generate and verify changelogs using all release tags.
  • Documentation
    • Added an Unreleased changelog entry describing the updated generation and verification process.

Walkthrough

The 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.

Changes

Changelog convergence

Layer / File(s) Summary
Align changelog commands and release workflow
package.json, .github/workflows/release.yml
changelog:check delegates to changelog:full -- --check. The release workflow replaces and validates CHANGELOG.md across all release tags.
Record the changelog behavior
CHANGELOG.md, .agents/pm/history/..., .agents/pm/issues/...
The changelog and project-management records document replace-mode generation, verification, and idempotent regeneration.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: aligning changelog verification with its generation mode.
Description check ✅ Passed The description directly explains the changelog generation mismatch, the workflow and script changes, and the verification results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch converge-changelog-on-replace-mode

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@unbraind

unbraind commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review
@greptileai

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

@unbraind I will perform a full review of PR #31.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 57 minutes.

@greptile-apps

greptile-apps Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR fixes a structurally unsatisfiable CI gate where changelog:check verified a prepend-mode rendering while the release workflow generated a replace-mode artifact — guaranteeing a diff that no regeneration could close.

  • package.json: changelog:check now delegates to npm run changelog:full -- --check, so the local gate and the generation script share a single source of truth (replace mode, --all-release-tags). The old standalone changelog (prepend) script is removed.
  • release.yml: Both the generate and verify npx pm-changelog lines are updated to --mode replace --all-release-tags; the release-notes --stdout line is deliberately left windowed to --since-previous-tag --until-release-tag.
  • CHANGELOG.md: Regenerated under the new replace-mode rendering to record this fix.

Confidence Score: 5/5

  • Safe to merge — this is a targeted alignment of two flags that were previously mismatched, with no logic changes to the underlying tooling.
  • All five changed files are consistent with the stated intent: the generate and check invocations now use the same mode in both the workflow and the local npm script, and the regenerated CHANGELOG.md reflects that. The release-notes path is deliberately preserved in windowed mode, which is correct by design.
  • No files require special attention.

Important Files Changed

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
Loading

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.
@unbraind

unbraind commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review
@greptileai

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

@unbraind I will perform a full review of PR #31.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 44 minutes.

@unbraind

unbraind commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review
@greptileai

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

@unbraind I will perform a full review of PR #31.

✅ Action performed

Full review finished.

@unbraind
unbraind merged commit c14ff2b into main Aug 9, 2026
7 checks passed
@unbraind
unbraind deleted the converge-changelog-on-replace-mode branch August 9, 2026 21:58
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.

1 participant