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

CI: wrong hotfix version computed #498

Open
NiccoMlt opened this issue Sep 10, 2024 · 0 comments
Open

CI: wrong hotfix version computed #498

NiccoMlt opened this issue Sep 10, 2024 · 0 comments
Assignees

Comments

@NiccoMlt
Copy link
Contributor

NiccoMlt commented Sep 10, 2024

Problem

Release job for hotfix 2.0.1 acutally computed a version 2.1.0:
https://github.com/diennea/carapaceproxy/actions/runs/10795758991

./mvnw release:clean release:prepare release:perform \
      -Dtag=v2.1.0 \
      -DreleaseVersion=2.1.0 \
      -DdevelopmentVersion=2.1.1-SNAPSHOT \
      -Darguments='-DskipTests=true'

Why it happened

The POM file on release/2.0 was on version 2.1.0-SNAPSHOT

<version>2.1.0-SNAPSHOT</version>

In the 'Compute versions and branch name' step, for hotfixes:

case $bump in
hotfix)
branch_name="$(git branch --show-current)"
release_version="${major}.${minor}.${patch}"
release_development_version="${major}.${minor}.$((patch + 1))-${qualifier}"
;;

the code extracts the major, minor, and patch versions from the current POM version. For a hotfix, it uses these values directly for the release version.

The problem is that:

  • The POM version is 2.1.0-SNAPSHOT
  • The script extracts major=2, minor=1, patch=0
  • It then sets the release_version to "2.1.0"
  • The hotfix process assumes that the version in the release branch's POM is already incremented to the next minor version (2.1.0-SNAPSHOT in this case)
  • It doesn't decrement the minor version or check if it's on a release branch with a different version number

For a proper hotfix, I think that:

  • The release/2.0 branch should have had a POM version of 2.0.1-SNAPSHOT
  • Then the hotfix release would correctly become 2.0.1
@NiccoMlt NiccoMlt self-assigned this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant