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

Compatibility with prerelease string starting with a number. Compatibility with GitVersion and NuGet v3.5+ #1158

Closed
xlegalles opened this issue Feb 6, 2017 · 13 comments
Labels
Customer Duplicate Issue Improvement Requires NuGet.Client Change This issue requires a modification to something in referenced NuGet.Client library.

Comments

@xlegalles
Copy link

xlegalles commented Feb 6, 2017

We use GitVersion to create semantic versions from git flow branches: it works perfectly with Nuget 3.5 but we get some trouble with Chocolatey:

What You Are Seeing?

5.79.2-6297-eventstorem004 is not a valid version string

What is Expected?

This is given by GitVersion for Nuget and it is supposed to work. If you use the same command, same nuspec with Nuget 3.5, it just works.

How Did You Get This To Happen? (Steps to Reproduce)

Command line: "C:\ProgramData\chocolatey\choco.exe" pack C:\Users\legalles\AppData\Local\Temp\FakeChocolateyPack\Kautomate.Service.EventStore.5.79.2-6297-eventstorem0004.nuspec --version 5.79.2-6297-eventstorem004 -y -d
Received arguments: pack C:\Users\legalles\AppData\Local\Temp\FakeChocolateyPack\Kautomate.Service.EventStore.5.79.2-6297-eventstorem0004.nuspec --version 5.79.2-6297-eventstorem004 -y -d
The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: CommandName='pack'|
CacheLocation='C:\Users\legalles\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='False'|Force='False'|Noop='False'|
HelpRequested='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='False'|AcceptLicense='True'|
AllowUnofficialBuild='False'|
Input='C:\Users\legalles\AppData\Local\Temp\FakeChocolateyPack\Kautomate.Service.EventStore.5.79.2-6297-eventstorem0004.nuspec'|

Version='5.79.2-6297-eventstorem004'|AllVersions='False'|
SkipPackageInstallProvider='False'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='6.1.7601.65536'|
Information.PlatformName='Windows 7'|
Information.ChocolateyVersion='0.10.3.0'|
Information.ChocolateyProductVersion='0.10.3'|
Information.FullName='choco, Version=0.10.3.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='False'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Command='unknown'|PinCommand.Command='unknown'|
_ Chocolatey:ChocolateyPackCommand - Normal Run Mode _
Chocolatey had an error occur:
System.ArgumentException: '5.79.2-6297-eventstorem004' is not a valid version string.
Parameter name: version
   at NuGet.SemanticVersion.Parse(String version)
   at chocolatey.infrastructure.app.services.NugetService.pack_run(ChocolateyConfiguration config)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.pack_run(ChocolateyConfiguration config)
   at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action1 parseArgs)
   at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container)
   at chocolatey.console.Program.Main(String[] args)
@pascalberger
Copy link
Contributor

This seems like the same issue NuGet < 3.5 had, that it couldn't handle pre-release tags starting with a number. There is already an open issue over at the GitVersion repository for providing version numbers which should work with NuGet < 3.5 and therefore also be suitable for Chocolatey: GitTools/GitVersion#781

@ferventcoder
Copy link
Member

This is not NuGet. This uses NuGet.Core framework, but that doesn't mean it has some of the newest stuff yet. Perhaps we should better document this somewhere.

I'm going to tag this as related to #508, as moving foward should resolve this issue.

@ferventcoder ferventcoder changed the title GitVersion/Semver compatibility Compatibility with prerelease string starting with a number. Compatibility with GitVersion and NuGet v3.5+ Mar 18, 2017
@ferventcoder ferventcoder added this to the 0.10.x milestone Mar 18, 2017
@ferventcoder ferventcoder modified the milestones: 0.10.x, 0.10.4 Mar 23, 2017
@bbowman
Copy link

bbowman commented Mar 30, 2017

+1 here. We are using GitVersion for our versions as well and ran into this. @ferventcoder I think this is why I hit the bad gateway error today (running choco push manually complains about the version string).

@ferventcoder
Copy link
Member

@bbowman thanks for logging this.

@subhiandrews
Copy link

We are using 0.10.5 and it is still problem! Is there are an ETA on this?

@ferventcoder ferventcoder modified the milestones: 0.10.7, 0.10.x May 24, 2017
@ferventcoder
Copy link
Member

Hi @subhiandrews - I am going to move this from the 0.10.x milestone to 0.10.7. Keep an eye on that milestone as it could change. Yes this is still a known issue, and it will be until a released version of Chocolatey (key in on the milestone for the fix version) is released.

@ferventcoder
Copy link
Member

Most likely the issue isn't the number, it is using "-" multiple times in the version string.

@ferventcoder
Copy link
Member

It sounds like this would need a fix on the server side as well to recognize this as a valid string. Let's get an issue created there as well. Please follow https://github.com/chocolatey/chocolatey.org/issues/516

@AdmiringWorm
Copy link
Member

@ferventcoder I don't think the issue is with multiple dashes in a pre-release version string, as that is what I did when I had to update the wixtoolset package once: https://chocolatey.org/packages/wixtoolset/3.11.0.1528-rc2-20170424
Could be it only happens if the first part of the pre-release string is a number though (just a thought).

@bbowman
Copy link

bbowman commented May 26, 2017

Yeah I experienced that it's the number first in the prerelease string that is the problem.

@ferventcoder ferventcoder modified the milestones: 0.10.7, 0.10.8 Jun 6, 2017
@ferventcoder ferventcoder removed this from the 0.10.8 milestone Jun 6, 2017
@ferventcoder ferventcoder modified the milestones: 0.10.9, 0.10.10 Aug 27, 2017
@ferventcoder ferventcoder modified the milestones: 0.10.10, 0.10.11 Mar 27, 2018
@ferventcoder ferventcoder modified the milestones: 0.10.11, 0.10.12 May 3, 2018
@ferventcoder ferventcoder modified the milestones: 0.10.12, 0.10.13, 0.10.14 Mar 9, 2019
@ferventcoder ferventcoder modified the milestones: 0.10.14, 0.10.15 Apr 1, 2019
@gep13 gep13 modified the milestones: 0.10.15, 0.10.16 May 31, 2019
@pauby pauby modified the milestones: 0.10.16, 0.10.x May 11, 2021
@TheCakeIsNaOH TheCakeIsNaOH added the Requires NuGet.Client Change This issue requires a modification to something in referenced NuGet.Client library. label Feb 4, 2022
@DiscoveringWorld
Copy link

DiscoveringWorld commented Oct 6, 2022

Any news on that to support v3 and not only v2 ?
/nuget/v3/index.json

@gep13
Copy link
Member

gep13 commented Oct 7, 2022

@DiscoveringWorld rather than posting the same question in multiple places, let's keep the conversation in once place. The correct place to continue discussing this is in this issue: #508

@TheCakeIsNaOH
Copy link
Member

Prerelease strings that start with a number are a part of semver v2, so this issue is a duplicate of #1610

@TheCakeIsNaOH TheCakeIsNaOH closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
@TheCakeIsNaOH TheCakeIsNaOH removed this from the Future milestone Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Duplicate Issue Improvement Requires NuGet.Client Change This issue requires a modification to something in referenced NuGet.Client library.
Projects
None yet
Development

No branches or pull requests

10 participants