Skip to content

Commit 194d5c6

Browse files
authored
Merge pull request #622 from furkatgofurov7/improve-release-notes
📖 Improve release notes with additional information
2 parents d630332 + 2f886a1 commit 194d5c6

File tree

2 files changed

+71
-27
lines changed

2 files changed

+71
-27
lines changed

docs/book/src/04_developer/01_release.md

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
11
# Releasing New Versions
22

3+
## Cut a release
4+
35
This document describes the release process for the Cluster API Operator.
46

5-
1. Create a new release branch and cut a release tag.
7+
1. Clone the repository locally:
68

79
```bash
8-
git checkout -b release-0.1
9-
git push -u upstream release-0.1
10+
git clone [email protected]:kubernetes-sigs/cluster-api-operator.git
1011
```
1112

12-
```bash
13-
# Export the tag of the release to be cut, e.g.:
14-
export RELEASE_TAG=v0.1.1
13+
2. Depending on whether you are cutting a minor/major or patch release, the process varies.
14+
15+
* If you are cutting a new minor/major release:
16+
17+
Create a new release branch (i.e release-X) and push it to the upstream repository.
1518

19+
```bash
20+
# Note: `upstream` must be the remote pointing to `github.com:kubernetes-sigs/cluster-api-operator`.
21+
git checkout -b release-0.14
22+
git push -u upstream release-0.14
23+
# Export the tag of the minor/major release to be cut, e.g.:
24+
export RELEASE_TAG=v0.14.0
25+
```
26+
* If you are cutting a patch release from an existing release branch:
27+
28+
Use existing release branch.
29+
30+
```bash
31+
# Note: `upstream` must be the remote pointing to `github.com:kubernetes-sigs/cluster-api-operator`
32+
git checkout upstream/release-0.14
33+
# Export the tag of the patch release to be cut, e.g.:
34+
export RELEASE_TAG=v0.14.1
35+
```
36+
37+
3. Create a signed/annotated tag and push it:
38+
39+
```bash
1640
# Create tags locally
1741
# Warning: The test tag MUST NOT be an annotated tag.
1842
git tag -s -a ${RELEASE_TAG} -m ${RELEASE_TAG}
@@ -26,55 +50,75 @@ git push upstream test/${RELEASE_TAG}
2650

2751
**Note:** You may encounter an ioctl error during tagging. To resolve this, you need to set the GPG_TTY environment variable as `export GPG_TTY=$(tty)`.
2852

29-
This will trigger a [release GitHub action](https://github.com/kubernetes-sigs/cluster-api-operator/blob/main/.github/workflows/release.yaml) that creates a release with operator components and the Helm chart. Concurrently, a Prow job will start to publish operator images to the staging registry.
53+
This will trigger a [release GitHub action](https://github.com/kubernetes-sigs/cluster-api-operator/actions/workflows/release.yaml) that creates a release with operator components and the Helm chart. Concurrently, a Prow job will start to publish operator images to the staging registry.
3054

31-
2. Wait for the images to appear in the [staging registry](https://console.cloud.google.com/gcr/images/k8s-staging-capi-operator/global/cluster-api-operator).
55+
4. Wait until images for the tag have been built and pushed to the [staging registry](https://console.cloud.google.com/gcr/images/k8s-staging-capi-operator/global/cluster-api-operator) by the [post push images job](https://prow.k8s.io/?repo=kubernetes-sigs%2Fcluster-api-operator&job=post-cluster-api-operator-push-images).
3256

33-
3. Create a GitHub [Personal access token](https://github.com/settings/tokens) if you don't already have one. We're going to use this for opening a PR to promote the images from staging to production.
57+
5. If you don't have a GitHub token, create one by navigating to your GitHub settings, in [Personal access token](https://github.com/settings/tokens). Make sure you give the token the `repo` scope.
58+
59+
6. Create a PR to promote the images to the production registry:
3460
3561
```bash
62+
# Export the tag of the release to be cut, e.g.:
3663
export GITHUB_TOKEN=<your GH token>
3764
export USER_FORK=<your GH account name>
3865
make promote-images
3966
```
4067
41-
After it has been tested, merge the PR and verify that the image is present in the production registry.
68+
**Notes**:
69+
* `make promote-images` target tries to figure out your Github user handle in order to find the forked [k8s.io](https://github.com/kubernetes/k8s.io) repository.
70+
If you have not forked the repo, please do it before running the Makefile target.
71+
* `kpromo` uses `[email protected]:...` as remote to push the branch for the PR. If you don't have `ssh` set up you can configure
72+
git to use `https` instead via `git config --global url."https://github.com/".insteadOf [email protected]:`.
73+
* This will automatically create a PR in [k8s.io](https://github.com/kubernetes/k8s.io) and assign the CAPI Operator maintainers.
74+
75+
76+
7. Merge the PR (/lgtm + /hold cancel) and verify the images are available in the production registry:
77+
* Wait for the [promotion prow job](https://prow.k8s.io/?repo=kubernetes%2Fk8s.io&job=post-k8sio-image-promo) to complete successfully. Then test the production image is accessible:
4278

4379
```bash
4480
docker pull registry.k8s.io/capi-operator/cluster-api-operator:${RELEASE_TAG}
4581
```
4682

47-
4. Switch back to the main branch and update `index.yaml` and `clusterctl-operator.yaml`. These are the sources for the operator Helm chart repository and the local krew plugin manifest index, respectively.
83+
8. Publish the release in GitHub:
84+
85+
* The draft release should be automatically created via the [release GitHub Action](https://github.com/kubernetes-sigs/cluster-api-operator/actions/workflows/release.yaml). Make sure that release is flagged as `pre-release` for all `beta` and `rc` releases or `latest` for a new release in the most recent release branch.
86+
87+
:tada: CONGRATULATIONS! The new [release](https://github.com/kubernetes-sigs/cluster-api-operator/releases) of CAPI Operator should be live now!!! :tada:
88+
89+
Please proceed to mandatory post release steps [next](#post-release-steps).
90+
91+
## Post-release steps
92+
93+
1. Switch back to the main branch and update `index.yaml` and `clusterctl-operator.yaml`. These are the sources for the operator Helm chart repository and the local krew plugin manifest index, respectively.
4894

4995
```bash
5096
git checkout main
5197
make update-helm-plugin-repo
5298
```
5399

54-
5. Create a PR with the changes.
100+
2. Once run successfully, it will automatically create a PR against the operator repository with all the needed changes.
55101

56-
6. In case this is a minor or major version release, update `test-infra` jobs for the new `release-x.x` branch. This will require updating dashboard pointer to use updated presubmit spec per the detailed [description](#setup-jobs-and-dashboards-for-a-new-release-branch).
102+
3. Depending on whether you are cutting a minor/major or patch release, next steps might be needed or redundant. Please follow along the next [chapter](#setup-jobs-and-dashboards-for-a-new-release-branch), in case this is a minor or major version release.
57103

58104
## Setup jobs and dashboards for a new release branch
59-
105+
60106
The goal of this task is to have test coverage for the new release branch and results in testgrid.
61-
We are currently running CI jobs only in main and latest stable release branch (i.e release-0.5 will be used as an example below) and all configurations are hosted in test-infra [repo](https://github.com/kubernetes/test-infra).
107+
We are currently running CI jobs only in main and latest stable release branch (i.e release-0.14 is last minor release branch we created in earlier steps) and all configurations are hosted in test-infra [repository](https://github.com/kubernetes/test-infra). In this example, we will update `test-infra` repository jobs to track the new `release-0.14` branch.
62108

63109
1. Create new jobs based on the jobs running against our `main` branch:
64-
1. Copy `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-periodics-main.yaml` to `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-periodics-release-0-5.yaml`.
65-
2. Copy `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-presubmits-main.yaml` to `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-presubmits-release-0-5.yaml`.
110+
1. Rename `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-periodics-release-0-13.yaml` to `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-periodics-release-0-14.yaml`.
111+
2. Rename `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-presubmits-release-0-13.yaml` to `test-infra/config/jobs/kubernetes-sigs/cluster-api-operator/cluster-api-operator-presubmits-release-0-14.yaml`.
66112
3. Modify the following:
67-
1. Rename the jobs, e.g.: `periodic-cluster-api-operator-test-main` => `periodic-cluster-api-operator-test-release-0-5`.
68-
2. Change `annotations.testgrid-dashboards` to `sig-cluster-lifecycle-cluster-api-operator-0.5`.
69-
3. Change `annotations.testgrid-tab-name`, e.g. `capi-operator-test-main` => `capi-operator-test-release-0-5`.
113+
1. Rename the jobs, e.g.: `periodic-cluster-api-operator-test-release-0-13` => `periodic-cluster-api-operator-test-release-0-14`.
114+
2. Change `annotations.testgrid-dashboards` to `sig-cluster-lifecycle-cluster-api-operator-0.14`.
115+
3. Change `annotations.testgrid-tab-name`, e.g. `capi-operator-test-release-0-13` => `capi-operator-test-release-0-14`.
70116
4. For periodics additionally:
71-
* Change `extra_refs[].base_ref` to `release-0.5` (for repo: `cluster-api-operator`).
72-
5. For presubmits additionally: Adjust branches: `^main$` => `^release-0.5$`.
117+
* Change `extra_refs[].base_ref` to `release-0.14` (for repo: `cluster-api-operator`).
118+
5. For presubmits additionally: Adjust branches: `^release-0.13$` => `^release-0.14$`.
73119
2. Create a new dashboard for the new branch in: `test-infra/config/testgrids/kubernetes/sig-cluster-lifecycle/config.yaml` (`dashboard_groups` and `dashboards`).
74-
* Add a new entry `sig-cluster-lifecycle-cluster-api-operator-0.5` in both `dashboard_groups` and `dashboards` lists.
75-
3. Remove tests for previous release branch.
76-
* For example, let's assume we just created tests for v0.5, then we can now drop test coverage for the release-0.4 branch.
77-
4. Verify the jobs and dashboards a day later by taking a look at: `https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api-operator-0.5`.
120+
* Modify a previous job entry: `sig-cluster-lifecycle-cluster-api-operator-0.13` => `sig-cluster-lifecycle-cluster-api-operator-0.14` in both `dashboard_groups` and `dashboards` lists.
121+
3. Verify the jobs and dashboards a day later by taking a look at: `https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api-operator-0.14`.
78122

79123
Prior art:
80124
- https://github.com/kubernetes/test-infra/pull/30372

hack/publish-index-changes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RELEASE_TAG="$1"
99
BRANCH_NAME="index-${RELEASE_TAG}"
1010
COMMIT_MESSAGE="This PR updates index.yaml for ${RELEASE_TAG}. Automatically generated by make update-helm-repo."
1111
PR_TITLE="🌱 Update helm chart index.yaml to ${RELEASE_TAG}"
12-
PR_DESCRIPTION="**What this PR does / why we need it:**\n\nThis PR updates index.yaml for ${RELEASE_TAG}. Automatically generated by \`make update-helm-repo\`."
12+
PR_DESCRIPTION=$(printf "**What this PR does / why we need it:**\n\nThis PR updates index.yaml for ${RELEASE_TAG}.\n\nAutomatically generated by \`make update-helm-repo\`.")
1313

1414
# Checkout index-${RELEASE_TAG} branch
1515
git checkout -b "${BRANCH_NAME}"

0 commit comments

Comments
 (0)