Release tooling to automate releases and GHA pipeline to build operat…#317
Release tooling to automate releases and GHA pipeline to build operat…#317SpaceFace02 wants to merge 1 commit into
Conversation
…or images Signed-off-by: Chirag Rao <crao@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: SpaceFace02 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideAutomates the operator release process by adding a release preparation script, a GitHub Actions workflow to build and push images on semver tags, and aligning image/version handling across the operator code, CSV bundle, Makefile, and README with v-prefixed image tags and bare semver bundle versions. Flow diagram for the automated operator release processflowchart LR
Dev["Developer runs make prepare-release VERSION=MAJOR.MINOR.PATCH"] --> PRS["scripts/prepare-release.sh VERSION"]
PRS -->|updates| CargoToml["Workspace Cargo.toml versions"]
PRS -->|updates| CSV["trusted-cluster-operator CSV bundle"]
PRS -->|updates| README["README TAG and note"]
PRS -->|refreshes| CargoLock["Cargo.lock"]
Dev --> Commit["git commit -am 'Release VERSION'"]
Commit --> Tag["git tag VERSION"]
Tag --> Push["git push origin main VERSION"]
Push --> GH["GitHub push event on semver tag"]
GH --> WF["release workflow (.github/workflows/release.yml)"]
WF --> Go["actions/setup-go (install Go)"]
WF --> Yq["go install yq v4"]
WF --> OSdk["Download operator-sdk v1.39.1"]
WF --> QuayLogin["docker/login-action to Quay.io"]
WF --> MakePushAll["make push-all TAG=v${github.ref_name}"]
MakePushAll --> Images["Build & push operator + component images (v-prefixed tags)"]
MakePushAll --> Bundle["Build & push OLM bundle using OLM_VERSION (bare semver)"]
WF --> GHRelease["softprops/action-gh-release (GitHub Release)"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Aims to fix #286, and other enhancements. |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The tag filter in .github/workflows/release.yml uses a regex-style pattern ('[0-9]+.[0-9]+.[0-9]+'), but GitHub’s tag filters are glob-based; consider switching to something like '..*' so releases actually trigger on semver tags.
- TRUSTEE_VERSION and COMPONENT_VERSION now use option_env!/env! in consts, which bakes values in at build time; if these are intended to be configurable per deployment, consider reading from std::env::var at runtime instead.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The tag filter in .github/workflows/release.yml uses a regex-style pattern ('[0-9]+.[0-9]+.[0-9]+'), but GitHub’s tag filters are glob-based; consider switching to something like '*.*.*' so releases actually trigger on semver tags.
- TRUSTEE_VERSION and COMPONENT_VERSION now use option_env!/env! in consts, which bakes values in at build time; if these are intended to be configurable per deployment, consider reading from std::env::var at runtime instead.
## Individual Comments
### Comment 1
<location path=".github/workflows/release.yml" line_range="7-8" />
<code_context>
+
+name: "Release"
+on:
+ push:
+ tags:
+ - "[0-9]+.[0-9]+.[0-9]+"
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The tag filter pattern is treated as a glob, not a regex, so `"[0-9]+.[0-9]+.[0-9]+"` won’t match version tags as intended.
`on.push.tags` uses glob matching, so `"[0-9]+.[0-9]+.[0-9]+"` will only match tags that literally contain `[` and `+`. To trigger on semantic version tags like `0.2.1`, use a glob such as `"*.*.*"` (or a set of more specific glob patterns) instead of a regex-style pattern.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| push: | ||
| tags: |
There was a problem hiding this comment.
issue (bug_risk): The tag filter pattern is treated as a glob, not a regex, so "[0-9]+.[0-9]+.[0-9]+" won’t match version tags as intended.
on.push.tags uses glob matching, so "[0-9]+.[0-9]+.[0-9]+" will only match tags that literally contain [ and +. To trigger on semantic version tags like 0.2.1, use a glob such as "*.*.*" (or a set of more specific glob patterns) instead of a regex-style pattern.
This PR aims to improve the release workflow of the operator, by introducing helper scripts, GHA pipeline to build and push operator images and other release improvements.
Summary by Sourcery
Automate the operator release process by introducing version-aware defaults, a prepare-release script, and a GitHub Actions workflow that builds and publishes images and OLM bundles from tagged releases.
New Features:
Enhancements:
CI:
Documentation: