Skip to content

Conversation

@RamLavi
Copy link
Collaborator

@RamLavi RamLavi commented Dec 29, 2025

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-minor should 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:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/M labels Dec 29, 2025
Comment on lines 36 to 68
# 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
}
Copy link
Collaborator

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]>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@kubevirt-bot
Copy link
Collaborator

@RamLavi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-e2e-cluster-network-addons-operator-workflow-k8s-s390x f0d86b0 link false /test pull-e2e-cluster-network-addons-operator-workflow-k8s-s390x
Details

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-sigs/prow repository. I understand the commands that are listed here.

Copy link
Collaborator

@qinqon qinqon left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 29, 2025
@kubevirt-bot
Copy link
Collaborator

[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

Details 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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 29, 2025
@kubevirt-bot kubevirt-bot merged commit bf1e951 into kubevirt:main Dec 29, 2025
15 of 16 checks passed
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants