-
Notifications
You must be signed in to change notification settings - Fork 653
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
Version not bumped if an irrelevant tag exists in latest commit #3757
Comments
I believe this is related to #3071 and |
I'm not at ease with contributing to a project and it would take me some time to understand all the various parts of
I could make it pass - without breaking any of the existing tests - by using an
But other than that I cannot tell if it has any performance implications, or if it covers the rest of the cases/tools/build tasks/etc. |
Hi @adaskos-signal . Thank you for providing such detail information. In my opinion you are on the right track. Please provide a PR to fix this issue based on the main branch. In advance I want to tell you that we are in development phase and just releasing beta versions at this moment. Performance is something we need to address at the end of the development phase. Cheers |
Any chance this will end in the 5.x support branch too? |
branch 5.x is now readonly, we won't release any new version from the 5.x |
I created a PR #3759 for this. |
@adaskos-signal in my case the "irrelevant" tag is actually an alpha release from dev since we use rebase fast forward when merging from dev to main. Would your PR be relevant to this issue as well? |
Expected: %%{init: { 'gitGraph': {'rotateCommitLabel': false, 'chartOrientation': 'horizontal' }} }%%
gitGraph
commit id: "init"
branch dev
branch feature
commit id: "feat: 1"
commit id: "feat: 2"
commit id: "feat: 3"
checkout dev
merge feature id: "rebase+merge" tag: "v0.1.0-alpha.3"
checkout main
merge dev id: "rebase fastforward" tag: "v0.1.0, v0.1.0-alpha.3"
Actual: %%{init: { 'gitGraph': {'rotateCommitLabel': false, 'chartOrientation': 'horizontal' }} }%%
gitGraph
commit id: "init"
branch dev
branch feature
commit id: "feat: 1"
commit id: "feat: 2"
commit id: "feat: 3"
checkout dev
merge feature id: "rebase+merge" tag: "v0.1.0-alpha.3"
checkout main
merge dev id: "rebase fastforward" tag: "v0.1.0-alpha.3"
@HHobeck @arturcic Just ensuring from my previous question: would following interaction be also fixed in the new release? Currently GitVersion won't add a new tag to main branch merge if it does not generate a new commit. We use Rebase Fast Forward strategy when adding commits to main. |
Hi @Sefriol. I don’t understand why your scenario should be related to this issue. In your case the commit on main (which is the same on develop because of rebase fast forward) is marked with the tag Regards |
I am using the 5.x version and it does not add tag v0.1.0 when dev branch is merged to main. EDIT: To clarify: main and dev are in same commit id, but running gitversion yields same tag. Only when tagless commit is added to main, v0.1.0 tag is added. EDIT2: It could be that my config is just incorrect for what I am trying to do. If you have an example of what I should be using, I am all ears. :) |
GitVersion doesn't add tags add all. This is something which is left to the user.
GitVersion doesn't yield tags it yields semantic versions. You cannot add tags on a specific branch. You only add tags on a commit which can be part of one, two (like in your case) or more branches. What I'm trying to say is if you tag it on main then it is also visible on dev branch for the same commit (that's the way how git works).
What are you trying to do? |
Maybe this feature is something you are interested in: |
I remembered incorrectly that gitversion add tags. Anyway, it uses git tags to determine the next proper version and does not do it properly if some incorrect tag exists (as per subject of this issue). Anyway, let's go over my process step by step:
This would work if a new commit without any tag is added to the main branch. The reason I reference this issue is that I consider EDIT: Or could I achieve the same using Mainline mode? I am little uncertain how I should configure GitVersion. |
In the upcoming version of gitversion (6.x.x) we have changed the meaning of mode which might be useful for you. Please take a look to this discussion: Just a side note: You have specified on the main branch the label property to null. That means gitversion considers all pre-released version. If you remove this tag the result will be
|
Hmm, yeah. It might do it. Not entirely sure. I think I will just fix it for now by using |
🎉 This issue has been resolved in version 6.0.0-beta.6 🎉 Your GitReleaseManager bot 📦🚀 |
Hi all.
I'm trying to understand if this is a bug or I'm missing something.
When a tag exists in the latest commit, GitVersion will not parse the commit message and bump version according to the rules.
Minimal steps to reproduce:
(assuming a git repo which currently calculates version as
1.0.0
)Add a bumping commit:
Now
dotnet gitversion /showvariable semver
will give the correct version (2.0.0
)If I first tag the commit:
the same command will give me version
1.0.1
although the tag has no semantic versioning.This has implications in our CI build and I don't believe it's the expected behavior.
The text was updated successfully, but these errors were encountered: