You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Same version computed on different branches #3453
Describe the bug
Hello, to be honest i'm not sure if it is a gitversion issue or i'm not using gitflow right. But i hope you could help me.
I created this repository https://github.com/xpicio/compute-version to test incremental version using conventional commits, the repo is based on gitflow model and i'm using git tower with the gitflow plugin.
In the actual state (after i closed an hotfix, pushed both branches develop and main, and finally added a tag) when i compute the version on develop or main branch, the version is the same: 0.2.4. This behaviour is causing an issue in CI/CD pipelines, when i need to restart a pipeline (should happen to fix a bug on the pipeline) the artifacts tagged from the develop branch will assume the same version of the artifacts from the main branch.
Expected Behavior
action
branch
commit message
sha
version
close hotfix (random)
develop
53720f5d878cbc9eab27fbb127615c3e85971409
0.3.0-alpha.9
main
53720f5d878cbc9eab27fbb127615c3e85971409
0.2.4
new tag v0.2.4
53720f5d878cbc9eab27fbb127615c3e85971409
develop
53720f5d878cbc9eab27fbb127615c3e85971409
0.x.x-alpha.x
main
53720f5d878cbc9eab27fbb127615c3e85971409
0.2.4
The version on develop branch is different to main
Actual Behavior
action
branch
commit message
sha
version
close hotfix (random)
develop
53720f5d878cbc9eab27fbb127615c3e85971409
0.3.0-alpha.9
main
53720f5d878cbc9eab27fbb127615c3e85971409
0.2.4
new tag v0.2.4
53720f5d878cbc9eab27fbb127615c3e85971409
develop
53720f5d878cbc9eab27fbb127615c3e85971409
0.2.4
main
53720f5d878cbc9eab27fbb127615c3e85971409
0.2.4
The version on develop branch is equal to main
Steps to Reproduce
docker run --rm gittools/gitversion:6.0.0-beta.1 \
/url https://github.com/xpicio/compute-version.git \
/b develop
docker run --rm gittools/gitversion:6.0.0-beta.1 \
/url https://github.com/xpicio/compute-version.git \
/b main
Your Environment
Version Used: 5.12.0, 6.0.0-beta.1
Operating System and version: macOs Ventura 13.2.1
If you take a look to the following figure you see that the main and the develop branch points to the same commit which has been tagged with v0.2.4:
At this moment in GitVersion a commit which has been tagged will be used as the semantic version independent if a higher version exists. I have already thought about this scenario very often and think we need to introduce a new branch configuration to control the behavior whether or not to output the previous released version (in this case the tagged version) or the up-coming version. In this case you can configure it on the main branch and on the develop to get different results. To answer your question it's not a bug.
Usually i have 2 pipelines (or the same that work conditionally), 1 bounded to the main branch (where i have production release x.x.x), 1 bounded to develop branch (where i have alpha release x.x.x-alpha.x). When i'm working on pipeline should happen that something is wrong and i need to run again the pipeline, and the project repositories does not change.
Usually i have 2 pipelines (or the same that work conditionally), 1 bounded to the main branch (where i have production release x.x.x), 1 bounded to develop branch (where i have alpha release x.x.x-alpha.x). When i'm working on pipeline should happen that something is wrong and i need to run again the pipeline, and the project repositories does not change.
I'm not sure if I understood your scenario right: You have done a release and you start to make changes on your build pipeline (without any code change in git) and want to test the pipeline on develop?
I'm not sure if I understood your scenario right: You have done a release and you start to make changes on your build pipeline (without any code change in git) and want to test the pipeline on develop?
Yes. With the repo at commit 53720f5d878cbc9eab27fbb127615c3e85971409 if i run the pipeline on main branch i will get 0.2.4-BUILD_NUMBER_MAIN (and it's ok), if i run the pipeline on develop branch i will obtain again 0.2.4-BUILD_NUMBER_DEVELOP (and it's wrong).
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
Activity
lcaiffa commentedon Mar 30, 2023
I follow the tread with interest, I also have the exact same problem
HHobeck commentedon Mar 30, 2023
If you take a look to the following figure you see that the
mainand thedevelopbranch points to the same commit which has been tagged withv0.2.4:At this moment in GitVersion a commit which has been tagged will be used as the semantic version independent if a higher version exists. I have already thought about this scenario very often and think we need to introduce a new branch configuration to control the behavior whether or not to output the previous released version (in this case the tagged version) or the up-coming version. In this case you can configure it on the main branch and on the develop to get different results. To answer your question it's not a bug.
HHobeck commentedon Mar 30, 2023
May I ask you why would you create a new build artifact without any code change? You could take the released version v0.2.4 ;)
xpicio commentedon Mar 30, 2023
Usually i have 2 pipelines (or the same that work conditionally), 1 bounded to the main branch (where i have production release x.x.x), 1 bounded to develop branch (where i have alpha release x.x.x-alpha.x). When i'm working on pipeline should happen that something is wrong and i need to run again the pipeline, and the project repositories does not change.
HHobeck commentedon Mar 30, 2023
I'm not sure if I understood your scenario right: You have done a release and you start to make changes on your build pipeline (without any code change in git) and want to test the pipeline on develop?
xpicio commentedon Mar 30, 2023
Yes. With the repo at commit
53720f5d878cbc9eab27fbb127615c3e85971409if i run the pipeline on main branch i will get 0.2.4-BUILD_NUMBER_MAIN (and it's ok), if i run the pipeline on develop branch i will obtain again 0.2.4-BUILD_NUMBER_DEVELOP (and it's wrong).[-]Same version computed on different branches[/-][+][Feature] Same version computed on different branches[/+]github-actions commentedon Sep 29, 2023
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
arturcic commentedon Mar 9, 2024
🎉 This issue has been resolved in version 6.0.0-beta.6 🎉
The release is available on:
Your GitReleaseManager bot 📦🚀