Add changelog update command and workflow for release PRs#746
Add changelog update command and workflow for release PRs#746SoWieMarkus wants to merge 6 commits intomainfrom
Conversation
|
Warning Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories. 📝 WalkthroughWalkthroughAdds a release orchestration command and supporting Claude subagents plus a CI workflow that, when invoked for a merged release PR, inspects commit diffs and Helm chart changes, generates a structured changelog entry, updates/creates CHANGELOG.md, opens a PR against main, and may bump chart versions across bundles. Changes
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant Repo as Repository
participant Claude as Claude/LiteLLM
participant Agent as Subagents (Changelog, PR-updater, Chart-bumper)
GH->>Repo: checkout code
GH->>Claude: invoke /on-release <PR>
Claude->>Repo: fetch PR metadata & commits
Claude->>Repo: git show diffs -> map files to charts/bundles
Claude->>Agent: dispatch Release PR Updater (with digest)
Claude->>Agent: dispatch Changelog Writer (with digest)
Claude->>Agent: dispatch Chart Bumper (with digest)
Agent->>Repo: update PR description / write CHANGELOG.md / bump charts
Repo->>GH: open resulting PR(s) against main
GH->>GH: stop LiteLLM proxy
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
.github/workflows/claude-on-release-merge.yaml (1)
21-24: Remove the Go setup — it is unused.The task is to edit
CHANGELOG.mdand open a PR; there's no Go compilation or tooling involved in theupdate-changelogcommand spec. Dropping this step saves ~15–30s of cold setup and a Go toolchain download on every release merge.♻️ Suggested change
- name: Checkout code uses: actions/checkout@v6 - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version-file: 'go.mod' - - uses: ./.github/actions/setup-claude-code-action🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/claude-on-release-merge.yaml around lines 21 - 24, Remove the unused Go setup step from the workflow: delete the step block that contains "name: Set up Go", "uses: actions/setup-go@v6" and the "go-version-file: 'go.mod'" input. Ensure no subsequent steps (e.g., the job that runs the update-changelog command) reference or require the Go toolchain so the workflow still runs correctly without that step..claude/commands/update-changelog.md (1)
20-20: Define idempotency and re-run behavior.Nothing here prevents a second invocation (e.g., workflow re-run, or a manual
/update-changelog N) from prepending a duplicate entry for the same PR. Recommend: before inserting, check whether an entry matching([#<NNN>](...pull/<NNN>))already exists inCHANGELOG.mdand, if so, either abort or replace in place. Also specify whether to no-op vs. update-PR if a prior changelog PR for the same release PR already exists.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/commands/update-changelog.md at line 20, Update the update-changelog flow to be idempotent by checking CHANGELOG.md for an existing entry for the same PR before prepending: search for the PR pattern using the regex /\(\[#\d+\]\(.*\/pull\/\d+\)\)/ (or the literal pattern `([#<NNN>](...pull/<NNN>))`) and if found either abort with a no-op or replace the existing entry in-place; also document the chosen behavior (no-op vs update-PR) in .claude/commands/update-changelog.md and ensure the workflow that handles `/update-changelog` or reruns will detect the prior changelog PR for the same release PR and update that PR instead of creating a duplicate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/commands/update-changelog.md:
- Around line 17-18: The current attribution heuristic that substring-matches
commit subjects for keywords like "postgres", "nova", "manila", "cinder",
"placement", "shim", "bundle" is ambiguous; change the rule in
update-changelog.md to attribute commits primarily from the set of changed
Chart.yaml files (use filenames of changed Chart.yaml to map to the
corresponding chart name), fall back to subject-keyword matching only when no
Chart.yaml was touched, and document explicit precedence for multi-match
subjects (e.g., prefer Chart.yaml-derived attribution > single keyword match >
multi-keyword resolve by highest-priority whitelist order or else route to `###
General`); keep the existing skip rules for commits containing "[skip ci]" or
pure version-bump messages and ensure the example text is updated to reflect
this new Chart.yaml-first behavior and the multi-match precedence policy.
- Line 12: Replace the ambiguous "YYYY-MM-DD" placeholder in the changelog entry
header (the line starting with "## YYYY-MM-DD — <PR title>") with a
deterministic date: use the release PR's merged_at timestamp converted to UTC
(formatted as YYYY-MM-DD) when generating the changelog, so the update-changelog
flow produces reproducible results even on reruns.
In @.github/workflows/claude-on-release-merge.yaml:
- Around line 9-16: Add a concurrency stanza to the changelog job to serialize
runs: inside the job named "changelog" (the job with if:
github.event.pull_request.merged == true) add a concurrency block with a stable
group name (e.g. group: 'changelog-${{ github.ref }}' or 'changelog-release')
and set cancel-in-progress: false so multiple merges do not race when checking
out main and updating the changelog; this ensures only one changelog job runs at
a time for the given branch.
- Around line 44-46: The workflow is using the default GITHUB_TOKEN which
prevents downstream workflow runs; replace it with a GitHub App installation
token or bot PAT and pass that token to the claude-code-action and any git/gh
commands invoked by the job (instead of github_token: ${{ secrets.GITHUB_TOKEN
}}), e.g. produce a token via an earlier step (steps.app-token.outputs.token)
and wire that output into the claude step and any bash gh/git pushes, and apply
the same change to other claude-* workflows (claude-assistant.yaml,
claude-weekly.yaml) so the changelog PRs trigger CI/status checks.
---
Nitpick comments:
In @.claude/commands/update-changelog.md:
- Line 20: Update the update-changelog flow to be idempotent by checking
CHANGELOG.md for an existing entry for the same PR before prepending: search for
the PR pattern using the regex /\(\[#\d+\]\(.*\/pull\/\d+\)\)/ (or the literal
pattern `([#<NNN>](...pull/<NNN>))`) and if found either abort with a no-op or
replace the existing entry in-place; also document the chosen behavior (no-op vs
update-PR) in .claude/commands/update-changelog.md and ensure the workflow that
handles `/update-changelog` or reruns will detect the prior changelog PR for the
same release PR and update that PR instead of creating a duplicate.
In @.github/workflows/claude-on-release-merge.yaml:
- Around line 21-24: Remove the unused Go setup step from the workflow: delete
the step block that contains "name: Set up Go", "uses: actions/setup-go@v6" and
the "go-version-file: 'go.mod'" input. Ensure no subsequent steps (e.g., the job
that runs the update-changelog command) reference or require the Go toolchain so
the workflow still runs correctly without that step.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 09309078-5b5b-40f8-9dac-fad7b87ba8fd
📒 Files selected for processing (2)
.claude/commands/update-changelog.md.github/workflows/claude-on-release-merge.yaml
…hangelog entry format
… update release orchestrator workflow
Test Coverage ReportTest Coverage 📊: 70.0% |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/claude-on-release-merge.yaml (1)
46-46:⚠️ Potential issue | 🟠 MajorUsing
GITHUB_TOKENhere can suppress downstream workflow triggers for created PRs.If the automation opens PRs with the default token, required CI/status workflows may not run on those PRs.
For GitHub Actions, do PRs or pushes created using the default GITHUB_TOKEN trigger other workflows (push/pull_request) in the same repository?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/claude-on-release-merge.yaml at line 46, The workflow is using the default github_token which prevents downstream workflows from being triggered on created PRs; replace github_token: ${{ secrets.GITHUB_TOKEN }} with a repository secret holding a PAT or machine user token (e.g., github_token: ${{ secrets.BOT_TOKEN }}), ensure that secret is created with the required scopes/permissions to create PRs and trigger workflows, and update the workflow's permissions settings if needed so the token has write/contents and workflow permissions; look for the step that sets github_token and the job-level permissions to make this change (search for the github_token line and the job that opens PRs).
🧹 Nitpick comments (2)
.claude/agents/release-pr-updater.md (1)
44-48: Specify a language for the output code fence.This avoids markdownlint MD040 and keeps docs consistent.
🔧 Suggested fix
-``` +```text ## Release PR Updater Results Updated PR #<number> description.</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In @.claude/agents/release-pr-updater.md around lines 44 - 48, The markdown code
fence in .claude/agents/release-pr-updater.md around the "## Release PR Updater
Results" block lacks a language specifier; update the opening triple-backtick to
include a language (e.g., usetext) so the fenced block becomestext
followed by the existing "## Release PR Updater Results" and closing ``` to
satisfy markdownlint MD040 and maintain consistency.</details> </blockquote></details> <details> <summary>.claude/agents/chart-bumper.md (1)</summary><blockquote> `18-30`: **Add an explicit “no chart bumps needed” output variant.** The prompt requires that path at Line 12, but the output template only shows the bumped case. Adding both formats makes Phase 3 parsing more reliable. <details> <summary>🔧 Suggested fix</summary> ```diff ## Output -``` +```text ## Chart Bumper Results Bumped: - cortex: 0.0.43 → 0.0.44 - cortex-postgres: 0.5.14 → 0.5.15 Bundles updated: cortex-nova, cortex-manila, cortex-cinder, cortex-pods, cortex-crds, cortex-ironcore, cortex-placement-shim PR opened: #<number> — <title> + +# or, if nothing changed: +## Chart Bumper Results + +no chart bumps needed ``` ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In @.claude/agents/chart-bumper.md around lines 18 - 30, The output template under "Chart Bumper Results" currently only shows the bumped-case (sections like "Bumped:", "Bundles updated:", "PR opened:"), so add an explicit alternate variant for the no-op case: include a second template that prints "## Chart Bumper Results" followed by a single line "no chart bumps needed" to mirror the parser expectation at Line 12; update the "Output" block (the text fenced example containing "Bumped:" etc.) to contain both the bumped example and the no-change example so Phase 3 parsing can unambiguously handle either path. ``` </details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/claude-on-release-merge.yaml:
- Around line 4-7: The workflow currently triggers on pull_request events for
types [opened, synchronize, reopened] against the release branch, causing it to
run on every update; change the trigger to only fire when a release PR is closed
and merged by replacing the types list with [closed] (keeping branches: -
release) and add a runtime guard to the workflow or jobs using the GitHub
context check github.event.pull_request.merged == true (e.g., add if:
github.event.pull_request.merged == true) so the workflow runs only after a
release PR is closed and confirmed merged.
Duplicate comments:
In @.github/workflows/claude-on-release-merge.yaml:
- Line 46: The workflow is using the default github_token which prevents
downstream workflows from being triggered on created PRs; replace github_token:
${{ secrets.GITHUB_TOKEN }} with a repository secret holding a PAT or machine
user token (e.g., github_token: ${{ secrets.BOT_TOKEN }}), ensure that secret is
created with the required scopes/permissions to create PRs and trigger
workflows, and update the workflow's permissions settings if needed so the token
has write/contents and workflow permissions; look for the step that sets
github_token and the job-level permissions to make this change (search for the
github_token line and the job that opens PRs).
Nitpick comments:
In @.claude/agents/chart-bumper.md:
- Around line 18-30: The output template under "Chart Bumper Results" currently
only shows the bumped-case (sections like "Bumped:", "Bundles updated:", "PR
opened:"), so add an explicit alternate variant for the no-op case: include a
second template that prints "## Chart Bumper Results" followed by a single line
"no chart bumps needed" to mirror the parser expectation at Line 12; update the
"Output" block (the text fenced example containing "Bumped:" etc.) to contain
both the bumped example and the no-change example so Phase 3 parsing can
unambiguously handle either path.In @.claude/agents/release-pr-updater.md:
- Around line 44-48: The markdown code fence in
.claude/agents/release-pr-updater.md around the "## Release PR Updater Results"
block lacks a language specifier; update the opening triple-backtick to include
a language (e.g., usetext) so the fenced block becomestext followed by
the existing "## Release PR Updater Results" and closing ``` to satisfy
markdownlint MD040 and maintain consistency.</details> <details> <summary>🪄 Autofix (Beta)</summary> Fix all unresolved CodeRabbit comments on this PR: - [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended) - [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro **Run ID**: `3cd4a4db-29b3-4bd8-9bfe-f5672dae9208` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 849e273fb325c3cbc2405269d0dd89350cb50c75 and 3a52dc965bb1000a08c135addca9e2981c708377. </details> <details> <summary>📒 Files selected for processing (7)</summary> * `.claude/agents/changelog-writer.md` * `.claude/agents/chart-bumper.md` * `.claude/agents/release-pr-updater.md` * `.claude/commands/on-release.md` * `.claude/commands/update-changelog.md` * `.coderabbit.yaml` * `.github/workflows/claude-on-release-merge.yaml` </details> <details> <summary>✅ Files skipped from review due to trivial changes (2)</summary> * .claude/commands/update-changelog.md * .coderabbit.yaml </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| branches: | ||
| - release |
There was a problem hiding this comment.
Run this workflow only when the release PR is closed and merged.
Right now it runs on every update to a release PR, which can repeatedly reopen/update downstream automation PRs before release lands.
🔧 Suggested fix
on:
pull_request:
- types: [opened, synchronize, reopened]
+ types: [closed]
branches:
- release
jobs:
release:
+ if: github.event.pull_request.merged == true
runs-on: ubuntu-latestAlso applies to: 10-10
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/claude-on-release-merge.yaml around lines 4 - 7, The
workflow currently triggers on pull_request events for types [opened,
synchronize, reopened] against the release branch, causing it to run on every
update; change the trigger to only fire when a release PR is closed and merged
by replacing the types list with [closed] (keeping branches: - release) and add
a runtime guard to the workflow or jobs using the GitHub context check
github.event.pull_request.merged == true (e.g., add if:
github.event.pull_request.merged == true) so the workflow runs only after a
release PR is closed and confirmed merged.
Add changelog command and workflow that is triggered on PR closed on release.