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

[Bug] Wrong semver calculation when making a PR from a hotfix branch to main branch #3187

Closed
NightFox7 opened this issue Sep 7, 2022 · 6 comments · Fixed by #3190
Closed
Labels
Milestone

Comments

@NightFox7
Copy link

Describe the bug
Running the gitversion calculation on a PR pull branch from Hotfix to Main result to a minor increment instead of a patch increment.
Here is some diagnostic logs :

 INFO [09/07/22 14:25:07:29] Found possible parent branches: master, origin/hotfix/0.4.1
    WARN [09/07/22 14:25:07:29] Failed to inherit Increment branch configuration, ended up with: master, origin/hotfix/0.4.1
Falling back to develop branch config
  INFO [09/07/22 14:25:07:29] End: Attempting to inherit branch configuration from parent branch (Took: 48.56ms)

I believe the fallback to develop causes the minor increment.

Expected Behavior

A Patch increment

Actual Behavior

A Minor increment

Possible Fix

Steps to Reproduce

See PR #3186

Your Environment

  • Version Used: 5.10.3
  • Operating System and version (Windows 10, Ubuntu 18.04):
@NightFox7 NightFox7 added the bug label Sep 7, 2022
@asbjornu
Copy link
Member

asbjornu commented Sep 8, 2022

It may be that the version number in hotfix is not considered. Try setting is-release-branch: true for hotfix in the configuration.

@NightFox7
Copy link
Author

@asbjornu
I just tried this but I still get the same result.
Just to be clear, the problem is not the version calculation on the hotfix branch, but the calculation on the PR merge branch. The pull-request config inherits the increment mode from the parent branches. Here, the algorithm finds two parent branches (master and origin/hotfix/0.4.1). Therefore, it falls back to the develop branch increment strategy which is minor.

@asbjornu
Copy link
Member

@NightFox7, please have a look at the discussions in #3101 and #3190. I think they are relevant for your use-case.

@NightFox7
Copy link
Author

I ran the test of my PR on the branch of HHobeck PR #3101 but it is still not working correctly. However, I think micdenny has found the real issue in here #3020 (comment)

@NightFox7
Copy link
Author

NightFox7 commented Sep 20, 2022

This will be fixed after merging the PR #3190

@arturcic
Copy link
Member

🎉 This issue has been resolved in version 6.0.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment