-
Notifications
You must be signed in to change notification settings - Fork 652
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
GitVersion produces different BuildMetaData once commit is tagged #1397
Comments
Any update on this? |
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. Thank you for your contributions. |
I am seeing strange behavior with the metadata being off now as well. Started a couple weeks back. |
With which version of GitVersion are you experiencing this, @jklaus? |
@asbjornu 5.0.1, in Azure DevOps. |
Could you please update to version 5.3.4 and see whether the problem is reproducable there as well? |
I can investigate it but I think we're just using w/e the latest version is that the default build step installs. Not sure if it will allow me to download that far forward from where it currently is. |
@asbjornu scratch that.. looks like the step they're using has been deprecated. I'll tell them to install and port to the latest step, that's likely what the issue is. |
I just realised that the "bug" experienced here is by design. A tag will reset the commit count. That's how GitVersion works. |
It used to behave such that it was commits ahead of mainline though.. not commits ahead of the current branch. |
@asbjornu - that said we've been on 5.0.1 for a very long time w/o issues until recently so I assume the issue is more rooted in either the version of .Net Core 2.1 that our agents are installing or something else ADO/agent specific. That said, I'm going to have them port from GitTools.GitVersion to GitTools.UseGitVersion which should bring in the latest GitVersion version and will reassess. Its worth noting that they're currently creating release branches for things in the RC phase so we have a bit of a customized GitVersion.yml around that. Using branch naming as a methodology to determine major, minor, or patch incrementation. That said, all of this worked fine with GV version 5.0.1 up until probably a month or two ago now. The only thing that has varied in that timespan is whatever changes MS has made to the ADO hosted agents. They're constantly rolling out patches to .Net Core 2.X/3.X so I suspect the version of that we're getting now isn't playing well with an old version of GV. |
@arturcic, is |
Well I would recommend to give a try the GitTools version, and fill in issues, as that's the way to go. As for the UseGitversion, we don't have resources to fix it |
@arturcic - are there known issues with UseGitVersion? I've tried leveraging it on a .Net Core 3.1 build and its having issues installing. The agents are currently pulling .Net Core 3.1.300, GitVersion 5.3.4. |
Gitversion Version: User Story: P.s.: P.p.s.: P.p.p.s.: P.p.p.p.s.: Gitversion.yml: |
@jklaus: Please use the GitTools Task instead of |
@HHobeck, just to be clear, when you write "label" do you mean |
@asbjornu: Yes that is what I mean. If I label the released source code in master I use the command |
@HHobeck, I don't think GitVersion plays well with four-part version numbers. GitVersion supports SemVer 2.0 which only has If you want to support four-part version numbers you can do that by customizing the format, but that is only used for how GitVersion serializes version numbers and does not affect its internal modus operandi, such as calculation. |
@asbjornu: Yes I understand that for the current version of GitVersion. If you ask me GitVersion should support a revision number in future releases. I mean semi versioning comes in place at this point you create a final package for the end user. That's good. But that is the point the process of creating software is much more complex and not just about creating a final package. The semi version number is just a small part of it. The scenario I have described is quite common and it's a shame that GitVersion is not supporting it. |
I wouldn't oppose GitVersion supporting this, but I don't think you can wait for anyone else to implement this for you. If you want to spend time implemeting this, adding required tests, etc., I would be happy to merge it, provided it doesn't break any of our existing supported use cases. |
@HHobeck I would prefer not to see "shame" in anyones comments, especially if it's related to the decisions made by maintainers of a project. As the repository's description says - |
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. Thank you for your contributions. |
Repro Steps
First commit
Second commit <- Tagged with 1.2.0
Third commit <- pump minor via commit msg
Fourth commit
->Fourth commit now produces version number 1.3.0+2
-> Now tag the fourth commit with v1.3.0, aka we have released 1.3.0+2
Expected
When building the fourth commit, the exact same version information are produced by GitVersion, meaning 1.3.0+2
Actual
The fourth commit produces version information without any BuildMetaData, meaning the +2 is missing.
We usually take a build, test it, release it, and then tag the commit as released.
We do not know before the actual test whether we want to release (aka tag) the commit or not. But with this approach we are forced to tag the commit before the actual test to ensure that the version number of the commit does not change.
Edit:
Tested with GitVersion 3.6.5 and 4.0.0-beta0012
The text was updated successfully, but these errors were encountered: