Skip to content

Commit ae8e82a

Browse files
Add release-notes generator script and update release docs
- Add scripts/release-notes Go tool that generates and maintains release notes using k8s.io/release changelog extraction - Add make generate-release-notes target with CERT_MANAGER_VERSION variable; the tool auto-detects the best end revision (tag → release branch → master) so it works before the tag is created - Update release process docs to use make generate-release-notes in step 4 (prepare release notes PR, can be done ahead of time) and step 11 (re-run after tag is created if needed) - Remove dependency on the separately-installed k8s release-notes CLI - Update release-notes-1.18.md with auto-generated content - Add content/docs/releases/release-notes/.spelling for version strings Signed-off-by: Richard Wall <richard.wall@cyberark.com>
1 parent fd21f67 commit ae8e82a

9 files changed

Lines changed: 2779 additions & 166 deletions

File tree

content/docs/contributing/release-process.md

Lines changed: 81 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -61,50 +61,44 @@ If you need to release a version of cert-manager 1.7 or earlier see [Other Relea
6161

6262
First, ensure that you have all the tools required to perform a cert-manager release:
6363

64-
1. Install the [`release-notes`](https://github.com/kubernetes/release/blob/master/cmd/release-notes/README.md) CLI:
65-
66-
```bash
67-
go install k8s.io/release/cmd/release-notes@v0.13.0
68-
```
69-
70-
2. Install our [`cmrel`](https://github.com/cert-manager/release) CLI:
64+
1. Install our [`cmrel`](https://github.com/cert-manager/release) CLI:
7165

7266
```bash
7367
go install github.com/cert-manager/release/cmd/cmrel@latest
7468
```
7569

76-
3. Clone the `cert-manager/release` repo:
70+
2. Clone the `cert-manager/release` repo:
7771

7872
```bash
7973
# Don't clone it from inside the cert-manager repo folder.
8074
git clone https://github.com/cert-manager/release
8175
cd release
8276
```
8377

84-
4. Install the [`gcloud`](https://cloud.google.com/sdk/) CLI.
85-
5. [Login](https://cloud.google.com/sdk/docs/authorizing#running_gcloud_auth_login)
78+
3. Install the [`gcloud`](https://cloud.google.com/sdk/) CLI.
79+
4. [Login](https://cloud.google.com/sdk/docs/authorizing#running_gcloud_auth_login)
8680
to `gcloud`:
8781

8882
```bash
8983
gcloud auth application-default login
9084
```
9185

92-
6. Make sure `gcloud` points to the cert-manager-release project:
86+
5. Make sure `gcloud` points to the cert-manager-release project:
9387

9488
```bash
9589
gcloud config set project cert-manager-release
9690
export CLOUDSDK_CORE_PROJECT=cert-manager-release # this is used by cmrel
9791
```
9892

99-
7. Get a GitHub access token [here](https://github.com/settings/tokens)
100-
with no scope ticked. It is used only by the `release-notes` CLI to
101-
avoid API rate limiting since it will go through all the PRs one by one.
93+
6. Get a GitHub access token [here](https://github.com/settings/tokens)
94+
with no scope ticked. It is required only to avoid API rate limiting
95+
when generating release notes.
10296

103-
8. Ensure that you have `gsutil` installed; it's part of the Google Cloud SDK.
97+
7. Ensure that you have `gsutil` installed; it's part of the Google Cloud SDK.
10498
105-
9. Ensure you have `cosign` installed. See [the cosign installation instructions](https://docs.sigstore.dev/cosign/system_config/installation/).
99+
8. Ensure you have `cosign` installed. See [the cosign installation instructions](https://docs.sigstore.dev/cosign/system_config/installation/).
106100
107-
10. Ensure you have permissions to push to the OCI Helm chart registry, `quay.io/jetstack/charts`. You may need to run commands from [Helm's documentation](https://helm.sh/docs/topics/registries/#commands-for-working-with-registries).
101+
9. Ensure you have permissions to push to the OCI Helm chart registry, `quay.io/jetstack/charts`. You may need to run commands from [Helm's documentation](https://helm.sh/docs/topics/registries/#commands-for-working-with-registries).
108102
Specifically, you will need to have run `helm registry login -u=USERNAME -p=PASSWORD quay.io` to authenticate with the registry.
109103
Credentials can be obtained from the `quay.io` web UI if you're already a member of the `jetstack` organization on Quay.
110104
@@ -139,45 +133,13 @@ page if a step is missing or if it is outdated.
139133
140134
[^1]: One or more "patch pre-releases" may be created to allow voluntary community testing of a bug fix or security fix before the fix is made generally available. The suffix `-beta` must be used for patch pre-releases.
141135
142-
2. Set the 4 environment variables by copying the following snippet in your
143-
shell table:
136+
2. Set the `RELEASE_VERSION` environment variable by pasting the following snippet into your
137+
shell:
144138
145139
```bash
146140
export RELEASE_VERSION="v1.3.0-alpha.0"
147-
export START_TAG="v1.2.0"
148-
export END_REV="release-1.3"
149-
export BRANCH="release-1.3"
150141
```
151142
152-
> **Note:** To help you fill in the correct values, use the following
153-
> examples:
154-
>
155-
> | Variable | Example 1 | Example 2 | Example 2 | Example 3 | Example 4 |
156-
> | ----------------- | ---------------- | ---------------- | ---------------- | ------------- | ------------- |
157-
> | | initial alpha | subsequent alpha | beta release | final release | patch release |
158-
> | `RELEASE_VERSION` | `v1.3.0-alpha.0` | `v1.3.0-alpha.1` | `v1.3.0-beta.0` | `v1.3.0` | `v1.3.1` |
159-
> | `START_TAG` | `v1.2.0` | `v1.3.0-alpha.0` | `v1.3.0-alpha.1` | `v1.2.0`\* | `v1.3.0` |
160-
> | `END_REV` | `master` | `master` | `release-1.3` | `release-1.3` | `release-1.3` |
161-
> | `BRANCH` | `master` | `master` | `release-1.3` | `release-1.3` | `release-1.3` |
162-
>
163-
> \*Do not use a patch here (e.g., no `v1.2.3`). It must be `v1.2.0`:
164-
> you must use the latest tag that belongs to the release branch you are
165-
> releasing on; in the above example, the release branch is
166-
> `release-1.3`, and the latest tag on that branch is `v1.2.0`.
167-
168-
> **Note:** The 4 variables are described in [the README of the
169-
`release-notes`
170-
tool](https://github.com/kubernetes/release/blob/master/cmd/release-notes/README.md#options).
171-
For your convenience, the following table summarizes what you need to know:
172-
>
173-
> | Variable | Description |
174-
> | ----------------- | --------------------------------------- |
175-
> | `RELEASE_VERSION` | The git tag |
176-
> | `START_TAG`\* | The git tag of the "previous"\* release |
177-
> | `END_REV` | Name of your release branch (inclusive) |
178-
> | `BRANCH` | Name of your release branch |
179-
180-
181143
3. (**final release**) Prepare the "Docs Freeze" PR
182144
183145
**⚠️ This step can be done ahead of time.**
@@ -191,84 +153,66 @@ page if a step is missing or if it is outdated.
191153
192154
4. (**final + patch releases**) Prepare the "Release Notes" PR.
193155
194-
**⚠️ This step can be done ahead of time.**
156+
**⚠️ This step can be done ahead of time, even before the release tag is created.**
195157
196-
Create a PR on the website titled "Release And Upgrade Notes".
158+
Create a PR on the website titled "Release And Upgrade Notes".
197159
198-
- If you are doing a **final release**, then this PR's base must be the `release-next` branch.
199-
- If you are doing a **patch release**, then this PR's base must be `master`.
200-
201-
To craft this PR, you will need to do the following:
202-
203-
1. Generate `github-release-description.md` and `website-release-notes.md` with the following commands:
204-
205-
```bash
206-
# Must be run from the cert-manager folder.
207-
export GITHUB_TOKEN=$(gh auth token)
208-
git fetch origin $BRANCH
209-
export START_SHA="$(git rev-list --reverse --ancestry-path $(git merge-base $START_TAG $BRANCH)..$BRANCH | head -1)"
210-
release-notes --debug --repo-path cert-manager \
211-
--org cert-manager --repo cert-manager \
212-
--required-author "cert-manager-prow[bot]" \
213-
--markdown-links=false \
214-
--dependencies=false \
215-
--output github-release-description.md
216-
release-notes --debug --repo-path cert-manager \
217-
--org cert-manager --repo cert-manager \
218-
--required-author "cert-manager-prow[bot]" \
219-
--markdown-links=true \
220-
--dependencies=false \
221-
--output website-release-notes.md
222-
```
160+
- If you are doing a **final release**, then this PR's base must be the `release-next` branch.
161+
- If you are doing a **patch release**, then this PR's base must be `master`.
223162
224-
:::info
163+
To craft this PR, you will need to do the following:
225164
226-
The GitHub token **does not need any scope**. The token is required
227-
only to avoid rate-limits imposed on anonymous API users.
165+
1. In the website repo, run the following command to generate the release notes:
228166
229-
:::
167+
```bash
168+
# Must be run from the website repo folder.
169+
# Set GITHUB_TOKEN to avoid API rate limits.
170+
export GITHUB_TOKEN=$(gh auth token)
171+
make generate-release-notes CERT_MANAGER_VERSION=v1.20.0
172+
```
230173
231-
2. Prepare a short summary of the contents of the release which will be used
232-
for both the GitHub Release and the website release notes.
174+
The tool automatically selects the best end revision: it tries the
175+
release tag first, then the release branch (`release-1.20`), then
176+
falls back to `master`. This means it works before the tag is created.
233177
234-
3. Update the relevant release notes file on the website repo to include the
235-
contents of `website-release-notes.md`.
178+
2. Review the generated file
179+
`content/docs/releases/release-notes/release-notes-1.20.md`.
180+
For each changelog entry, check that it follows the
181+
[release-note guidelines](../contributing/contributing-flow.md#release-note-guidelines).
182+
If you find a changelog entry that doesn't follow the guidelines:
183+
- Go to that PR and edit the PR description to update the `release-note` block.
184+
- Re-run `make generate-release-notes CERT_MANAGER_VERSION=v1.20.0`.
236185

237-
4. (**final release**) Move the generated `website-release-notes.md` to
238-
`content/docs/release-notes/release-notes-1.20.md`. Make sure to edit it
239-
to match the format of our past release notes.
186+
3. Edit the `{/* BEGIN summary */}` and `{/* BEGIN themes */}` sections in
187+
the generated release notes file, taking the previous release notes as an example.
240188

241-
5. (**patch release**) Add the contents of the generated
242-
`website-release-notes.md` to a new section of the existing release,
243-
e.g., in `content/docs/release-notes/release-notes-1.20.md`.
189+
4. (**final release**) Create a new upgrading guide:
244190

245-
6. (**final release**) Create a new file:
191+
```text
192+
content/docs/releases/upgrading/upgrading-1.19-1.20.md
193+
```
246194

247-
```text
248-
content/docs/releases/upgrading/upgrading-1.19-1.20.md
195+
See for
196+
example: [upgrading-1.0-1.1](https://cert-manager.io/docs/releases/upgrading/upgrading-1.0-1.1.md).
197+
198+
5. (**first pre-release only**) Add an entry to `content/docs/manifest.json` for the new release note file:
199+
200+
```jsonc
201+
{
202+
"routes": [
203+
// ...
204+
{
205+
"title": "Upgrade 1.19 to 1.20",
206+
"path": "/docs/releases/upgrading/upgrading-1.19-1.20.md"
207+
},
208+
{
209+
"title": "1.20",
210+
"path": "/docs/releases/release-notes/release-notes-1.20.md"
211+
}
212+
]
213+
}
249214
```
250215

251-
See for
252-
example: [upgrading-1.0-1.1](https://cert-manager.io/docs/releases/upgrading/upgrading-1.0-1.1.md).
253-
254-
7. (**final release**) Add an entry to `content/docs/manifest.json` for the new release note file:
255-
256-
```jsonc
257-
{
258-
"routes": [
259-
// ...
260-
{
261-
"title": "Upgrade 1.19 to 1.20",
262-
"path": "/docs/releases/upgrading/upgrading-1.19-1.20.md"
263-
},
264-
{
265-
"title": "1.20",
266-
"path": "/docs/releases/release-notes/release-notes-1.20.md"
267-
}
268-
]
269-
}
270-
```
271-
272216
5. (**final + patch releases**) Prepare the "Version Bumps" PR:
273217

274218
**⚠️ This step can be done ahead of time.**
@@ -461,11 +405,21 @@ page if a step is missing or if it is outdated.
461405
462406
:::
463407
464-
11. Publish the GitHub release:
408+
11. If you have not already done so in step 4, re-run `make generate-release-notes`
409+
now that the tag exists to pick up any PRs merged after your earlier run:
410+
411+
```bash
412+
# Must be run from the website repo folder.
413+
export GITHUB_TOKEN=$(gh auth token)
414+
make generate-release-notes CERT_MANAGER_VERSION=$RELEASE_VERSION
415+
```
416+
417+
12. Publish the GitHub release:
465418
466-
1. Visit the draft GitHub release and paste `github-release-description.md` that you
467-
generated earlier. You will need to manually edit the content to match
468-
the style of earlier releases and to explain what's in the release.
419+
1. Visit the draft GitHub release and paste in the release notes from
420+
`content/docs/releases/release-notes/release-notes-X.Y.md` that you
421+
generated in step 4 or step 11. You will need to manually edit the
422+
content to match the style of earlier releases.
469423
470424
2. **(initial alpha, subsequent alpha and beta only)** Tick the box "This is
471425
a pre-release".
@@ -475,7 +429,7 @@ page if a step is missing or if it is outdated.
475429
476430
4. Click "Publish" to make the GitHub release live.
477431
478-
12. Merge the pull request containing the Helm chart:
432+
13. Merge the pull request containing the Helm chart:
479433
480434
Important: This PR can currently only be merged by Palo Alto employees, but we're aiming to fix that soon. Changing this
481435
will involve us coming up with a plan for migrating where our Helm charts are stored and ensuring we don't break anyone.
@@ -496,7 +450,7 @@ page if a step is missing or if it is outdated.
496450
5. Merge the PR
497451
6. Check that the [cert-manager Helm chart is visible on ArtifactHUB](https://artifacthub.io/packages/helm/cert-manager/cert-manager).
498452
499-
13. Upload the Helm chart to the OCI registry:
453+
14. Upload the Helm chart to the OCI registry:
500454
501455
1. Run the following command to upload the Helm chart to the OCI registry, and sign it with cosign:
502456
@@ -515,9 +469,9 @@ page if a step is missing or if it is outdated.
515469
516470
Look for config, content and provenance layers in the output.
517471
518-
14. (**final releases**) Merge the "Docs Freeze" PR.
472+
15. (**final releases**) Merge the "Docs Freeze" PR.
519473
520-
15. (**final + patch releases**) Merge website PRs.
474+
16. (**final + patch releases**) Merge website PRs.
521475
522476
1. Merge the "Release Notes" PR and "Bump Versions" PR.
523477
2. Create the PR "Merge release-next into master" by [clicking
@@ -534,7 +488,7 @@ page if a step is missing or if it is outdated.
534488
535489
[ff-release-next]: https://github.com/cert-manager/website/compare/master...release-next?quick_pull=1&title=%5BPost-Release%5D+Merge+release-next+into+master&body=%3C%21--%0A%0AThe+command+%22%2Foverride+dco%22+is+necessary+because+some+the+merge+commits%0Ahave+been+written+by+the+bot+and+do+not+have+a+DCO+signoff.%0A%0A--%3E%0A%0A%2Foverride+dco
536490
537-
16. Post a Slack message as a reply to the first message. Toggle the check
491+
17. Post a Slack message as a reply to the first message. Toggle the check
538492
box "Also send to `#cert-manager-dev`" so that the message is well
539493
visible. Also cross-post the message on `#cert-manager`.
540494
@@ -544,7 +498,7 @@ page if a step is missing or if it is outdated.
544498
545499
:::
546500
547-
17. **(final release only)** Show the release to the world:
501+
18. **(final release only)** Show the release to the world:
548502
549503
1. Send an email to
550504
[`cert-manager-dev@googlegroups.com`](https://groups.google.com/g/cert-manager-dev)
@@ -560,7 +514,7 @@ page if a step is missing or if it is outdated.
560514
4. Create a post on the cert-manager BlueSky account! Login details are in the cert-manager 1password.
561515
([Example post](https://bsky.app/profile/cert-manager.bsky.social/post/3lhdtn7c2222u))
562516
563-
18. Proceed to the post-release "testing and release" steps:
517+
19. Proceed to the post-release "testing and release" steps:
564518
565519
1. **(initial beta only)** Create a PR on
566520
[cert-manager/testing](https://github.com/cert-manager/testing) in order to

0 commit comments

Comments
 (0)