Skip to content

Commit 6c280ac

Browse files
josvazgs-urbaniak
andauthored
CLOUDP-230380: Improve Release documentation (#1537)
* CLOUDP-230380: Improve Release documentation * Apply suggestions from code review Co-authored-by: Sergiusz Urbaniak <[email protected]> * Move preparations as prerequisites --------- Co-authored-by: Sergiusz Urbaniak <[email protected]>
1 parent 9c8560a commit 6c280ac

File tree

1 file changed

+61
-15
lines changed

1 file changed

+61
-15
lines changed

docs/dev/release.md

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
# Atlas Operator Release Instructions
22

3+
For the various PRs involved, seek at least someone else to approve. In case of doubts, engage the team member(s) who might be able to clarify and seek their review as well.
4+
5+
## Prerequisites
6+
7+
To get PRs to be auto-committed for RedHat community & Openshift you need to make sure you are listed in the [team members ci.yaml list for community-operators](https://github.com/k8s-operatorhub/community-operators/blob/main/operators/mongodb-atlas-kubernetes/ci.yaml) and [team members ci.yaml list for community-operators-prod](https://github.com/redhat-openshift-ecosystem/community-operators-prod/blob/main/operators/mongodb-atlas-kubernetes/ci.yaml).
8+
9+
This is not required for [Certified Operators](https://github.com/redhat-openshift-ecosystem/certified-operators/blob/main/operators/mongodb-atlas-kubernetes/ci.yaml).
10+
11+
Finally, make sure you have a "RedHat Connect" account and are a [team member with org administrator role in the team list](https://connect.redhat.com/account/team-members).
12+
313
## Create the release branch
414

5-
Use the GitHub UI to create the new "Release Branch" workflow. Specify the version to be released in the text box.
15+
Use the GitHub UI to create the new "Create Release Branch" workflow. Specify the version to be released in the text box.
616
The deployment scripts (K8s configs, OLM bundle) will be generated and PR will be created with new changes on behalf
717
of the `github-actions` bot.
818

9-
NOTE: The X- and Y- stream releases should only be launched using the workflow from the MAIN branch. Z-stream (patch)
10-
releases can be launched from a separate branch
11-
12-
The release creation will fail if the file `major-version` contents does not match the major version to be released. This file explicitly means the upcoming release is for a particular major version, with potential breaking changes. This allows us to:
13-
14-
1. Notice if we forgot to update the `major-version` file before releasing the next major version.
15-
2. Notice if we tried to re-release an older major version when the code is already prepared for the next major version.
16-
3. Skip some tests, like `helm update`, when crossing from one major version to the next, as such test is not expected to work across incompatible major version upgrades.
19+
Pass the version with the `X.Y.Z` eg. `1.2.3`, **without** the `v...` prefix.
1720

18-
If the create release branch job fails due an error such as `Bad major version for X... expected Y..`, review whether or not the `major-version` file was updated as expected. Check as well you are not trying to release a patch for the older major version from the new major version codebase.
21+
See [Troubleshooting](#troubleshooting) in case of issues, such as [errors with the major version](#major-version-issues-when-create-release-branch).
1922

2023
## Approve the Pull Request named "Release x.y.z"
2124

22-
Review the Pull Request. Approve and merge it to main.
25+
Review the Pull Request. Approve and merge it to `main`.
2326
The new job "Create Release" will be triggered and the following will be done:
24-
* Atlas Operator image built and pushed to dockerhub
27+
* Atlas Operator image is built and pushed to DockerHub
2528
* Draft Release will be created with all commits since the previous release
2629

27-
Once the Pull Request is approved, a tag is created out of the branch, which can then be discarded. A branch `release/X.Y.Z` will imply a tag `vX.Y.Z`, and `pre-release/X.Y.Z-...` will imply `vX.Y.Z-...`. The `tag.yml` workflow is the one responsible for creating such tag and triggering the release process workflow (`release-post-merge.yml`).
30+
The "Create Release Branch" workflow is going to create a Pull Request pointing to a `release/X.Y.Z` branch. Once approved and merged, automation is going to create a `vX.Y.Z` tag.
2831

2932
## Edit the Release Notes and publish the release
3033

31-
Follow the format described in the release-notes-template.md file. Publish the release.
34+
Follow the format described in the [release-notes-template.md](../release-notes/release-notes-template.md) file. Before publishing the release, keep the release in Draft and get an approval from the team and Product Management. Once approved, publish the release.
3235

3336
## Synchronize configuration changes with the Helm Charts
3437

@@ -49,7 +52,12 @@ All bundles/package manifests for Operators for operatorhub.io reside in the fol
4952

5053
### Fork/Update the community operators repositories
5154

52-
**Note**: this has to be done once only:
55+
**Note**: this has to be done once only.
56+
57+
First ensure your SSH keys in [https://github.com/settings/keys] are authorized for `mongodb-forks` MongoDB SSO.
58+
59+
Execute the following steps:
60+
5361
1. Clone each of the above forked OLM repositories from https://github.com/mongodb-forks
5462
2. Add `upstream` remotes
5563
3. Export each cloned repository directory in environment variables
@@ -145,6 +153,32 @@ You can see an [example fixed PR here for certified version 1.9.1](https://githu
145153

146154
After the PR is approved it will soon appear in the [Atlas Operator openshift cluster](https://console-openshift-console.apps.atlas.operator.mongokubernetes.com)
147155

156+
# SSDLC checklist publishing
157+
158+
For the time being, preparing the SSDLC checklist for each release is a manual process. Use this [past PR as a starting point](https://github.com/mongodb/mongodb-atlas-kubernetes/pull/1524).
159+
160+
Copy the closest [sdlc-compliance.md](../releases/v2.2.1/sdlc-compliance.md) file and:
161+
- Update the **version** references to the one being released.
162+
- Update dates and release creators of the current release.
163+
164+
Update the image signature instructions to match the current version.
165+
166+
Generate the `linux-amd64.sbom.json` and `linux-arm64.sbom.json` SBOM files and place them in the same directory as the compliance doc `docs/releases/vX.Y.Z`:
167+
168+
```shell
169+
docker sbom --platform "linux/${arch}" -o "docs/releases/v${version}/linux-${arch}.sbom.json" --format "cyclonedx-json" "$image"
170+
```
171+
172+
Where:
173+
- `${arch}` is the architecture to generate, either `amd64` or `arm64`.
174+
- `${version}` is the current version released in `X.Y.Z` format, without the **v** prefix.
175+
- `${image}` is the image reference released, usually something like `mongodb/mongodb-atlas-kubernetes-operator:${version}`.
176+
177+
Create a PR with the following new files included in the `releases/vX.Y.Z` directory:
178+
- `linux-amd64.sbom.json`
179+
- `linux-arm64.sbom.json`
180+
- `sdlc-compliance.md`
181+
148182
# Post install hook release
149183

150184
If changes have been made to the post install hook (mongodb-atlas-kubernetes/cmd/post-install/main.go).
@@ -171,3 +205,15 @@ git push
171205
```
172206

173207
If the release is a new minor version, then the CLI must be updated with the new version (and any new CRDs) [here](https://github.com/mongodb/mongodb-atlas-cli/blob/master/internal/kubernetes/operator/features/crds.go).
208+
209+
## Troubleshooting
210+
211+
### Major version issues when executing the "Create Release Branch" workflow
212+
213+
The release creation will fail if the file `major-version` contents does not match the major version to be released. This file explicitly means the upcoming release is for a particular major version, with potential breaking changes. This allows us to:
214+
215+
1. Notice if we forgot to update the `major-version` file before releasing the next major version.
216+
2. Notice if we tried to re-release an older major version when the code is already prepared for the next major version.
217+
3. Skip some tests, like `helm update`, when crossing from one major version to the next, as such test is not expected to work across incompatible major version upgrades.
218+
219+
If the create release branch job fails due an error such as `Bad major version for X... expected Y..`, review whether or not the `major-version` file was updated as expected. Check as well you are not trying to release a patch for the older major version from the new major version codebase.

0 commit comments

Comments
 (0)