|
| 1 | +--- |
| 2 | +allowed-tools: Read, Write, Edit, Bash(*), WebSearch, WebFetch, Agent |
| 3 | +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 |
| 4 | +--- |
| 5 | + |
| 6 | +# Release Orchestrator |
| 7 | + |
| 8 | +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. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Phase 1: Collect — Build the release digest |
| 13 | + |
| 14 | +1. Fetch PR metadata: |
| 15 | + ``` |
| 16 | + gh pr view $ARGUMENTS --json number,title,body,commits,files |
| 17 | + ``` |
| 18 | + |
| 19 | +2. For each commit SHA in the PR, inspect the changed files: |
| 20 | + ``` |
| 21 | + git show --name-only --format="%H %s" <sha> |
| 22 | + ``` |
| 23 | + |
| 24 | +3. Classify each commit to a component: |
| 25 | + - Cortex shim: code touching the shim layer (internal/shim and cmd/shim) |
| 26 | + - Cortex postgres: code touching the postgres docker image, or its helm chart |
| 27 | + - Cortex core: core code touching anything else: the manager or external scheduler logic of cortex |
| 28 | + - General: CI, tooling, docs, or other non-code changes |
| 29 | + |
| 30 | +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. |
| 31 | + |
| 32 | +Produce a structured digest in this exact format — the subagents depend on it: |
| 33 | + |
| 34 | +``` |
| 35 | +## Release Digest — PR #NNN "{title}" |
| 36 | +
|
| 37 | +### Changed Charts |
| 38 | +- cortex v1.2.3 (sha-xxxxxxxx) |
| 39 | +- cortex-postgres v1.2.3 (sha-xxxxxxxx) |
| 40 | +- cortex-nova v1.2.3 — includes cortex v1.2.3, cortex-postgres v1.2.3 |
| 41 | +
|
| 42 | +### Commits by Component |
| 43 | +
|
| 44 | +#### cortex core |
| 45 | +- <sha> <subject> |
| 46 | +
|
| 47 | +#### cortex postgres |
| 48 | +- <sha> <subject> |
| 49 | +
|
| 50 | +#### cortex shim |
| 51 | +- <sha> <subject> |
| 52 | +
|
| 53 | +#### General |
| 54 | +- <sha> <subject> |
| 55 | +``` |
| 56 | + |
| 57 | +**Important**: Do NOT skip or shallow this phase. Read actual file diffs. The subagents depend entirely on the quality of this digest. |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## Phase 2: Determine Breaking Changes and Prepare a Changelog |
| 62 | + |
| 63 | +Reason for each change by looking at the commit's diff, if it is a breaking change that requires special attention. |
| 64 | + |
| 65 | +**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. |
| 66 | + |
| 67 | +### When is a change "breaking"? |
| 68 | + |
| 69 | +A change should be classified as "breaking" if it meets any of the following criteria: |
| 70 | + |
| 71 | +- 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. |
| 72 | +- It requires a config format change (e.g., renaming or removing a values.yaml key, changing the expected format of a value, etc) |
| 73 | + |
| 74 | +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. |
| 75 | + |
| 76 | +### Prepare the changelog |
| 77 | + |
| 78 | +Generate a changelog following this template: |
| 79 | + |
| 80 | +```markdown |
| 81 | +# Changelog |
| 82 | + |
| 83 | +## YYYY-MM-DD — [#NNN](<PR URL>) |
| 84 | + |
| 85 | +### <chart-name> v<version> (<appVersion>) |
| 86 | + |
| 87 | +Breaking changes: |
| 88 | +- <bullet per meaningful change> |
| 89 | + |
| 90 | +Non-breaking changes: |
| 91 | +- <bullet per meaningful change> |
| 92 | + |
| 93 | +... repeat for each changed chart ... |
| 94 | + |
| 95 | +### General |
| 96 | + |
| 97 | +Breaking changes: |
| 98 | +- <bullet per meaningful change> |
| 99 | + |
| 100 | +Non-breaking changes: |
| 101 | +- <bullet per meaningful change> |
| 102 | +``` |
| 103 | + |
| 104 | +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. |
| 105 | + |
| 106 | +Example: |
| 107 | +```markdown |
| 108 | +# Changelog |
| 109 | + |
| 110 | +## 2026-04-24 — [#123](https://github.com/cobaltcore-dev/cortex/pull/123) |
| 111 | + |
| 112 | +### cortex v0.0.43 (sha-xxxxxxxx) |
| 113 | + |
| 114 | +Breaking changes: |
| 115 | +- Check hypervisor resources against reservations |
| 116 | + |
| 117 | +Non-breaking changes: |
| 118 | +- Commitments usage API uses postgres database instead of calling nova |
| 119 | + |
| 120 | +### cortex-postgres v0.5.14 (sha-xxxxxxxx) |
| 121 | + |
| 122 | +Non-breaking changes: |
| 123 | +- Add commitments table migration |
| 124 | + |
| 125 | +### cortex-nova v0.0.56 (sha-xxxxxxxx) |
| 126 | + |
| 127 | +Includes updated charts cortex v0.0.43 and cortex-postgres v0.5.14. |
| 128 | + |
| 129 | +Non-breaking changes: |
| 130 | +- values.yaml: added `reservations.enabled` (default: false) |
| 131 | + |
| 132 | +### General |
| 133 | + |
| 134 | +Non-breaking changes: |
| 135 | +- Update golangci-lint to v2.1.0 |
| 136 | +``` |
| 137 | + |
| 138 | +## Phase 3: Bump Chart Versions |
| 139 | + |
| 140 | +Prepare chart version bumps so GitHub pushes bumped charts to the registry immediately after the release PR is merged. |
| 141 | + |
| 142 | +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. |
| 143 | + |
| 144 | +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. |
| 145 | + |
| 146 | +## Phase 4: Update the PR Description |
| 147 | + |
| 148 | +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. |
| 149 | + |
| 150 | +## Phase 5: Create a Changelog PR |
| 151 | + |
| 152 | +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. |
| 153 | + |
| 154 | +## Phase 6: Summarize — Report what happened |
| 155 | + |
| 156 | +After all subagents return, produce a short summary: |
| 157 | + |
| 158 | +``` |
| 159 | +## Release #NNN Post-Open Summary |
| 160 | +
|
| 161 | +- PR description updated with changelog and bump PR reference |
| 162 | +- Bump PR #XXX opened to update chart versions |
| 163 | +- Changelog PR #YYY opened to update CHANGELOG.md |
| 164 | +``` |
0 commit comments