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

NuGet version is gone, and there will be changes... #201

Closed
GeertvanHorrik opened this issue Jul 2, 2014 · 24 comments
Closed

NuGet version is gone, and there will be changes... #201

GeertvanHorrik opened this issue Jul 2, 2014 · 24 comments

Comments

@GeertvanHorrik
Copy link
Contributor

So GitVersion_NuGetVersion is gone but can be used by "LegacySemVerPadded". Apparently it will be changed for v3, so the idea is to introduce 2 new variables:

GitVersion_NuGetVersionV2 => synonym for LegacySemVerPadded
GitVersion_NuGetVersionV3 => synonym for ???

@JakeGinnivan
Copy link
Contributor

Or we can just bring back NuGetVersion then when v3 drops we release v2 of GitVersion which switches NuGet from LegacySemVerPadded to SemVer?

@GeertvanHorrik
Copy link
Contributor Author

To make it backwards compatible for me I added this code to the VariableProvider class:

            {"NuGetVersion", semanticVersion.ToString("lp", formatter)}, // synonym for LegacySemVerPadded
            {"Version", semanticVersion.ToString("l", formatter)}, // synonym for LegacySemVer

@JakeGinnivan
Copy link
Contributor

Not sure bringing back Version is a good idea, it is too vague?

The other thing is should we pad the NuGet version by default, or should we have a NuGetPadded

@JakeGinnivan
Copy link
Contributor

The padded is only needed if you have tags greater than 10. i.e

-beta11

@SimonCropp
Copy link
Contributor

unfortunately we cannot determine when padding will be needed. so we always add it

@GeertvanHorrik
Copy link
Contributor Author

It's just so I can go on vacation in 2 hours and I don't have to change a zillion of builds. I am not saying Version should go back in the official version, I have just built my own version for the sake of backwards compatibility.

I prefer padding all the time instead of switching when the moon and sun are on the same level but only in August.

@GeertvanHorrik
Copy link
Contributor Author

And what does "0.2.0-unstable.10+10" mean? I can understand the 10 (that is the no of commits), but +10?

@SimonCropp
Copy link
Contributor

given nugets history of dodgy versioning i suspect there will be more dodgy work arounds that will need to be applied to future nuget implementations of semver. so i am leaning towards naming them explicitly like @GeertvanHorrik NuGetVersionV2 and perhaps have a NuGetVersionLatest (or something similar) that targets the current release version of nuget

any drawbacks people can see? thoughts?

@JakeGinnivan
Copy link
Contributor

@GeertvanHorrik how did you get that version number? For develop you should get 0.2.0.10-unstable

Lets take a beta. 0.2.0-beta.1+10 means the first beta (i.e no tags on the release branch) and 10 commits since the branch was taken. When you tag 0.2.0-beta.1 then the version will become 0.2.0-beta.2+11

@JakeGinnivan
Copy link
Contributor

@SimonCropp I am happy with adding NuGetVersionV2 for now, then when v3 drops we figure it out then.

OR we just add NuGetVersion back now, and it is for the latest version of NuGet. So when NuGet v3 drops we go to v2 and have a breaking change

@JakeGinnivan
Copy link
Contributor

@GeertvanHorrik basically the +metadata is a way to include additional metadata which doesn't change the semantic version. so 0.2.0-beta.1+10 == 0.2.0-beta.1+20 from a SemVer point of view

@GeertvanHorrik
Copy link
Contributor Author

It's the result of SetBuildVersion call. When I debug with this url:

/url https://github.com/Orcomp/C5Intervals /b develop /output buildserver

Caused by a call to semanticVersion.ToString("f")

@JakeGinnivan
Copy link
Contributor

Interesting, I think that is a bug possibly. But that is a separate discussion

@GeertvanHorrik
Copy link
Contributor Author

@JakeGinnivan Created new issue for the possible bug: #202

@GeertvanHorrik
Copy link
Contributor Author

I think we should do this:

  • NuGetVersion <=== most current or latest NuGet version
  • NuGetVersionV2
  • NuGetVersionV3
  • NuGetVersionV[next]

All agree?

@SimonCropp
Copy link
Contributor

seams reasonable to me

@GeertvanHorrik
Copy link
Contributor Author

Code is ready, but awaiting other pull request first.

@GeertvanHorrik
Copy link
Contributor Author

In VariableProvider, at the bottom (before return variables):

        variables["Version"] = variables[LegacySemVer];
        variables["NuGetVersionV2"] = variables[LegacySemVerPadded];
        //variables["NuGetVersionV3"] = variables[LegacySemVerPadded]; // TODO: when v3 is released, determine what to use
        variables["NuGetVersion"] = variables["NuGetVersionV2"];

@andreasohlund
Copy link
Contributor

I propose we lowercase it as well to avoide Beta/beta sorting issues?

Sent from my iPhone

On 08 Jul 2014, at 13:56, Geert van Horrik notifications@github.com wrote:

In VariableProvider, at the bottom (before return variables):

    variables["Version"] = variables[LegacySemVer];
    variables["NuGetVersionV2"] = variables[LegacySemVerPadded];
    //variables["NuGetVersionV3"] = variables[LegacySemVerPadded]; // TODO: when v3 is released, determine what to use
    variables["NuGetVersion"] = variables["NuGetVersionV2"];


Reply to this email directly or view it on GitHub.

@GeertvanHorrik
Copy link
Contributor Author

Good idea. Only the NuGetVersion items?

@andreasohlund
Copy link
Contributor

I'd say only nuget* since this only a nuget snag

Sent from my iPhone

On 08 Jul 2014, at 15:12, Geert van Horrik notifications@github.com wrote:

Good idea. Only the NuGetVersion items?


Reply to this email directly or view it on GitHub.

@GeertvanHorrik
Copy link
Contributor Author

Once my other pull request is accepted, I will start a new one introducing this (don't want to mess around with too many branches with an upstream master).

@JakeGinnivan
Copy link
Contributor

@GeertvanHorrik have merged your other PR

@GeertvanHorrik
Copy link
Contributor Author

Already pushing new fixes. Was more work then I expected with all the unit tests...

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

4 participants