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

🌱 Determine release type from tag to also handle beta releases #10324

Merged

Conversation

tobiasgiese
Copy link
Member

@tobiasgiese tobiasgiese commented Mar 26, 2024

What this PR does / why we need it:

Currently the tool prints the same warning for both beta and rc releases.
This PR removes the parameter --pre-release-version and let the binary determine from the given tag what type of release it is.

Related to #10323

/area release

@k8s-ci-robot k8s-ci-robot added area/release Issues or PRs related to releasing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 26, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 26, 2024
@tobiasgiese
Copy link
Member Author

/retest

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

This looks great to me! I think this would be an awesome improvement to the release notes tool. Thanks for working on this change 🚀

Just one tiny nit from me, nothing blocking!

@chrischdi
Copy link
Member

chrischdi commented Mar 27, 2024

🤔 Isn't it possible to determine if we have a beta/rc release from the release tag we pass in?

But totally fair to keep this as a parameter :-)

@tobiasgiese
Copy link
Member Author

🤔 Isn't it possible to determine if we have a beta/rc release from the release tag we pass in?

This is possible, sure. After taking a deeper look into the code we can easily use semver for this 👍🏻

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 27, 2024
@tobiasgiese tobiasgiese force-pushed the add-release-type-print branch 2 times, most recently from 8c37713 to 9bddc42 Compare March 27, 2024 09:49
@tobiasgiese tobiasgiese changed the title 🌱 Add release-type parameter to release notes binary to also handle beta releases 🌱 Pass release type to notes binary to also handle beta releases Mar 27, 2024
@tobiasgiese tobiasgiese changed the title 🌱 Pass release type to notes binary to also handle beta releases 🌱 Determine release type from tag to also handle beta releases Mar 27, 2024
@tobiasgiese tobiasgiese force-pushed the add-release-type-print branch 2 times, most recently from 11c68f1 to ff24342 Compare March 27, 2024 10:43
@cahillsf
Copy link
Member

we also have release docs with example usage: https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/release/release-tasks.md#create-pr-for-release-notes

these should be updated too (its a small change, release team can take as a follow up if we don't make the update in this pr)

@tobiasgiese
Copy link
Member Author

we also have release docs with example usage: https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/release/release-tasks.md#create-pr-for-release-notes

these should be updated too (its a small change, release team can take as a follow up if we don't make the update in this pr)

This is already part of this PR, see https://github.com/kubernetes-sigs/cluster-api/pull/10324/files#diff-751bae1afb6862debc4d8d6b2d39bba9d2838e720c37c8b2805138c738843025

@cahillsf
Copy link
Member

ah beautiful! missed that, thanks @tobiasgiese

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 68c316f2fbe03f6f03b76e9ffb6d1860630e96b2

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2024
Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

/lgtm

Nice work!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5cf60e1ea2f29c7e902fb1c1e78ffdbc1b445a3c

@cahillsf
Copy link
Member

/lgtm

@cahillsf
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cahillsf

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 28, 2024
@tobiasgiese
Copy link
Member Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 28, 2024
Comment on lines +119 to +120
// Error handling can be ignored as the version has been validated in computeConfigDefaults already.
newTag, _ := semver.ParseTolerant(newTagConfig)
Copy link
Member Author

Choose a reason for hiding this comment

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

One last question: is it fair to ignore the error handling here? Or should we handle it anyway?

Copy link
Member Author

Choose a reason for hiding this comment

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

Talked to @chrischdi, totally fair to do it like this. It will not panic if the version cannot be parsed.

@tobiasgiese
Copy link
Member Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 28, 2024
@k8s-ci-robot k8s-ci-robot merged commit 244927d into kubernetes-sigs:main Mar 28, 2024
34 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Mar 28, 2024
@tobiasgiese tobiasgiese deleted the add-release-type-print branch March 28, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release Issues or PRs related to releasing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants