-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ Add automation to create release branch and tags #9111
✨ Add automation to create release branch and tags #9111
Conversation
/cc @kubernetes-sigs/cluster-api-release-team |
@CecileRobertMichon: GitHub didn't allow me to request PR reviews from the following users: kubernetes-sigs/cluster-api-release-team. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
docs/release/release-tasks.md
Outdated
|
||
1. Checkout the latest commit on the release branch, e.g. `release-1.4`. | ||
1. Checkout the latest commit on the main branch. |
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.
this is important: the notes must be generated from and checked into the main branch
In theory this should work for all types of releases (alpha, beta, rc, .0, and patch) and I ran through all the scenarios but let me know if you can think of any issues with this...
We always checkout the release branch and fetch the release notes file from the CHANGELOG folder in the main branch in the GH action.
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.
I'm not sure how this target would pick up the RELEASE_TAG env var:
release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
if [ -n "${PRE_RELEASE}" ]; then \
echo ":rotating_light: This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api/issues/new)." > $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md; \
else \
go run ./hack/tools/release/notes.go --from=$(PREVIOUS_TAG) > $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md; \
fi
It always seems to generate notes from PREVIOUS_TAG until current commit?
I'm probably missing something
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.
That's a good question. @nawazkh @furkatgofurov7 does notes.go
always need to be run from the commit we're releasing from?
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.
Ok, I checked and you were correct @sbueringer, the notes tool will generate notes from PREVIOUS_TAG
to HEAD
so this means base notes need to be generated from the release branch still, clarified the instructions.
The PR should still be open in the main branch.
commitRange = lastTag()
cmd = exec.Command("git", "rev-list", commitRange+"..HEAD", "--merges", "--pretty=format:%B") //nolint:gosec
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.
Awesome job, thanks @CecileRobertMichon. This should help to release team activities a lot 🎉
Few nits/questions:
0fc499e
to
a4c75fb
Compare
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.
love this, thanks a lot @CecileRobertMichon
lgtm
a4c75fb
to
9b5d709
Compare
6b94de0
to
7acc241
Compare
Looks good to me, thanks for creating this automation! |
LGTM label has been added. Git tree hash: 9fb495e676e077787679450a9fffd5d54babd5f6
|
a6fdec7
to
a78d180
Compare
a78d180
to
305bcc2
Compare
/assign @vincepri |
Thank you very much! Really nice work :) /lgtm |
LGTM label has been added. Git tree hash: b4a8de39b61f87d43e883205d95aaa1777599311
|
if [[ $RELEASE_VERSION =~ beta ]] || [[ $RELEASE_VERSION =~ alpha ]]; then | ||
export RELEASE_BRANCH=main | ||
echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV | ||
echo "This is a beta or alpha release, will use release branch $RELEASE_BRANCH" |
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.
Do we need to handle RCs as well?
There might be an edge case I think here where we're curring beta/alphas on a specific release branch, rather than on the main one. Usually this is vey rare, or it might never happened; but might be good to document?
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.
RC is where the release branch gets created for the first time. alpha/beta are created from the main branch. This is documented in https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/release/release-cycle.md.
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.
Q: If I see correctly, in case we have some edge case we can always work around this action by just doing everything manually, right? (and then at the end add the changelog to the repo)
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.
Correct @sbueringer
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.
/lgtm
Looking forward to seeing this working!
I would say let's give it a few more days and if there are no objections until then merge on Monday |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
+100 |
@CecileRobertMichon Thank you very much for making this happen :) /hold cancel |
/area release |
What this PR does / why we need it: This adds automated release branch and release tags creation via the release github action to enable the CAPI release team to cut releases without needing the maintainers to cut the releases (maintainers still need to be involved to manually hit the "publish" button and to review the release notes PR).
The process becomes as follows:
Create Release
Action which will:This was tested extensively in my own fork with a different branch and fake/tags, you can see the latest passing run here
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #7128