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

v3.1.0 (& 3.0.2) Generating improper NuGetVersion strings #608

Closed
KenHundley opened this issue Aug 25, 2015 · 6 comments
Closed

v3.1.0 (& 3.0.2) Generating improper NuGetVersion strings #608

KenHundley opened this issue Aug 25, 2015 · 6 comments

Comments

@KenHundley
Copy link

Hi,
I've noticed an issue where the generated NuGetVersion and NuGetVersionV2 strings are invalid.
We have some branches that were created like "feature/123-SomeFeature". When we run GitVersion on this branch the NuGetVersion and NuGetVersionV2 appear like "2.1.0-123-somefeature0010". This is actually an invalid version string. Nuget does not allow the pre-release to start with a number

Nuget pack output: '2.1.0-123-somefeature0010' is not a valid version string. Parameter name: version

I'm not sure what the best fix for this is. Currently I'm manually generating the Nuget version and appending an arbitrary "b" before the number like: 2.1.0-b123-somefeature0010
Another suggestion may be to remove any non-alpha characters from the start of the branch name.

@vegar
Copy link

vegar commented Aug 26, 2015

I second this. We use the backlog id first in our branch name, and it would be nice to keep that as part of the pre-release tag.

Currently, I have managed to solve this by adding the following to the gitversion-config:

  pbi[/-]:
    mode: ContinuousDeployment
    tag: pbi

which gives me nugetversion like 1.0.0-pbi0010, where 0010 is the commit-count, but I would rather have something unique for the branch, like 1.0.0-pbi123-0010.

@clairernovotny
Copy link

Related to this, I also see some invalid strings if I have a branch features/foo with the default configuration. The pre-release tag shows up as -features/foo

@mkoertgen
Copy link
Contributor

This is typical when working on feature branches prefixed with issue numbers (e.g. JIRA). And in fact, this is due to an unfixed bug in NuGet, cf.: NuGet #1743.

Note that this has also been discussed in #664 cf. #664 (comment)

Since 3.4.x you work around the NuGet bug using tag: alpha.{BranchName}.

As far as i understand the reason why this did not get fixed in NuGet yet is concerns on backward compatibility with NuGet 2

@asbjornu
Copy link
Member

asbjornu commented Nov 3, 2016

As @nshenoy points out in #1067 (comment), NuGet 3.5 is RTM and solves this problem. Doesn't that mean this issue can be closed?

@mkoertgen
Copy link
Contributor

I just updated using nuget update -self to 3.4.4-rtm-final. Right now, the recommended-latest-link on http://dist.nuget.org/index.html still points to 3.4.4-rtm-final. Let's wait until this maps to 3.5.0.

@asbjornu
Copy link
Member

asbjornu commented Mar 1, 2019

NuGet Server got SemVer 2.0 support in v2.14.0 and NuGet.exe got SemVer 2.0 support in v4.3, so this shouldn't be a problem anymore. For those who need less syntactically rich version numbers, the variable NuGetVersion might be a better fit than FullSemVer.

@asbjornu asbjornu closed this as completed Mar 1, 2019
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

6 participants