-
Notifications
You must be signed in to change notification settings - Fork 20
release process
Table of Contents
- Release Processes
The Red Hat Marketplace operator uses a branch model called git-flow for release management.
You can read more about git flow here and there is a handy cheat sheet here.
To perform all the actions for automatic install you will need to have the git flow plugin installed locally.
Once the plugin is installed, run this command:
git flow init -d
This will set up the plugin with the default rules we use.
branch | use |
---|---|
master | Master branch is current stable version. |
develop | Develop branch is where all future work is branched from and merged to. |
feature/* | Feature branches for future work. Start off develop. |
bugfix/* | Bug fixes for the next release. Lower priority. Branch from develop. |
hotfix/* | Hot fix for production code. High priority. Branch from master. |
release/* | Release branches for the next release. Hotfix is also a release branch. Can only be one. Branch from develop. |
When enough features are ready, a release branch is created off of develop. Release branch is worked until all testing is completed as a beta release. Once the beta release is stable, the release is merged into master. Merge to master creates the next official stable release.
Hotfixes are started off of master. Bugfixes off of stable.
Here is a convenient flow chart to use for releasing:
-
Sync your master branch.
git fetch git checkout master git pull
-
Start from 'develop' branch.
git checkout develop git pull
-
Run
git flow release start $(make current-version) git flow release publish
A new branch called release/x.x.x will be made for you and pushed to the repository.
-
Once the branch is pushed, a PR will be generated for you.
-
The build will build and push images. Different workflows will generate assets for you to use as well.
- test-catalog-source.yaml is generated to allow local testing before publishing
- bundles for submission to Partner Connect are also generated
- results from operator-sdk scorecard tests
-
Once the PR checks finish, verify the checks for the PR are passing.
-
Test the newly generated bundles using the
test-catalog-source
. For more info see testing latest build. -
Test the build against the certification pipeline
- Login with kubeadmin context to a certification cluster
- Check all nodes are up and healthy
oc get nodes
- Set the TAG to the build of the release branch
- Set the PYXIS_API_KEY
- Run the certification pipeline using the script. Accept all defaults when prompted.
export TAG=2.5.0-839 export IMAGE_REGISTRY=quay.io/rh-marketplace export PYXIS_API_KEY=YOURKEY make operator/test-certify
-
Resolve any issues reported by the certification pipeline. Troubleshooting
-
When the release PR is approved and testing complete, publish the bundle by submitting it using the certification pipeline
-
Authorizing a GITHUB_TOKEN
export TAG=2.5.0-839 export IMAGE_REGISTRY=quay.io/rh-marketplace export PYXIS_API_KEY=YOURKEY export SUBMIT=true export GITHUB_TOKEN=YOURTOKEN make operator/test-certify
-
Authorizing a GITHUB_TOKEN
-
The pipeline submit opens a pull request
- If the pull request checks pass and is merged, the operator bundle is now published
- If the pull request checks fail, inspect for a reason, or open a ticket as appropriate
-
Merge the release PR.
-
A new tag with the release version will be created. Create a release in Github for this tag by selecting the tag and creating a release. See 0.1.2 for an example of the content.
-
A PR to merge master to develop will be gnerated. Merge this PR.
-
You're done. Spread the good news about a successful release.
Same as release, but change git flow commands to git flow hotfix
and start from master branch.
To do all the manual actions. You will need to have these additional local commands.
Warning: to do these steps you need pull/push access to master/develop branch. And admin access to the docker registry. Only to be done if github actions are down.
-
Start from 'develop' branch.
git checkout develop git pull
-
Run
git flow release start $(make current-version)
A new branch called release/x.x.x will be made for you and pushed to the repository.
-
Generate the csv files and commit them. The release branch should be used to create manifests for the beta channel. Updates to the bundle in Partner connect will only impact beta.
make generate-csv git add ./deploy/olm-catalog
-
Now you need to bundle the images for the release
export IMAGE_REGISTRY=quay.io/rh-marketplace export OPERATOR_IMAGE_TAG=$(make current-version) make build push publish-image bundle
-
Upload your bundle to partner connect. And publish it when it passes. The bundle command will leave a zip file for upload in the
./bundle
-
Publish your images in Partner Connect and wait for the Operator scans to pass.
-
If the operator scan fails, see the troubleshooting section. Otherwise finish the release.
-
Once the release is finished. Run these commands:
git flow release finish $(make current-version)
-
Create the release using the published tag. Notify #rhm-general channel.
Same as release, but change git flow commands to git flow hotfix
and start command from master branch.
Before releasing, we need to do a few steps in partner connect.
-
Go into Partner Connect
-
Navigate to the "Red Hat Marketplace Operator Image" project.
-
Find the tag associated to the release and publish it.
- To get to this UI, you'll need to select "Try our new interface link"
-
Download the bundle from the Generate Bundle action.
- Go to the checks > select "Generate Bundle" workflow > Select artifacts
- Download latest artifact with the prefix
stable-
- The bundle with
stable-
is for updating the stable channel. This is the one you will primarily use. - The bundle starting with
beta-
is for updating the beta channel. This not working on the Partner Connect side. - Also notice the bundle describes what it's deploying
bundle-s0.1.2-b0.1.2
says stable is version 0.1.2 and beta is 0.1.2. This helps verify you're not making mistake. - The zip file for the bundle has a zip file in it, you'll want to use it to deploy.
-
Then navigate to the "Red Hat Marketplace Operator" project.
-
Once inside the operator project, select
Operator Config
. -
Now upload the zip file included in the bundle you downloaded from the action download.
-
You'll need to make sure the image is published and all the scorecard tests pass.
-
If all the tests are passed and you're read, select publish and your new version of the operator will be released.
If your upload fails its scan, here are some common problems:
This is the last step in the process, normally it'll say quay.io/xx/xx@sha256... cannot be found. This normally means that the image you used was published in Partner Connect. Go back to the Updating Partner Connect and retry the first few steps. Investigating the image's sha may also be required. You can use the skopeo tool to inspect images for their digests running skopeo inspect docker://${YOUR_IMAGE}
.
We run the scorecard as well in our Deploy workflow. You'll want to verify that the results of our scorecards tests are valid as well. There can be some false-positive results so a particular test failing does not always mean it's a bad manifest. If the same test is failing, fixing it for our runs will likely fix it for the manifest scanning on Partner Connect.
Sometimes if the example CRs in 'deploy/crds' is updated to the same name as other resources we deploy then the test will fail. This failure normally comes through as xx resource already exists
. Double check the names are example- or otherwise unique.
You can ignore this one, will not stop certification.
On any branch build of Deploy, you can download an bundle index with just that release in it.
-
Go to checks > Select drop down for "Deploy OPM Index" under the "Deploy Image" workflow > Select Artifacts
-
Download the "test-catalog-source.yaml" artifact, unzip and apply the YAML to your cluster
-
Test source creates a new provider in Operator Hub. On Openshift <= 4.3, it will be under the "Custom" type. On Openshift 4.4 >= it will be "RHM Test".
-
To install latest, you will need to install the beta channel. It's best to install stable first then upgrade to beta at least once to verify upgrade.
Each workflow perform specific tasks on different branches. Together they help build and deliver software.
Workflow | Git Action | Branches | Description |
---|---|---|---|
Bump Version | Push | develop, hotfix/** | Bumps version when it detects a tag on develop that's already been created in git |
Create Manifest | Push | release/**, hotfix/** | Creates the new versions manifest and commits it to the branch |
Deploy | Push | master, develop, release/**, hotfix/**, feature/**, bugfix/** | |
Deploy/Deploy OPM* | Push | Same as deploy | Creates the bundle image for testing |
Deploy/Scorecard* | Push | Same as deploy | Runs the operator-sdk scorecard as is available on the Partner connect |
Generate Bundle | PR | master | Generate the bundle data as zip files for releasing to Partner Connect |
License | Push | All | Verifies all files have the appropriate license |
Release | Push | master | Tags new releases on master branch and creates sync from master to develop when new commits are present. |
Test | Push | All | Runs unit tests |