From 849e273fb325c3cbc2405269d0dd89350cb50c75 Mon Sep 17 00:00:00 2001 From: Markus Wieland Date: Fri, 24 Apr 2026 14:57:15 +0200 Subject: [PATCH 1/6] Add changelog update command and workflow for release merges --- .claude/commands/update-changelog.md | 43 ++++++++++++++++ .../workflows/claude-on-release-merge.yaml | 49 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 .claude/commands/update-changelog.md create mode 100644 .github/workflows/claude-on-release-merge.yaml diff --git a/.claude/commands/update-changelog.md b/.claude/commands/update-changelog.md new file mode 100644 index 000000000..4520516a1 --- /dev/null +++ b/.claude/commands/update-changelog.md @@ -0,0 +1,43 @@ +--- +allowed-tools: Read, Write, Edit, Bash(*), WebSearch, WebFetch +description: Create a changelog entry for a merged release PR and open a PR to main. Usage: /update-changelog PR_NUMBER +--- + +A release PR (#$ARGUMENTS) was merged into the `release` branch. Create a changelog entry for it and open a PR to `main`. + +To build the entry, use the PR's commit subjects (no diffs) and the changed Helm charts as your sources. Only include charts whose Chart.yaml actually changed in this PR. + +Format each entry as: + +## YYYY-MM-DD — ([#NNN](https://github.com/cobaltcore-dev/cortex/pull/NNN)) + +One `###` section per changed chart: `### v ()` +Under each section, bullet the commit subjects that relate to that chart. + +Attribution: "postgres" → cortex-postgres; "nova"/"manila"/"cinder"/"placement"/"shim"/"bundle" → the matching bundle chart; unattributable commits → `### General` at the end. +Skip commits containing "[skip ci]" or that are pure version-bump messages. + +Prepend the new entry below the `# Changelog` header in `CHANGELOG.md` (create the file if it doesn't exist). Then open a PR to `main` referencing this release PR. + +## Example + +```markdown +## 2026-04-24 — Release libs cortex v0.0.43 + bundles v0.0.56 ([#722](https://github.com/cobaltcore-dev/cortex/pull/722)) + +### cortex v0.0.43 (sha-xxxxxxxx) +- Commitments usage API uses postgres database instead of calling nova +- Check hypervisor resources against reservations +- Add committed resource reservations to capacity calculation + +### cortex-postgres v0.5.14 (sha-xxxxxxxx) +- Add commitments table migration + +### cortex-nova v0.0.56 (sha-xxxxxxxx) +- Update nova bundle for committed reservations support + +### cortex-manila v0.0.56 (sha-xxxxxxxx) +- Update manila bundle for committed reservations support + +### General +- Update golangci-lint to v2.1.0 +``` diff --git a/.github/workflows/claude-on-release-merge.yaml b/.github/workflows/claude-on-release-merge.yaml new file mode 100644 index 000000000..b4ee8a526 --- /dev/null +++ b/.github/workflows/claude-on-release-merge.yaml @@ -0,0 +1,49 @@ +name: Claude Code Changelog on Release Merge + +on: + pull_request: + types: [closed] + branches: + - release + +jobs: + changelog: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + id-token: write + steps: + - 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 + + - uses: ./.github/actions/start-litellm-proxy + env: + AICORE_RESOURCE_GROUP: ${{ secrets.AICORE_RESOURCE_GROUP }} + AICORE_BASE_URL: ${{ secrets.AICORE_BASE_URL }} + AICORE_AUTH_URL: ${{ secrets.AICORE_AUTH_URL }} + AICORE_CLIENT_ID: ${{ secrets.AICORE_CLIENT_ID }} + AICORE_CLIENT_SECRET: ${{ secrets.AICORE_CLIENT_SECRET }} + + - uses: ./.claude-code-action + with: + claude_args: | + --max-turns 100 + --permission-mode auto + --allowedTools "Read,Write,Edit,Bash(*),WebSearch,WebFetch" + use_litellm: "true" + litellm_model: "sap/anthropic--claude-4.6-opus" + github_token: ${{ secrets.GITHUB_TOKEN }} + show_full_output: "true" + prompt: "/update-changelog ${{ github.event.pull_request.number }}" + + - uses: ./.github/actions/stop-litellm-proxy + if: always() From 22d75b628446ba32997a7065cf3f55f4ded59a69 Mon Sep 17 00:00:00 2001 From: Markus Wieland Date: Fri, 24 Apr 2026 15:16:38 +0200 Subject: [PATCH 2/6] Enhance changelog workflow: improve concurrency settings and update changelog entry format --- .claude/commands/update-changelog.md | 17 ++++++++++++++--- .github/workflows/claude-on-release-merge.yaml | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.claude/commands/update-changelog.md b/.claude/commands/update-changelog.md index 4520516a1..79a5e1f44 100644 --- a/.claude/commands/update-changelog.md +++ b/.claude/commands/update-changelog.md @@ -9,13 +9,24 @@ To build the entry, use the PR's commit subjects (no diffs) and the changed Helm Format each entry as: -## YYYY-MM-DD — ([#NNN](https://github.com/cobaltcore-dev/cortex/pull/NNN)) +## {merged_at date in UTC, formatted YYYY-MM-DD} — {PR title} ([#NNN](https://github.com/cobaltcore-dev/cortex/pull/NNN)) One `###` section per changed chart: `### v ()` Under each section, bullet the commit subjects that relate to that chart. -Attribution: "postgres" → cortex-postgres; "nova"/"manila"/"cinder"/"placement"/"shim"/"bundle" → the matching bundle chart; unattributable commits → `### General` at the end. -Skip commits containing "[skip ci]" or that are pure version-bump messages. +Attribution: for each commit, inspect its changed files with `git show --name-only ` and map to the chart whose files were touched: + +- `postgres/**` → cortex-postgres +- `cmd/shim/**` or `internal/shim/**` → cortex-shim +- `helm/bundles/cortex-/**` → that specific bundle chart +- anything else → cortex (core) + +Commits that only touch CI, docs, or tooling go into `### General`. Skip commits containing "[skip ci]" or that are pure version-bump message. + +For bundle chart sections (helm/bundles/*), add a note listing which library chart versions they now include (read the bundle's Chart.yaml dependencies). Then inspect the actual diff of the bundle's own files with `git show -- helm/bundles//` for any commit that touched that bundle, and surface specific changes: + +- **values.yaml** changes: call out new, removed, or renamed keys and changed defaults +- **templates/** or **crds/** changes: call out added, removed, or modified resources by kind and name Prepend the new entry below the `# Changelog` header in `CHANGELOG.md` (create the file if it doesn't exist). Then open a PR to `main` referencing this release PR. diff --git a/.github/workflows/claude-on-release-merge.yaml b/.github/workflows/claude-on-release-merge.yaml index b4ee8a526..8626bbca5 100644 --- a/.github/workflows/claude-on-release-merge.yaml +++ b/.github/workflows/claude-on-release-merge.yaml @@ -10,6 +10,9 @@ jobs: changelog: if: github.event.pull_request.merged == true runs-on: ubuntu-latest + concurrency: + group: changelog-release + cancel-in-progress: false permissions: contents: write pull-requests: write From f2fbae9dbe9af975308f0d15b507329b8537ae58 Mon Sep 17 00:00:00 2001 From: Markus Wieland Date: Fri, 24 Apr 2026 15:20:06 +0200 Subject: [PATCH 3/6] Remove .coderabbit.yaml configuration file and disable high level summary reviews --- .coderabbit.yaml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml deleted file mode 100644 index d158def60..000000000 --- a/.coderabbit.yaml +++ /dev/null @@ -1,2 +0,0 @@ -reviews: - high_level_summary: false From dd0c376921d95212cd0eeb08441a5b301d9f5fb8 Mon Sep 17 00:00:00 2001 From: Markus Wieland Date: Fri, 24 Apr 2026 15:50:23 +0200 Subject: [PATCH 4/6] Add .coderabbit.yaml configuration file to manage review settings --- .coderabbit.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 000000000..e9c45c1bc --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,2 @@ +reviews: + high_level_summary: false \ No newline at end of file From 3a52dc965bb1000a08c135addca9e2981c708377 Mon Sep 17 00:00:00 2001 From: Markus Wieland Date: Fri, 24 Apr 2026 16:12:32 +0200 Subject: [PATCH 5/6] Add changelog writer, chart bumper, and release PR updater subagents; update release orchestrator workflow --- .claude/agents/changelog-writer.md | 55 +++++++++ .claude/agents/chart-bumper.md | 30 +++++ .claude/agents/release-pr-updater.md | 48 ++++++++ .claude/commands/on-release.md | 111 ++++++++++++++++++ .../workflows/claude-on-release-merge.yaml | 13 +- 5 files changed, 250 insertions(+), 7 deletions(-) create mode 100644 .claude/agents/changelog-writer.md create mode 100644 .claude/agents/chart-bumper.md create mode 100644 .claude/agents/release-pr-updater.md create mode 100644 .claude/commands/on-release.md diff --git a/.claude/agents/changelog-writer.md b/.claude/agents/changelog-writer.md new file mode 100644 index 000000000..3f580f277 --- /dev/null +++ b/.claude/agents/changelog-writer.md @@ -0,0 +1,55 @@ +--- +name: changelog-writer +description: Subagent that creates a CHANGELOG.md entry from a release digest and opens a staged PR to main. +tools: Read, Write, Edit, Bash(*), WebFetch +model: inherit +--- + +# Changelog Writer + +You are the changelog writer subagent. You receive a release digest and a PR number. Create a new entry in `CHANGELOG.md` and open a staged PR to `main` ready to merge once the release lands. + +## Entry format + +```markdown +## YYYY-MM-DD — {PR title} ([#NNN](https://github.com/cobaltcore-dev/cortex/pull/NNN)) + +### v () +- + +### General +- +``` + +Use today's UTC date (the PR won't be merged yet when this runs). One `###` section per changed chart only. For bundle sections, list which library versions they include followed by any bundle-specific changes. Omit `### General` if empty. Skip `[skip ci]` and pure version-bump commits. + +Prepend the entry below the `# Changelog` header (create the file if it doesn't exist). Then open a PR to `main` with branch `changelog/release-pr-`, title `chore: add changelog entry for release PR #`, and a body noting it should be merged after the release PR. + +## Example entry + +```markdown +## 2026-04-24 — Release libs cortex v0.0.43 + bundles v0.0.56 ([#722](https://github.com/cobaltcore-dev/cortex/pull/722)) + +### cortex v0.0.43 (sha-xxxxxxxx) +- Commitments usage API uses postgres database instead of calling nova +- Check hypervisor resources against reservations +- Add committed resource reservations to capacity calculation + +### cortex-postgres v0.5.14 (sha-xxxxxxxx) +- Add commitments table migration + +### cortex-nova v0.0.56 (sha-xxxxxxxx) +- Includes cortex v0.0.43, cortex-postgres v0.5.14 +- values.yaml: added `reservations.enabled` (default: false) + +### General +- Update golangci-lint to v2.1.0 +``` + +## Output + +``` +## Changelog Writer Results + +PR opened: # +``` diff --git a/.claude/agents/chart-bumper.md b/.claude/agents/chart-bumper.md new file mode 100644 index 000000000..3a3d8b1a7 --- /dev/null +++ b/.claude/agents/chart-bumper.md @@ -0,0 +1,30 @@ +--- +name: chart-bumper +description: Subagent that patch-bumps chart versions for released library charts and updates bundle dependency references, then opens a staged PR to main. +tools: Read, Write, Edit, Bash(*), WebFetch +model: inherit +--- + +# Chart Bumper + +You are the chart bumper subagent. You receive a release digest and a PR number. Prepare chart version bumps on `main` so the codebase is ready for the next release cycle. + +Check the digest for changed **library charts** (`cortex`, `cortex-postgres`, `cortex-shim`). If none changed, report "no chart bumps needed" and stop. + +For each changed library chart, patch-bump its `version` in `helm/library/<name>/Chart.yaml` (e.g. `0.0.43` → `0.0.44`). Do not touch `appVersion`. Then update the matching `dependencies[].version` entry in every `helm/bundles/*/Chart.yaml` that references it. + +Open a single PR to `main` with all the bumps, branch `chore/bump-chart-versions-post-release-<NNN>`, noting in the body that it should be merged after the release PR. + +## Output + +``` +## 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> +``` diff --git a/.claude/agents/release-pr-updater.md b/.claude/agents/release-pr-updater.md new file mode 100644 index 000000000..805ffe8b6 --- /dev/null +++ b/.claude/agents/release-pr-updater.md @@ -0,0 +1,48 @@ +--- +name: release-pr-updater +description: Subagent that rewrites the description of a release PR with a clean, component-organized summary derived from the release digest. +tools: Bash(*), WebFetch +model: inherit +--- + +# Release PR Updater + +You are the release PR updater subagent. You receive a release digest and a PR number. Rewrite the release PR's body so reviewers immediately understand what changed and in which components. + +Use the same format as the project's changelog entries: + +```markdown +### <chart-name> v<version> (<appVersion>) +- <bullet per meaningful change> + +### General +- <bullet per CI/tooling/docs change, if any> +``` + +One `###` section per changed chart only. For bundle sections, list which library versions they include, then any bundle-specific changes (values.yaml keys, template/CRD changes). Omit `### General` if empty. No commit SHAs, one line per bullet. + +## Example + +```markdown +### cortex v0.0.43 (sha-xxxxxxxx) +- Commitments usage API uses postgres database instead of calling nova +- Check hypervisor resources against reservations + +### cortex-postgres v0.5.14 (sha-xxxxxxxx) +- Add commitments table migration + +### cortex-nova v0.0.56 (sha-xxxxxxxx) +- Includes cortex v0.0.43, cortex-postgres v0.5.14 +- values.yaml: added `reservations.enabled` (default: false) + +### General +- Update golangci-lint to v2.1.0 +``` + +## Output + +``` +## Release PR Updater Results + +Updated PR #<number> description. +``` diff --git a/.claude/commands/on-release.md b/.claude/commands/on-release.md new file mode 100644 index 000000000..deb1c1fb0 --- /dev/null +++ b/.claude/commands/on-release.md @@ -0,0 +1,111 @@ +--- +allowed-tools: Read, Write, Edit, Bash(*), WebSearch, WebFetch, Agent +description: Release orchestrator — builds a digest of what changed in a release PR and dispatches subagents to update the PR description, write the changelog, and bump chart versions. Usage: /on-release PR_NUMBER +--- + +# Release Orchestrator + +You are an orchestrator agent. Your job is to build a complete digest of the release PR and hand it off to specialized subagents that will act on it. You do NOT edit the PR, write the changelog, or bump charts yourself — the subagents do that. + +--- + +## Phase 1: Collect — Build the release digest + +1. Fetch PR metadata: + ``` + gh pr view $ARGUMENTS --json number,title,body,commits,files + ``` + +2. For each commit SHA in the PR, inspect the changed files: + ``` + git show --name-only --format="%H %s" <sha> + ``` + +3. Classify each commit to a component using these path rules: + - `postgres/**` → cortex-postgres + - `cmd/shim/**` or `internal/shim/**` → cortex-shim + - `helm/bundles/cortex-<name>/**` → that specific bundle chart + - Files only touching `.github/**`, `docs/**`, `Makefile`, or tooling config → General + - Anything else → cortex (core) + - A commit touching multiple components is listed under each. + - Skip commits whose subject contains `[skip ci]` or is a pure version-bump (e.g. "Bump … appVersion"). + +4. Read every `helm/library/*/Chart.yaml` and `helm/bundles/*/Chart.yaml` that appears in the PR's changed files. Collect `name`, `version`, `appVersion`. + +5. For each changed bundle chart, also read its `Chart.yaml` dependencies to know which library versions it now ships. + +6. For commits touching `helm/bundles/cortex-<name>/`, inspect the actual diff: + ``` + git show <sha> -- helm/bundles/<name>/ + ``` + Note `values.yaml` key additions/removals/renames and `templates/`/`crds/` resource changes. + +Produce a structured digest in this exact format — the subagents depend on it: + +``` +## Release Digest — PR #NNN "{title}" + +### Changed Charts +- cortex v0.0.43 (sha-xxxxxxxx) +- cortex-postgres v0.5.14 (sha-xxxxxxxx) +- cortex-nova v0.0.56 — includes cortex v0.0.43, cortex-postgres v0.5.14 + +### Commits by Component + +#### cortex +- <sha> <subject> + +#### cortex-postgres +- <sha> <subject> + +#### cortex-nova +- values.yaml: added `reservations.enabled` (default: false) +- <sha> <subject> (if any commits directly touched this bundle) + +#### General +- <sha> <subject> +``` + +**Important**: Do NOT skip or shallow this phase. Read actual file diffs. The subagents depend entirely on the quality of this digest. + +--- + +## Phase 2: Dispatch — Hand off to subagents in parallel + +Once the digest is complete, read each agent file, then dispatch all three **in parallel** using the Agent tool in a single message. Each subagent operates independently — do not wait for one before starting the others. + +Each subagent receives a prompt containing: +1. The full digest from Phase 1 +2. The PR number: $ARGUMENTS +3. The full contents of its `.claude/agents/<name>.md` file + +### Subagent 1: Release PR Updater + +`subagent_type: "general-purpose"` — reads `.claude/agents/release-pr-updater.md` + +### Subagent 2: Changelog Writer + +`subagent_type: "general-purpose"` — reads `.claude/agents/changelog-writer.md` + +### Subagent 3: Chart Bumper + +`subagent_type: "general-purpose"` — reads `.claude/agents/chart-bumper.md` + +--- + +## Phase 3: Summarize — Report what happened + +After all subagents return, produce a short summary: + +``` +## Release #NNN Post-Open Summary + +### Release PR Updater +- <what was updated in the PR description, or "no changes made"> + +### Changelog Writer +- PR opened: #<number> — <title>, or "failed: <reason>" + +### Chart Bumper +- PR opened: #<number> — <title>, or "no chart bumps needed" +``` diff --git a/.github/workflows/claude-on-release-merge.yaml b/.github/workflows/claude-on-release-merge.yaml index 8626bbca5..1766c7434 100644 --- a/.github/workflows/claude-on-release-merge.yaml +++ b/.github/workflows/claude-on-release-merge.yaml @@ -1,14 +1,13 @@ -name: Claude Code Changelog on Release Merge +name: Claude Code Release Orchestrator on: pull_request: - types: [closed] + types: [opened, synchronize, reopened] branches: - release jobs: - changelog: - if: github.event.pull_request.merged == true + release: runs-on: ubuntu-latest concurrency: group: changelog-release @@ -39,14 +38,14 @@ jobs: - uses: ./.claude-code-action with: claude_args: | - --max-turns 100 + --max-turns 200 --permission-mode auto - --allowedTools "Read,Write,Edit,Bash(*),WebSearch,WebFetch" + --allowedTools "Read,Write,Edit,Bash(*),WebSearch,WebFetch,Agent" use_litellm: "true" litellm_model: "sap/anthropic--claude-4.6-opus" github_token: ${{ secrets.GITHUB_TOKEN }} show_full_output: "true" - prompt: "/update-changelog ${{ github.event.pull_request.number }}" + prompt: "/on-release ${{ github.event.pull_request.number }}" - uses: ./.github/actions/stop-litellm-proxy if: always() From e99dc5f16d163936086bf896b20dc2775b9e0984 Mon Sep 17 00:00:00 2001 From: Philipp Matthes <p.matthes@sap.com> Date: Wed, 29 Apr 2026 14:23:01 +0200 Subject: [PATCH 6/6] Combine tasks since changelog is useful for all three subagents --- .claude/agents/changelog-writer.md | 55 ------ .claude/agents/chart-bumper.md | 30 ---- .claude/agents/release-pr-updater.md | 48 ----- .claude/commands/on-release.md | 111 ------------ .claude/commands/release.md | 164 ++++++++++++++++++ ...release-merge.yaml => claude-release.yaml} | 5 +- 6 files changed, 167 insertions(+), 246 deletions(-) delete mode 100644 .claude/agents/changelog-writer.md delete mode 100644 .claude/agents/chart-bumper.md delete mode 100644 .claude/agents/release-pr-updater.md delete mode 100644 .claude/commands/on-release.md create mode 100644 .claude/commands/release.md rename .github/workflows/{claude-on-release-merge.yaml => claude-release.yaml} (91%) diff --git a/.claude/agents/changelog-writer.md b/.claude/agents/changelog-writer.md deleted file mode 100644 index 3f580f277..000000000 --- a/.claude/agents/changelog-writer.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: changelog-writer -description: Subagent that creates a CHANGELOG.md entry from a release digest and opens a staged PR to main. -tools: Read, Write, Edit, Bash(*), WebFetch -model: inherit ---- - -# Changelog Writer - -You are the changelog writer subagent. You receive a release digest and a PR number. Create a new entry in `CHANGELOG.md` and open a staged PR to `main` ready to merge once the release lands. - -## Entry format - -```markdown -## YYYY-MM-DD — {PR title} ([#NNN](https://github.com/cobaltcore-dev/cortex/pull/NNN)) - -### <chart-name> v<version> (<appVersion>) -- <bullet per meaningful change> - -### General -- <bullet per CI/tooling change, if any> -``` - -Use today's UTC date (the PR won't be merged yet when this runs). One `###` section per changed chart only. For bundle sections, list which library versions they include followed by any bundle-specific changes. Omit `### General` if empty. Skip `[skip ci]` and pure version-bump commits. - -Prepend the entry below the `# Changelog` header (create the file if it doesn't exist). Then open a PR to `main` with branch `changelog/release-pr-<NNN>`, title `chore: add changelog entry for release PR #<NNN>`, and a body noting it should be merged after the release PR. - -## Example entry - -```markdown -## 2026-04-24 — Release libs cortex v0.0.43 + bundles v0.0.56 ([#722](https://github.com/cobaltcore-dev/cortex/pull/722)) - -### cortex v0.0.43 (sha-xxxxxxxx) -- Commitments usage API uses postgres database instead of calling nova -- Check hypervisor resources against reservations -- Add committed resource reservations to capacity calculation - -### cortex-postgres v0.5.14 (sha-xxxxxxxx) -- Add commitments table migration - -### cortex-nova v0.0.56 (sha-xxxxxxxx) -- Includes cortex v0.0.43, cortex-postgres v0.5.14 -- values.yaml: added `reservations.enabled` (default: false) - -### General -- Update golangci-lint to v2.1.0 -``` - -## Output - -``` -## Changelog Writer Results - -PR opened: #<number> — <title> -``` diff --git a/.claude/agents/chart-bumper.md b/.claude/agents/chart-bumper.md deleted file mode 100644 index 3a3d8b1a7..000000000 --- a/.claude/agents/chart-bumper.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: chart-bumper -description: Subagent that patch-bumps chart versions for released library charts and updates bundle dependency references, then opens a staged PR to main. -tools: Read, Write, Edit, Bash(*), WebFetch -model: inherit ---- - -# Chart Bumper - -You are the chart bumper subagent. You receive a release digest and a PR number. Prepare chart version bumps on `main` so the codebase is ready for the next release cycle. - -Check the digest for changed **library charts** (`cortex`, `cortex-postgres`, `cortex-shim`). If none changed, report "no chart bumps needed" and stop. - -For each changed library chart, patch-bump its `version` in `helm/library/<name>/Chart.yaml` (e.g. `0.0.43` → `0.0.44`). Do not touch `appVersion`. Then update the matching `dependencies[].version` entry in every `helm/bundles/*/Chart.yaml` that references it. - -Open a single PR to `main` with all the bumps, branch `chore/bump-chart-versions-post-release-<NNN>`, noting in the body that it should be merged after the release PR. - -## Output - -``` -## 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> -``` diff --git a/.claude/agents/release-pr-updater.md b/.claude/agents/release-pr-updater.md deleted file mode 100644 index 805ffe8b6..000000000 --- a/.claude/agents/release-pr-updater.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: release-pr-updater -description: Subagent that rewrites the description of a release PR with a clean, component-organized summary derived from the release digest. -tools: Bash(*), WebFetch -model: inherit ---- - -# Release PR Updater - -You are the release PR updater subagent. You receive a release digest and a PR number. Rewrite the release PR's body so reviewers immediately understand what changed and in which components. - -Use the same format as the project's changelog entries: - -```markdown -### <chart-name> v<version> (<appVersion>) -- <bullet per meaningful change> - -### General -- <bullet per CI/tooling/docs change, if any> -``` - -One `###` section per changed chart only. For bundle sections, list which library versions they include, then any bundle-specific changes (values.yaml keys, template/CRD changes). Omit `### General` if empty. No commit SHAs, one line per bullet. - -## Example - -```markdown -### cortex v0.0.43 (sha-xxxxxxxx) -- Commitments usage API uses postgres database instead of calling nova -- Check hypervisor resources against reservations - -### cortex-postgres v0.5.14 (sha-xxxxxxxx) -- Add commitments table migration - -### cortex-nova v0.0.56 (sha-xxxxxxxx) -- Includes cortex v0.0.43, cortex-postgres v0.5.14 -- values.yaml: added `reservations.enabled` (default: false) - -### General -- Update golangci-lint to v2.1.0 -``` - -## Output - -``` -## Release PR Updater Results - -Updated PR #<number> description. -``` diff --git a/.claude/commands/on-release.md b/.claude/commands/on-release.md deleted file mode 100644 index deb1c1fb0..000000000 --- a/.claude/commands/on-release.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -allowed-tools: Read, Write, Edit, Bash(*), WebSearch, WebFetch, Agent -description: Release orchestrator — builds a digest of what changed in a release PR and dispatches subagents to update the PR description, write the changelog, and bump chart versions. Usage: /on-release PR_NUMBER ---- - -# Release Orchestrator - -You are an orchestrator agent. Your job is to build a complete digest of the release PR and hand it off to specialized subagents that will act on it. You do NOT edit the PR, write the changelog, or bump charts yourself — the subagents do that. - ---- - -## Phase 1: Collect — Build the release digest - -1. Fetch PR metadata: - ``` - gh pr view $ARGUMENTS --json number,title,body,commits,files - ``` - -2. For each commit SHA in the PR, inspect the changed files: - ``` - git show --name-only --format="%H %s" <sha> - ``` - -3. Classify each commit to a component using these path rules: - - `postgres/**` → cortex-postgres - - `cmd/shim/**` or `internal/shim/**` → cortex-shim - - `helm/bundles/cortex-<name>/**` → that specific bundle chart - - Files only touching `.github/**`, `docs/**`, `Makefile`, or tooling config → General - - Anything else → cortex (core) - - A commit touching multiple components is listed under each. - - Skip commits whose subject contains `[skip ci]` or is a pure version-bump (e.g. "Bump … appVersion"). - -4. Read every `helm/library/*/Chart.yaml` and `helm/bundles/*/Chart.yaml` that appears in the PR's changed files. Collect `name`, `version`, `appVersion`. - -5. For each changed bundle chart, also read its `Chart.yaml` dependencies to know which library versions it now ships. - -6. For commits touching `helm/bundles/cortex-<name>/`, inspect the actual diff: - ``` - git show <sha> -- helm/bundles/<name>/ - ``` - Note `values.yaml` key additions/removals/renames and `templates/`/`crds/` resource changes. - -Produce a structured digest in this exact format — the subagents depend on it: - -``` -## Release Digest — PR #NNN "{title}" - -### Changed Charts -- cortex v0.0.43 (sha-xxxxxxxx) -- cortex-postgres v0.5.14 (sha-xxxxxxxx) -- cortex-nova v0.0.56 — includes cortex v0.0.43, cortex-postgres v0.5.14 - -### Commits by Component - -#### cortex -- <sha> <subject> - -#### cortex-postgres -- <sha> <subject> - -#### cortex-nova -- values.yaml: added `reservations.enabled` (default: false) -- <sha> <subject> (if any commits directly touched this bundle) - -#### General -- <sha> <subject> -``` - -**Important**: Do NOT skip or shallow this phase. Read actual file diffs. The subagents depend entirely on the quality of this digest. - ---- - -## Phase 2: Dispatch — Hand off to subagents in parallel - -Once the digest is complete, read each agent file, then dispatch all three **in parallel** using the Agent tool in a single message. Each subagent operates independently — do not wait for one before starting the others. - -Each subagent receives a prompt containing: -1. The full digest from Phase 1 -2. The PR number: $ARGUMENTS -3. The full contents of its `.claude/agents/<name>.md` file - -### Subagent 1: Release PR Updater - -`subagent_type: "general-purpose"` — reads `.claude/agents/release-pr-updater.md` - -### Subagent 2: Changelog Writer - -`subagent_type: "general-purpose"` — reads `.claude/agents/changelog-writer.md` - -### Subagent 3: Chart Bumper - -`subagent_type: "general-purpose"` — reads `.claude/agents/chart-bumper.md` - ---- - -## Phase 3: Summarize — Report what happened - -After all subagents return, produce a short summary: - -``` -## Release #NNN Post-Open Summary - -### Release PR Updater -- <what was updated in the PR description, or "no changes made"> - -### Changelog Writer -- PR opened: #<number> — <title>, or "failed: <reason>" - -### Chart Bumper -- PR opened: #<number> — <title>, or "no chart bumps needed" -``` diff --git a/.claude/commands/release.md b/.claude/commands/release.md new file mode 100644 index 000000000..38ff4a60f --- /dev/null +++ b/.claude/commands/release.md @@ -0,0 +1,164 @@ +--- +allowed-tools: Read, Write, Edit, Bash(*), WebSearch, WebFetch, Agent +description: Release orchestrator — builds a digest of what changed in a release PR, opens a changelog PR, and references the bump PR. Usage: /release PR_NUMBER +--- + +# Release Orchestrator + +Your job is to orchestrate the release process for a given PR. This involves analyzing the PR's commits and changed files to build a structured digest of what changed, determining if there are any breaking changes, preparing a changelog, opening a PR to bump chart versions if needed, and updating the original PR description with the changelog and references to the new PRs. + +--- + +## Phase 1: Collect — Build the release digest + +1. Fetch PR metadata: + ``` + gh pr view $ARGUMENTS --json number,title,body,commits,files + ``` + +2. For each commit SHA in the PR, inspect the changed files: + ``` + git show --name-only --format="%H %s" <sha> + ``` + +3. Classify each commit to a component: + - Cortex shim: code touching the shim layer (internal/shim and cmd/shim) + - Cortex postgres: code touching the postgres docker image, or its helm chart + - Cortex core: core code touching anything else: the manager or external scheduler logic of cortex + - General: CI, tooling, docs, or other non-code changes + +4. Finally, read through the cortex helm charts in the helm/ folder, and check which ones have updated appVersions, indicating a new Docker image is available and that the chart should be included in the release notes. + +Produce a structured digest in this exact format — the subagents depend on it: + +``` +## Release Digest — PR #NNN "{title}" + +### Changed Charts +- cortex v1.2.3 (sha-xxxxxxxx) +- cortex-postgres v1.2.3 (sha-xxxxxxxx) +- cortex-nova v1.2.3 — includes cortex v1.2.3, cortex-postgres v1.2.3 + +### Commits by Component + +#### cortex core +- <sha> <subject> + +#### cortex postgres +- <sha> <subject> + +#### cortex shim +- <sha> <subject> + +#### General +- <sha> <subject> +``` + +**Important**: Do NOT skip or shallow this phase. Read actual file diffs. The subagents depend entirely on the quality of this digest. + +--- + +## Phase 2: Determine Breaking Changes and Prepare a Changelog + +Reason for each change by looking at the commit's diff, if it is a breaking change that requires special attention. + +**Important**: Do NOT skip or shallow this phase. Read actual file diffs. The PR reviewers depend entirely on the quality of this analysis to know what to focus on in their review. + +### When is a change "breaking"? + +A change should be classified as "breaking" if it meets any of the following criteria: + +- It changes or removes the public API of any component (e.g., CRD schemas, CLI flags, or REST API endpoints). Note: additions to the public API are not breaking. +- It requires a config format change (e.g., renaming or removing a values.yaml key, changing the expected format of a value, etc) + +Once the digest is complete, read each agent file, then dispatch all three **in parallel** using the Agent tool in a single message. Each subagent operates independently — do not wait for one before starting the others. + +### Prepare the changelog + +Generate a changelog following this template: + +```markdown +# Changelog + +## YYYY-MM-DD — [#NNN](<PR URL>) + +### <chart-name> v<version> (<appVersion>) + +Breaking changes: +- <bullet per meaningful change> + +Non-breaking changes: +- <bullet per meaningful change> + +... repeat for each changed chart ... + +### General + +Breaking changes: +- <bullet per meaningful change> + +Non-breaking changes: +- <bullet per meaningful change> +``` + +One `###` section per changed chart only. For bundle sections, list which library versions they include, then any bundle-specific changes (values.yaml keys, template/CRD changes). Omit `### General` if empty. No commit SHAs, one line per bullet. + +Example: +```markdown +# Changelog + +## 2026-04-24 — [#123](https://github.com/cobaltcore-dev/cortex/pull/123) + +### cortex v0.0.43 (sha-xxxxxxxx) + +Breaking changes: +- Check hypervisor resources against reservations + +Non-breaking changes: +- Commitments usage API uses postgres database instead of calling nova + +### cortex-postgres v0.5.14 (sha-xxxxxxxx) + +Non-breaking changes: +- Add commitments table migration + +### cortex-nova v0.0.56 (sha-xxxxxxxx) + +Includes updated charts cortex v0.0.43 and cortex-postgres v0.5.14. + +Non-breaking changes: +- values.yaml: added `reservations.enabled` (default: false) + +### General + +Non-breaking changes: +- Update golangci-lint to v2.1.0 +``` + +## Phase 3: Bump Chart Versions + +Prepare chart version bumps so GitHub pushes bumped charts to the registry immediately after the release PR is merged. + +For each changed library chart, patch-bump its `version` in `helm/library/<name>/Chart.yaml` (e.g. `0.0.43` → `0.1.0`), if there was no breaking change, otherwise minor-bump it. Do not touch `appVersion`. Then update the matching `dependencies[].version` entry in every `helm/bundles/*/Chart.yaml` that references it. + +Open a single PR to `main` with all the bumps, branch `release/bump-charts-<NNN>`, noting in the body that it should be merged before the release PR. Use the pull-request-creator agent for this subtask, and include the chart changes in the motivation so they are included in the PR description. + +## Phase 4: Update the PR Description + +Use `gh pr edit` with `--body` to update the PR description with the changelog. It is fine for release pull request descriptions to utilize markdown formatting. Reference the opened bump PR in the description as well as a dependency. + +## Phase 5: Create a Changelog PR + +If the CHANGELOG.md does not exists, create it with a `# Changelog` header. Then create a new PR to `main` with branch `release/changelog-<NNN>`, title `Update changelog for release PR #<NNN>`, and a body noting it should be merged after the release PR. Use the pull-request-creator agent for this subtask. + +## Phase 6: Summarize — Report what happened + +After all subagents return, produce a short summary: + +``` +## Release #NNN Post-Open Summary + +- PR description updated with changelog and bump PR reference +- Bump PR #XXX opened to update chart versions +- Changelog PR #YYY opened to update CHANGELOG.md +``` diff --git a/.github/workflows/claude-on-release-merge.yaml b/.github/workflows/claude-release.yaml similarity index 91% rename from .github/workflows/claude-on-release-merge.yaml rename to .github/workflows/claude-release.yaml index 1766c7434..216716809 100644 --- a/.github/workflows/claude-on-release-merge.yaml +++ b/.github/workflows/claude-release.yaml @@ -8,6 +8,7 @@ on: jobs: release: + if: false # Temporarily disabled runs-on: ubuntu-latest concurrency: group: changelog-release @@ -38,14 +39,14 @@ jobs: - uses: ./.claude-code-action with: claude_args: | - --max-turns 200 + --max-turns 1000 --permission-mode auto --allowedTools "Read,Write,Edit,Bash(*),WebSearch,WebFetch,Agent" use_litellm: "true" litellm_model: "sap/anthropic--claude-4.6-opus" github_token: ${{ secrets.GITHUB_TOKEN }} show_full_output: "true" - prompt: "/on-release ${{ github.event.pull_request.number }}" + prompt: "/release ${{ github.event.pull_request.number }}" - uses: ./.github/actions/stop-litellm-proxy if: always()