-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
VersionPrefix and VersionSuffix are misnamed #1131
Comments
From @tpluscode on April 7, 2017 7:14 The naming used here should follow the semver, right? According to that spec, both GitVersion uses the term |
From @asbjornu on April 7, 2017 7:29 I think @JakeGinnivan might know better than me where |
From @dasMulli on April 7, 2017 7:53 fyi the logic comes from https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.DefaultAssemblyInfo.targets#L18-L22 It's hard since you need to be able to construct the |
From @adamralph on April 8, 2017 6:37 Based on the comments above, it seems that the general opinion is that "1.0.0-beta1" is the "version", implying that |
From @adamralph on April 8, 2017 6:42 Unfortunately SemVer doesn't define terms to describe the "1.0.0" and "beta1" parts of the version "1.0.0-beta1" so I guess we'll have to define them (or look for precedents elsewhere). But, before going too far down that path, perhaps we should challenge
Why? |
From @dasMulli on April 8, 2017 13:48
My reasoning is mostly based on the ability and need to pass version-related properties as arguments to msbuild invocations, e.g. from CI. You can currently pass However, take the following project file for example: <Project>
<PropertyGroup>
<Version Condition="'$(Version)' == ''">1.0.0</Version>
<Version Condition="'$(PreReleaseLabel)' != ''">$(Version)-$(PreReleaseLabel)</Version>
</PropertyGroup>
<Target Name="Build">
<Message Importance="high" Text="Version: $(Version)"/>
</Target>
</Project>
My problem with this is that 2. and 3. look similar - both properties set to a value - but behave differently because of the way global msbuild properties work, which is confusing for beginners trying to set up their project / CI. There are a few workarounds for that but they would require a different property ( Summed up, I think it's best to leave |
From @adamralph on April 8, 2017 17:7
Therein lies the problem. If I pass Foo, and FooSuffix, I expected the value of Foo to be suffixed by the value of FooSuffix. The current behaviour is surprising and does not follow the semantics conveyed by the property names.
It is only expected after you have experienced the surprising behaviour or read the documentation, and you have retained and recalled that knowledge before the occasion. The names (semantics) cannot be relied on to remind the user of the expected behaviour. I still haven't seen a defense of the assertion that we need the version to be composed of two properties. What does this offer over a single property named |
From @asbjornu on April 19, 2017 13:47
Yes, SemVer defines them as such:
And:
So SemVer calls these pre-release strings that are suffixed to the |
From @adamralph on April 19, 2017 15:57 @asbjornu defining However, I still challenge the need for multiple properties. I haven't seen a strong argument for having multiple properties over a single |
We debated this quite a bit in #93 and didn't reach a consensus. I personally favored the single Version property approach as well. Still, we shouldn't break compatibility with projects that already use the VersionPrefix/VersionSuffix despite their less than perfect names. The options here seem to be:
I'm just not seeing a compelling enough reason to make a breaking change here and I don't see a non-breaking proposal that adds enough value. I'm closing this because I think the status quo is the least bad option we have. |
@nguerrera I hadn't even noticed that there was a single Version property already. The problem is, I've seen people use VersionSuffix alone, redundantly, in place of Version, which illustrates the problem. I.e. if there's no Version what can VersionSuffix suffix? That scenario should result in an exception being thrown somewhere. I understand your reluctance to make breaking changes and I can understand the lack of appetite to make any changes to this now. Out of interest, is there any path for deprecation of properties, with or without eventual removal? |
…123.1 (dotnet#1131) - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19573.1
I'm a little sad we didn't go with this approach, extended to build labels, to match http://semver.org Backus-Naur Form Grammar specification. I guess the upside is that this system is a bit more general than semver 2.0 and should there ever be a semver 3.0 this design will look brilliant,. |
@mmitche Just wondering if the reason this says you referenced this issue is because of dotnet org merging repositories and github incorrectly linking to the wrong issue? |
Possibly because of merges, but where did mention it? |
Look just below the comment by adamralph. #1131 (comment) I've seen the arcade stuff falsely reference stuff a couple times and have always wondered WTF is going on. My guess is nobody is doing that on purpose and it's probably a github bug when repos merge because the log messages probably don't update. |
Yeah I think this is a repo merge issue. |
From @adamralph on April 7, 2017 6:44
Prefix:
The value of this property never prefixes the version. That would imply that the version is another string of characters, and the value of this property precedes it. This never happens.
Until I read the documentation, I was surprised to see values of
VersionPrefix
of the form "1.0.0", since "1.0.0" is not a prefix to the version. It is the version.The same argument could be applied to
VersionSuffix
, depending on the interpretation of "version". If "1.0.0" is the "version" in "1.0.0-beta1" then it's true to say that the "version suffix" is "beta1", but if "1.0.0-beta1" is the "version", thenVersionSuffix
is similarly misnamed.Update:
Based on the comments below, it seems that the general opinion is that "1.0.0-beta1" is the "version", implying that
VersionSuffix
is also misnamed. I'm re-titling the issue from "VersionPrefix is misnamed" to "VersionPrefix and VersionSuffix are misnamed".Copied from original issue: dotnet/msbuild#1952
The text was updated successfully, but these errors were encountered: