Add automated changelog generation with git-cliff#248
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds git-cliff-based changelog generation and GitHub release categorization: new config files, CI workflow changes to generate RELEASE_NOTES.md and full CHANGELOG.md (and open a changelog PR), plus documentation updates describing the flow. Changes
Sequence DiagramsequenceDiagram
participant CI as GitHub Actions
participant GitCliff as git-cliff-action
participant GitHistory as Git History
participant API as GitHub Release API
participant Repo as Repository
CI->>GitHistory: fetch commits/tags
CI->>GitCliff: generate RELEASE_NOTES.md (cliff.toml)
GitCliff->>GitHistory: parse & group commits
GitCliff-->>CI: RELEASE_NOTES.md
CI->>API: create GitHub release (body_path=RELEASE_NOTES.md)
API-->>CI: release created
CI->>GitCliff: generate full CHANGELOG.md (all history)
GitCliff-->>CI: CHANGELOG.md
CI->>Repo: checkout origin/main, create branch changelog/<tag>
CI->>Repo: git add/commit CHANGELOG.md (if changed)
CI->>Repo: push branch
CI->>API: create PR (base: main, head: changelog/<tag>)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
1004-1014: Consider adding branch protection awareness for the changelog commit.The auto-commit to
mainwill fail silently if branch protection rules require PR reviews or status checks. This is likely intentional (the check for changes handles the no-op case), but worth noting.If branch protection is enabled on
main, you may need to:
- Use a GitHub App token with bypass permissions, or
- Configure the protection rules to allow the
github-actions[bot]to push directly🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 1004 - 1014, The "Commit changelog to main" workflow step can fail under branch protection; update the job to handle protected branches by either (A) using a token with push bypass (replace GITHUB_TOKEN with a GitHub App or PAT that has permission to bypass branch protections) or (B) change the behavior to create a changelog pull request instead of pushing directly (detect push failure and open a PR using the repo mutation via GH API). Ensure you reference the step name "Commit changelog to main" and the commit/push commands in that step when implementing the token change or PR fallback so the workflow no longer silently fails on protected main.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 1004-1014: The "Commit changelog to main" workflow step can fail
under branch protection; update the job to handle protected branches by either
(A) using a token with push bypass (replace GITHUB_TOKEN with a GitHub App or
PAT that has permission to bypass branch protections) or (B) change the behavior
to create a changelog pull request instead of pushing directly (detect push
failure and open a PR using the repo mutation via GH API). Ensure you reference
the step name "Commit changelog to main" and the commit/push commands in that
step when implementing the token change or PR fallback so the workflow no longer
silently fails on protected main.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cfef674f-38e5-4254-b6c9-7642867f6404
📒 Files selected for processing (6)
.github/release.yml.github/workflows/ci.ymlAGENTS.mdCHANGELOG.mdcliff.tomldocs/build-system.md
Suite Timing
Measured on ubuntu-latest x64. |
Benchmark Results274 benchmarks Interpreted: 🟢 139 improved · 🔴 25 regressed · 110 unchanged · avg +1.3% arraybuffer.js — Interp: 🟢 1, 🔴 7, 6 unch. · avg -0.7% · Bytecode: 🔴 14 · avg -7.8%
arrays.js — Interp: 🟢 13, 🔴 1, 5 unch. · avg +1.9% · Bytecode: 🟢 1, 🔴 18 · avg -4.0%
async-await.js — Interp: 🟢 4, 2 unch. · avg +1.3% · Bytecode: 🔴 6 · avg -5.4%
classes.js — Interp: 🟢 11, 20 unch. · avg +0.8% · Bytecode: 🔴 27, 4 unch. · avg -9.9%
closures.js — Interp: 🟢 4, 🔴 2, 5 unch. · avg +0.5% · Bytecode: 🔴 10, 1 unch. · avg -6.8%
collections.js — Interp: 🟢 7, 🔴 2, 3 unch. · avg +1.3% · Bytecode: 🟢 2, 🔴 7, 3 unch. · avg -3.0%
destructuring.js — Interp: 🟢 13, 🔴 2, 7 unch. · avg +1.3% · Bytecode: 🔴 22 · avg -9.4%
fibonacci.js — Interp: 🟢 6, 2 unch. · avg +1.5% · Bytecode: 🔴 6, 2 unch. · avg -7.9%
for-of.js — Interp: 🟢 4, 3 unch. · avg +2.2% · Bytecode: 🔴 6, 1 unch. · avg -3.7%
helpers/bench-module.js — Interp: 0 · Bytecode: 0
iterators.js — Interp: 🟢 7, 13 unch. · avg +1.4% · Bytecode: 🟢 1, 🔴 19 · avg -8.5%
json.js — Interp: 🟢 15, 5 unch. · avg +2.6% · Bytecode: 🟢 1, 🔴 12, 7 unch. · avg -3.3%
jsx.jsx — Interp: 🟢 7, 🔴 2, 12 unch. · avg +0.8% · Bytecode: 🔴 19, 2 unch. · avg -4.2%
modules.js — Interp: 🟢 4, 5 unch. · avg +1.6% · Bytecode: 🔴 9 · avg -4.6%
numbers.js — Interp: 🟢 7, 🔴 1, 3 unch. · avg +1.7% · Bytecode: 🟢 1, 🔴 10 · avg -9.5%
objects.js — Interp: 🟢 6, 🔴 1 · avg +3.6% · Bytecode: 🟢 1, 🔴 3, 3 unch. · avg -1.1%
promises.js — Interp: 🟢 10, 2 unch. · avg +2.7% · Bytecode: 🔴 10, 2 unch. · avg -4.3%
regexp.js — Interp: 🟢 7, 🔴 1, 3 unch. · avg +1.2% · Bytecode: 🔴 10, 1 unch. · avg -4.4%
strings.js — Interp: 🟢 7, 4 unch. · avg +1.7% · Bytecode: 🟢 1, 🔴 7, 3 unch. · avg -1.3%
typed-arrays.js — Interp: 🟢 6, 🔴 6, 10 unch. · avg +0.0% · Bytecode: 🔴 21, 1 unch. · avg -10.7%
Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 1004-1026: The workflow step "Open changelog PR" fails because the
workflow permissions lack pull-requests: write (gh pr create needs it) and the
step isn't idempotent; update the workflow top-level permissions to include
pull-requests: write in addition to contents: write, make branch creation
resilient by checking for or force-creating the branch instead of using a
brittle git checkout -b (replace with an idempotent flow around git
rev-parse/checkout or git checkout -B targeting BRANCH), and before calling gh
pr create, check for an existing PR for branch "$BRANCH" (e.g., use gh pr view
or list to detect an existing PR) and skip creation if one exists to avoid
403/failure from duplicate PRs.
In `@docs/build-system.md`:
- Around line 304-343: The verb-prefix table in the docs/build-system.md is
incomplete compared to the actual patterns in cliff.toml; either expand the
table rows for the categories (Added, Fixed, Improved, Performance, Internal) to
include the extra prefixes mentioned in the review (e.g., "Ignore leading
shebang", "Normalize", "Preserve", "Merge GocciaScript metadata",
"Pre-materialize", "Mark .* inline", "Fold Souffle", etc.) or add a single
clarifying sentence under the table stating it shows common examples and point
readers to cliff.toml for the authoritative, complete list; update the table or
note and ensure the doc references cliff.toml as the source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7b2e214e-8fdc-4ce8-83a8-0736631fa96a
📒 Files selected for processing (2)
.github/workflows/ci.ymldocs/build-system.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
cliff.tomlconfiguration for git-cliff changelog generation from git history, using verb-prefix commit parsing (no conventional commits required).github/release.ymlto categorize GitHub auto-generated release notes by PR labels (new feature,bug,performance,spec compliance,documentation,internal)orhun/git-cliff-actionand auto-commitCHANGELOG.mdback tomainafter each tagged releaseCHANGELOG.mdcovering all releases (0.1.0through0.6.0) plus unreleased changesdocs/build-system.mdandAGENTS.mdTest plan
git-cliff -o CHANGELOG.mdproduces correct output locally.github/release.ymlcategories render correctly on a future GitHub releaseorhun/git-cliff-actionstep runs successfully on a tagged releaseCHANGELOG.mdtomainafter release creation🤖 Generated with Claude Code