Skip to content

Commit ba95ad0

Browse files
authored
Merge pull request #226 from jasonmadigan/readme-updates
readme updates for clarity, and an experimental claude command for minor releases
2 parents 25e7538 + 9616771 commit ba95ad0

File tree

2 files changed

+189
-301
lines changed

2 files changed

+189
-301
lines changed

.claude/commands/minor-release.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
description: Create a minor docs release (e.g., v1.3.x -> v1.4.x)
3+
---
4+
5+
Perform a minor release of the Kuadrant documentation site. This creates a new versioned release branch and updates all multirepo import refs to point at the correct release branches/tags for each component.
6+
7+
The user will provide the new version (e.g. "1.4.x") and the previous version to base from (e.g. "1.3.x"). If not provided, look at mkdocs.yml `extra.version.default` to determine the current latest, and increment the minor number.
8+
9+
## Steps
10+
11+
1. **Check prerequisites:**
12+
- Verify `gh` CLI is installed and authenticated: `gh auth status`
13+
- If not installed or not authenticated, stop and tell the user to install/authenticate first
14+
- Check if `mkdocs` is available locally (e.g. in a venv). If not, note that docker/podman will be used instead via:
15+
`docker run -v "$(pwd):/docs" -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" -v "$HOME/.ssh:/opt/app-root/src/.ssh:ro" quay.io/kuadrant/docs.kuadrant.io:latest "<command>"`
16+
- Set a variable to track which method to use (local or docker) for subsequent build/deploy steps
17+
18+
2. **Sync with upstream:**
19+
- `git fetch upstream`
20+
- Ensure local `main` is up to date with `upstream/main`
21+
- If behind: `git rebase upstream/main`
22+
23+
3. **Determine the new version:**
24+
- Read the current `extra.version.default` from `mkdocs.yml` on `main` to find the current latest (e.g. `1.3.x`)
25+
- The new version increments the minor number (e.g. `1.4.x`)
26+
- Confirm with the user before proceeding
27+
28+
4. **Look up component release refs (using `gh` CLI):**
29+
For each component in `mkdocs.yml` under `multirepo.nav_repos`, determine the correct git ref. The ref should match whatever branch or tag corresponds to the **latest GitHub release** for that component. Version numbers across components don't necessarily correlate -- e.g. Kuadrant v1.4 might use authorino v0.24.0 and dns-operator v0.16.0.
30+
31+
For each component (except `architecture` which is always `main`), look up the latest GitHub release:
32+
Run: `gh api repos/kuadrant/{repo}/releases/latest --jq '.tag_name'`
33+
34+
Then check whether that release tag has a corresponding branch (some repos use release branches, others just tags):
35+
Run: `gh api repos/kuadrant/{repo}/branches --paginate --jq '.[].name' | grep release`
36+
37+
Use the release branch if one exists for that version, otherwise use the tag directly.
38+
39+
Present the discovered refs to the user in a table and ask them to confirm or correct before proceeding. Format:
40+
41+
| Component | Latest release | Ref to use | Type |
42+
|-|-|-|-|
43+
| kuadrant-operator | v1.4.0 | release-v1.4 | branch |
44+
| authorino | v0.24.0 | v0.24.0 | tag |
45+
| dns-operator | v0.16.0 | v0.16.0 | tag |
46+
| ... | ... | ... | ... |
47+
48+
5. **Create the release branch:**
49+
- `git checkout -b v{VERSION} main` (e.g. `v1.4.x`)
50+
51+
6. **Update mkdocs.yml on the release branch:**
52+
- For each component, update the `import_url` line to use the confirmed ref:
53+
`https://github.com/kuadrant/{repo}?edit_uri=/blob/{ref}/&branch={ref}`
54+
- Update `edit_uri` to match the release ref for repos that have release branches (e.g. kuadrant-operator).
55+
For tag-only repos (e.g. authorino), the edit_uri can stay pointing at `main` since tags are read-only.
56+
- Update the version default:
57+
```yaml
58+
extra:
59+
version:
60+
provider: mike
61+
default:
62+
- {VERSION}
63+
- latest
64+
```
65+
66+
7. **Build and verify:**
67+
- If mkdocs is available locally: `mkdocs build -s`
68+
- If using docker: `docker run -v "$(pwd):/docs" quay.io/kuadrant/docs.kuadrant.io:latest "mkdocs build -s"`
69+
- If it fails, diagnose and fix before continuing
70+
71+
8. **Print a summary of commands for the user to run:**
72+
After the build succeeds, print a copy-pasteable block of all remaining commands.
73+
Use the local or docker variant depending on what was detected in step 1.
74+
75+
Local:
76+
```
77+
# push the release branch to upstream (Kuadrant org)
78+
git push upstream v{VERSION}
79+
80+
# deploy to gh-pages with the latest alias
81+
mike deploy --update-aliases {VERSION} latest --push --remote upstream
82+
83+
# set as the default version
84+
mike set-default {VERSION} --push --remote upstream
85+
86+
# switch back to main and update the default version
87+
git checkout main
88+
# (optionally update extra.version.default in mkdocs.yml on main to {VERSION})
89+
```
90+
91+
Docker:
92+
```
93+
git push upstream v{VERSION}
94+
95+
docker run -v "$(pwd):/docs" -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" -v "$HOME/.ssh:/opt/app-root/src/.ssh:ro" \
96+
quay.io/kuadrant/docs.kuadrant.io:latest "mike deploy --update-aliases {VERSION} latest --push --remote upstream"
97+
98+
docker run -v "$(pwd):/docs" -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" -v "$HOME/.ssh:/opt/app-root/src/.ssh:ro" \
99+
quay.io/kuadrant/docs.kuadrant.io:latest "mike set-default {VERSION} --push --remote upstream"
100+
101+
git checkout main
102+
```
103+
104+
Only print the variant that matches the user's environment.
105+
106+
Important notes:
107+
- This repo uses a fork workflow (origin = user's fork, upstream = Kuadrant org). Pushes go to upstream, not origin.
108+
- NEVER run `git push`, `mike deploy`, or `mike set-default` commands. Only print them as instructions for the user to copy and run themselves.
109+
- If a component ref can't be found, ask the user rather than guessing
110+
- Some newer components (developer-portal-controller, kuadrant-backstage-plugin, mcp-gateway) may not have release branches yet -- default to `main` and flag it
111+
- The build step is critical -- don't skip it, as missing imports will cause failures in strict mode

0 commit comments

Comments
 (0)