-
Notifications
You must be signed in to change notification settings - Fork 52
Fix prepare-minor/patch/major to handle RC versions correctly #2520
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
Conversation
hack/bump-version.sh
Outdated
| # If version is an RC, just strip the RC suffix to create the final release | ||
| if [[ $version =~ -rc-[0-9]+$ ]]; then | ||
| local base_version=$(echo $version | sed 's/-rc-[0-9]\+$//') | ||
| ./hack/version.sh $base_version | ||
| else | ||
| local new_version=$(bump "$version" "major") | ||
| ./hack/version.sh $new_version | ||
| fi | ||
| } | ||
|
|
||
| bump_minor() { | ||
| local version=$(hack/version.sh) | ||
| local new_version=$(bump "$version" "minor") | ||
| ./hack/version.sh $new_version | ||
| # If version is an RC, just strip the RC suffix to create the final release | ||
| if [[ $version =~ -rc-[0-9]+$ ]]; then | ||
| local base_version=$(echo $version | sed 's/-rc-[0-9]\+$//') | ||
| ./hack/version.sh $base_version | ||
| else | ||
| local new_version=$(bump "$version" "minor") | ||
| ./hack/version.sh $new_version | ||
| fi | ||
| } | ||
|
|
||
| bump_patch() { | ||
| local version=$(hack/version.sh) | ||
| local new_version=$(bump "$version" "patch") | ||
| ./hack/version.sh $new_version | ||
| # If version is an RC, just strip the RC suffix to create the final release | ||
| if [[ $version =~ -rc-[0-9]+$ ]]; then | ||
| local base_version=$(echo $version | sed 's/-rc-[0-9]\+$//') | ||
| ./hack/version.sh $base_version | ||
| else | ||
| local new_version=$(bump "$version" "patch") | ||
| ./hack/version.sh $new_version | ||
| fi | ||
| } |
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 see a lot of duplicity here, abstract it to a function
Implements semantic version bumping that properly handles RC versions: For pre-release versions (e.g., v1.2.3-rc0): - prepare-patch → removes pre-release tag (v1.2.3-rc0 → v1.2.3) - prepare-minor → removes RC and bumps minor (v1.2.3-rc0 → v1.3.0) - prepare-major → removes RC and bumps major (v1.2.3-rc0 → v2.0.0) For stable versions: - prepare-patch → increments patch (v1.2.3 → v1.2.4) - prepare-minor → increments minor, resets patch (v1.2.3 → v1.3.0) - prepare-major → increments major, resets minor/patch (v1.2.3 → v2.0.0) Signed-off-by: Ram Lavi <[email protected]>
590e77d to
f0d86b0
Compare
|
|
@RamLavi: The following test failed, say
DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
qinqon
left a comment
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
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qinqon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |




What this PR does / why we need it:
When the current version is an RC (e.g., v0.101.0-rc-0), running
make prepare-minorshould strip the RC suffix to create the final release (v0.101.0), not bump to the next minor version (v0.102.0).Special notes for your reviewer:
Release note: