Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated release operator workflow #1171

Merged

Conversation

didierofrivia
Copy link
Member

@didierofrivia didierofrivia commented Feb 24, 2025

This PR introduces an automated process for releasing the Kuadrant Operator. Similar to the previous one, one needs to provide the following inputs:

  • gitRef: Select the branch/tag/commit where you want to cut a release from.
  • kuadrantOperatorVersion: the Semantic Version of the desired release.
  • authorinoOperatorVersion: Authorino Operator bundle version (X.Y.Z)
  • limitadorOperatorVersion: Limitador Operator bundle version (X.Y.Z)
  • dnsOperatorVersion: DNS Operator bundle version (X.Y.Z)
  • wasmShimVersion: WASM Shim version (X.Y.Z)
  • consolePluginVersion: ConsolePlugin version (X.Y.Z)
  • olmChannel: This will set the OLM channels and default-channel.

But instead of tagging and creating the release automatically, instead it creates a PR in the same fashion that dictates the Manual Workflow

Verification steps
Sadly, it's not possible at the moment to fully check the workflow, since it needs to be merged to main and we might need to do some cleaning in our release branches before triggering it. But at the time being, we could use Act:

  1. With act installed, you can run the following command
act -j auto-release --secret KUADRANT_DEV_PAT=[CHECK IN BITWARDEN] --input gitRef=8d8a86fbf25a2e6d6ad8aacf0d62423c3055eb83 --input kuadrantOperatorVersion=1.0.3-alpha1 --input authorinoOperatorVersion=0.16.0 --input limitadorOperatorVersion=0.12.1 --input dnsOperatorVersion=0.12.0 --input consolePluginVersion=0.0.19 --input wasmShimVersion=0.8.1 --input olmChannel=alpha --container-architecture linux/amd64
  1. The output should be:
[Automated Release Operator/Release operator]   ✅  Success - Complete job
[Automated Release Operator/Release operator] 🏁  Job succeeded
  1. At the step Prepare release, you should see
| Updating release.yaml with desired versions
| release.yaml file updated as follows:
| kuadrant-operator:
|   version: "1.0.3-alpha1"
| olm:
|   channels:
|     - "alpha"
|   default-channel: "alpha"
| dependencies:
|   authorino-operator: "0.16.0"
|   console-plugin: "0.0.19"
|   dns-operator: "0.12.0"
|   limitador-operator: "0.12.1"
|   wasm-shim: "0.8.1"

and at the end of the step, the following:

| INFO[0000] All validation tests have completed successfully

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-process-enhancement@b0a573a). Learn more about missing BASE report.

Additional details and impacted files
@@                      Coverage Diff                       @@
##             release-process-enhancement    #1171   +/-   ##
==============================================================
  Coverage                               ?   83.67%           
==============================================================
  Files                                  ?       82           
  Lines                                  ?     7117           
  Branches                               ?        0           
==============================================================
  Hits                                   ?     5955           
  Misses                                 ?      933           
  Partials                               ?      229           
Flag Coverage Δ
bare-k8s-integration 23.65% <ø> (?)
controllers-integration 74.19% <ø> (?)
envoygateway-integration 41.81% <ø> (?)
gatewayapi-integration 20.09% <ø> (?)
istio-integration 43.95% <ø> (?)
unit 19.08% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
api/v1beta1 (u) 90.78% <0.00%> (?)
api/v1beta2 (u) ∅ <0.00%> (?)
pkg/common (u) ∅ <0.00%> (?)
pkg/istio (u) 62.06% <0.00%> (?)
pkg/log (u) 93.18% <0.00%> (?)
pkg/reconcilers (u) 24.50% <0.00%> (?)
pkg/rlptools (u) ∅ <0.00%> (?)
controllers (i) 86.70% <0.00%> (?)

@didierofrivia didierofrivia force-pushed the new-auto-release-workflow branch from 28367fd to 3a1c55c Compare February 26, 2025 19:17
@didierofrivia didierofrivia self-assigned this Feb 27, 2025
@didierofrivia didierofrivia added the kind/enhancement New feature or request label Feb 27, 2025
@didierofrivia didierofrivia force-pushed the new-auto-release-workflow branch from 3a1c55c to d1bac94 Compare February 27, 2025 16:11
@didierofrivia didierofrivia changed the title [wip] Automated release operator workflow Automated release operator workflow Feb 28, 2025
@didierofrivia didierofrivia marked this pull request as ready for review February 28, 2025 15:08
@didierofrivia didierofrivia requested a review from a team as a code owner February 28, 2025 15:08
@Boomatang Boomatang force-pushed the release-process-enhancement branch from 8d8a86f to b0a573a Compare March 3, 2025 16:02
Copy link
Contributor

@Boomatang Boomatang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Biggest concern is the creation of the pull request. It seems to be going to the wrong branch.

(.dependencies.console-plugin = strenv(CONSOLE_PLUGIN_VERSION)) |
(.dependencies.wasm-shim = strenv(WASM_SHIM_VERSION)) |
(.olm.default-channel = strenv(OLM_CHANNEL)) |
(.olm.channels[0] = strenv(OLM_CHANNEL))' -i ./release.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are saying there is only ever one channels. If it is a final release, as in going to the stable channel, would it not also be going on the alpha channel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I've seen in the OLM docs, they show, as you mentioned, that it's possible to release the same operator bundle under different channels...however, they also state that is up to the maintainer to chose the channels and more important the upgrade and channel promotions. So far we are not using their recommended channel naming other than stable, and from our part we've chosen to release anything else under alpha and in the past preview... I think either we still keep doing so, a simplistic way, or we will need to discuss how we will approach the upgrade and channel promotion for our operator. Maybe another question would be: Are we expecting to find an operator bundle that is released under alpha channel also be in the stable one and vice-versa? What would be the expectations of the OLM Subscriptions to those channels?

@didierofrivia didierofrivia force-pushed the new-auto-release-workflow branch 2 times, most recently from 48f9be4 to c391acd Compare March 4, 2025 09:46
@didierofrivia didierofrivia requested a review from Boomatang March 4, 2025 10:11
Copy link
Contributor

@Boomatang Boomatang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the sed command raises and interesting question. Should we be doing validation on the user input to ensure they are valid semver?

@didierofrivia didierofrivia force-pushed the new-auto-release-workflow branch from c391acd to aee7d43 Compare March 4, 2025 13:25
Comment on lines +22 to +23
### Notes
* It's not possible to cherry-pick commits, the workflow will pick a branch/tag/commit and all the history behind to the PR.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This related to this, would also affect the manual approach.

The PR is opened with the changes from the prepare-release, and some thing is missing from the release, lets say missing commit from main. That missing commit can be cherry picked to the branch which is the base targeting the release branch.

What should happen in that case? I am assuming the history of the base branch should be reordered to have the cherry picked commit before the release commit. The same would go for if during the review a wrong version is noticed. Would that be adding in a new commit or the release commit edited?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically any change in the history of the branch could be done in the PR, manually.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That I understand. The question would be should the history be reordered to ensure the Prepare release commit is the head of the branch?

@didierofrivia didierofrivia requested a review from Boomatang March 4, 2025 14:57
Copy link
Contributor

@Boomatang Boomatang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is looking good, could I ask you to tidy up the commit history and then I will approve it.

[ci] Setting OLM channel depending on prerelease input

[ci] Fixing yq cmd updating release.yaml

[ci] Fixing branching, prepare release scripts and dependencies

[ci] Creating CR release branch on `Create Pull Request` step

* Running Create Pull Request only if not triggered by ACT

* In order to set the desired channel and default channel
* Changed consolePlugin default to `0.0.0`
* Also descriptions of inputs to semver

[ci] Updated sed command to also work with `+build` tags

Signed-off-by: dd di cesare <[email protected]>
@didierofrivia didierofrivia force-pushed the new-auto-release-workflow branch from 3ff40f1 to 5fbc236 Compare March 4, 2025 15:06
@didierofrivia didierofrivia requested a review from Boomatang March 4, 2025 15:06
Copy link
Contributor

@Boomatang Boomatang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@didierofrivia didierofrivia merged commit e35af00 into release-process-enhancement Mar 4, 2025
28 checks passed
@didierofrivia didierofrivia deleted the new-auto-release-workflow branch March 4, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants