-
Notifications
You must be signed in to change notification settings - Fork 150
feat(release): add build & publish to release tool #4308
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
base: master
Are you sure you want to change the base?
Conversation
also adjust how skip validation flag since validation is needed for github token
+ list images in debug mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces new build and publish commands to the operator release tooling, unifying the workflow for both release and hashrelease operator versions. It adds support for creating hashreleases by directly specifying Calico/Enterprise versions instead of requiring a versions file, and enables automatic GitHub release creation during the publish process.
Key Changes
- Added
buildandpublishcommands that handle both release and hashrelease workflows with consistent patterns - Enhanced hashrelease creation to accept Calico/Enterprise versions directly via new flags (
--calico-version,--enterprise-version, etc.) - Integrated GitHub release creation into the publish workflow with draft/prerelease support
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
hack/release/build.go |
New build command implementing image building for releases and hashreleases with version/registry configuration |
hack/release/publish.go |
New publish command handling image publishing and optional GitHub release creation |
hack/release/public.go |
New github/public command for creating or updating GitHub releases independently |
hack/release/utils.go |
Added utility functions for handling trailing slashes, checking prerelease versions, and improved error messages |
hack/release/utils_test.go |
Added test coverage for new utility functions and updated existing tests with new function signatures |
hack/release/github.go |
Added GitHub release creation/update methods with draft and prerelease support |
hack/release/flags.go |
Added new flags for build/publish commands including registry, CRDs directories, and hashrelease-specific options |
hack/release/prep.go |
Updated to use new utility functions and added support for CRDs directory flags |
hack/release/from.go |
Updated error messages and modified to use new repository-aware config retrieval |
hack/release/releasenotes.go |
Added validation for GitHub token and improved output messaging |
hack/release/main.go |
Registered new build, publish, and public commands |
hack/release/README.md |
Added comprehensive documentation for new commands with usage examples |
RELEASING.md |
Updated release process documentation to reflect new tooling workflow |
Makefile |
Simplified release targets to use new CLI commands |
go.mod/go.sum |
Added google/go-containerregistry dependency for image registry interactions |
.semaphore/release.yml |
Updated pipeline name to "Operator Release" |
.semaphore/push_images.yml |
Renamed block from "Push Images / Maybe Release" to "Push Images" |
cmd/main.go |
Updated code comment reference to new build.go location |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Attempted to do a build, got some error messaging: There's no indication of why this is a problem or what to do about it. Running it again, I now see a different error for some reason: The "error message concatenated with a bunch of literal '\n'" is nearly impossible to read; is it possible to clean these errors up and print them in a more readable way? |
@danudey what did you run for the build. Also did you follow the readme? From the logs you included, it seems like you are trying to do a release build on a git hash with no tag. The second go around switched to using v1.42.1 (from v1.42.0) and not sure what you did to get more info in the error. For non-release build, either the Both attempt have this: Makefile:573: *** Attempt to build v1.42.1 from v1.42.0-0.dev-19-ga28a5204246a. Stop.This indicated that the failure is coming from the Makefile at line 573 which is a check that has existed in the repo since the release process was established. |
also attempted to improve error description when running commands.
I have updated the logrus text formatter to disable quote which should stop newlines from being escaped. However I find readablity is based on personal preferences; while I have made some adjustment in this PR, I think any further changes should be added outside of this PR. |
Description
This adds creating and publishing an operator version. It aligns the process for both a hashrelease operator version and a release operator version. For release operator version, it creates a github release if indicated.
For hashreleases, there is a new enhancement for creating a hashrelease by providing the calico and/or enterprise version in place of the versions file.
For PR reviewers
A note for code reviewers - all pull requests must have the following:
kind/bugif this is a bugfix.kind/enhancementif this is a a new feature.enterpriseif this PR applies to Calico Enterprise only.