Skip to content

Commit 026f0a6

Browse files
committed
exp: claude release command
Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
1 parent 4876ac8 commit 026f0a6

1 file changed

Lines changed: 192 additions & 0 deletions

File tree

.claude/commands/release.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
---
2+
description: "Create a release from a release branch (e.g., 0.6.0-rc2 -> 0.6.0 final, or new RC)"
3+
---
4+
5+
Create a release of mcp-gateway. Argument is the target version (e.g., `0.6.0`, `0.7.0-rc1`).
6+
7+
Version: $ARGUMENTS
8+
9+
If no version argument was provided, ask the user for it.
10+
11+
## Determine release type
12+
13+
Parse the version to determine:
14+
- **RC release**: version contains `-rc` suffix (e.g., `0.6.0-rc1`)
15+
- **Final release**: no suffix (e.g., `0.6.0`)
16+
- **Patch release**: patch > 0 and no suffix (e.g., `0.6.1`)
17+
18+
Extract the major.minor.patch for the release branch name (`release-X.Y.Z`).
19+
20+
## Remote layout
21+
22+
This repo uses a fork workflow. Confirm with `git remote -v`:
23+
- `origin` = user's fork (e.g., jasonmadigan/mcp-gateway)
24+
- `upstream` = Kuadrant/mcp-gateway
25+
26+
Both `main` and `release-*` branches have branch protection -- all changes require PRs.
27+
28+
## Safety rules
29+
30+
Follow these throughout the entire process:
31+
- **Never push to any remote.** Always tell the user what to push and let them do it.
32+
- **Never create PRs or issues.** Provide the exact `gh pr create` command for the user to run.
33+
- **Never create GitHub releases.** Walk the user through it.
34+
- **Check for uncommitted changes** before any `git checkout`. If the working tree is dirty, stop and ask the user how to proceed.
35+
- **Show diffs and ask for confirmation** before committing. Never commit without the user confirming the changes look correct.
36+
- **Never use `git add .` or `git add -A`.** Only stage specific paths relevant to the version bump.
37+
38+
## Steps
39+
40+
### 1. Pre-flight checks
41+
42+
Before doing anything:
43+
1. Run `git status` to check for uncommitted changes. If dirty, stop and ask the user.
44+
2. Run `git remote -v` to confirm the remote layout matches expectations.
45+
3. Confirm the target version with the user before proceeding.
46+
47+
### 2. Sync and create a working branch
48+
49+
```bash
50+
git fetch upstream
51+
```
52+
53+
Check if the release branch exists on upstream:
54+
```bash
55+
git ls-remote --heads upstream release-X.Y.Z
56+
```
57+
58+
**If it exists**, check it out and create the working branch:
59+
```bash
60+
git checkout release-X.Y.Z
61+
git pull upstream release-X.Y.Z
62+
git checkout -b release-{VERSION}
63+
```
64+
65+
**If it does not exist** (new minor release), tell the user:
66+
67+
> The release branch `release-X.Y.Z` doesn't exist on upstream yet. You'll need to create it. Run:
68+
> ```
69+
> git checkout main && git pull upstream main
70+
> git checkout -b release-X.Y.Z
71+
> git push upstream release-X.Y.Z
72+
> ```
73+
> Then let me know when that's done and I'll continue.
74+
75+
Do NOT push the release branch yourself. Wait for the user to confirm before continuing.
76+
77+
### 3. Update version references
78+
79+
```bash
80+
./scripts/set-release-version.sh {VERSION}
81+
```
82+
83+
Show the diff with `git diff` and ask the user to confirm the version references look correct before proceeding.
84+
85+
### 4. Regenerate OLM bundle
86+
87+
If CRD or API type changes are included, run `make generate-all` first.
88+
89+
Then regenerate the bundle:
90+
```bash
91+
make bundle VERSION={VERSION}
92+
```
93+
94+
### 5. Review and commit
95+
96+
Show the full diff of all changes with `git diff`. Present a summary of what changed and ask the user to confirm before committing.
97+
98+
Only after confirmation, stage and commit:
99+
```bash
100+
git add -u config/ charts/ docs/ bundle/ scripts/
101+
git commit -s -m "Update version to {VERSION}"
102+
```
103+
104+
### 6. Hand off to user for push and PR
105+
106+
STOP here. Do not push. Do not create a PR. Tell the user:
107+
108+
> Ready for you to push and open the PR. Run:
109+
> ```
110+
> git push -u origin release-{VERSION}
111+
> ```
112+
>
113+
> Then create a PR targeting the `release-X.Y.Z` branch on Kuadrant/mcp-gateway:
114+
> ```
115+
> gh pr create --repo Kuadrant/mcp-gateway --base release-X.Y.Z \
116+
> --title "Update version to {VERSION}" \
117+
> --body "Version bump for {VERSION} release."
118+
> ```
119+
120+
Wait for the user to confirm the PR is merged before proceeding to the next step.
121+
122+
### 7. Create GitHub release (after PR merges)
123+
124+
Tell the user to create the release:
125+
1. Go to https://github.com/Kuadrant/mcp-gateway/releases
126+
2. Click **Draft a new release**
127+
3. Click **Choose a tag**, create tag `v{VERSION}`, target the `release-X.Y.Z` branch
128+
4. Set title to `v{VERSION}`
129+
5. Click **Generate release notes**
130+
6. For RCs: check **Set as a pre-release**
131+
7. For final releases: check **Set as the latest release**
132+
8. Click **Publish release**
133+
134+
### 8. Provide verification command
135+
136+
Give the user this to run after workflows complete:
137+
138+
```bash
139+
VERSION={VERSION}
140+
for image in \
141+
ghcr.io/kuadrant/mcp-gateway:v${VERSION} \
142+
ghcr.io/kuadrant/mcp-controller:v${VERSION} \
143+
ghcr.io/kuadrant/mcp-controller-bundle:v${VERSION} \
144+
ghcr.io/kuadrant/mcp-controller-catalog:v${VERSION}; do
145+
docker manifest inspect "$image" > /dev/null 2>&1 \
146+
&& echo "OK $image" || echo "MISSING $image"
147+
done
148+
helm show chart oci://ghcr.io/kuadrant/charts/mcp-gateway --version ${VERSION} > /dev/null 2>&1 \
149+
&& echo "OK helm chart ${VERSION}" || echo "MISSING helm chart ${VERSION}"
150+
```
151+
152+
### 9. Post-release: bump version on main (final releases only)
153+
154+
Skip this step for RC releases.
155+
156+
For final releases, main needs a version bump so docs and scripts reference the latest release.
157+
158+
```bash
159+
git checkout main && git pull upstream main
160+
git checkout -b bump-version-{VERSION}
161+
./scripts/set-release-version.sh {VERSION}
162+
make bundle VERSION={VERSION}
163+
```
164+
165+
Show the diff and ask the user to confirm, then commit:
166+
```bash
167+
git add -u config/ charts/ docs/ bundle/ scripts/
168+
git commit -s -m "Update version to {VERSION}"
169+
```
170+
171+
Then tell the user to push and open a PR:
172+
173+
> Ready for you to push and open the main-branch version bump PR. Run:
174+
> ```
175+
> git push -u origin bump-version-{VERSION}
176+
> ```
177+
>
178+
> Then:
179+
> ```
180+
> gh pr create --repo Kuadrant/mcp-gateway --base main \
181+
> --title "Bump version to {VERSION}" \
182+
> --body "Post-release version bump for {VERSION}."
183+
> ```
184+
185+
## Important notes
186+
187+
- All changes go through PRs -- never push directly to protected branches
188+
- The `set-release-version.sh` script handles all version string updates across docs, scripts, and manifests
189+
- Creating the GitHub release triggers CI workflows that build images and push the Helm chart
190+
- Workflow URLs to watch:
191+
- https://github.com/Kuadrant/mcp-gateway/actions/workflows/images.yaml
192+
- https://github.com/Kuadrant/mcp-gateway/actions/workflows/helm-release.yaml

0 commit comments

Comments
 (0)