Support v0 versions as prerelease beta versions (#2821)
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
parent
10a46b3132
commit
19205045d2
@ -128,7 +128,7 @@ if ($packages)
|
||||
{
|
||||
Write-Host "API review is in approved status."
|
||||
}
|
||||
elseif ($version.IsPrerelease -or ($version.Major -eq 0))
|
||||
elseif ($version.IsPrerelease)
|
||||
{
|
||||
# Ignore API review status for prerelease version
|
||||
Write-Host "Package version is not GA. Ignoring API view approval status"
|
||||
@ -141,7 +141,7 @@ if ($packages)
|
||||
{
|
||||
# Return error code if status code is 201 for new data plane package
|
||||
# Temporarily enable API review for spring SDK types. Ideally this should be done be using 'IsReviewRequired' method in language side
|
||||
# to override default check of SDK type client
|
||||
# to override default check of SDK type client
|
||||
if (($pkgInfo.SdkType -eq "client" -or $pkgInfo.SdkType -eq "spring") -and $pkgInfo.IsNewSdk)
|
||||
{
|
||||
if ($respCode -eq '201')
|
||||
@ -161,7 +161,7 @@ if ($packages)
|
||||
{
|
||||
Write-Host "API review is not approved for package $($PackageName), however it is not required for this package type so it can still be released without API review approval."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -76,14 +76,19 @@ class AzureEngSemanticVersion : IComparable {
|
||||
$this.SetupDefaultConventions()
|
||||
}
|
||||
|
||||
if ($null -eq $matches['prelabel'])
|
||||
if ($null -eq $matches['prelabel'])
|
||||
{
|
||||
# artifically provide these values for non-prereleases to enable easy sorting of them later than prereleases.
|
||||
$this.PrereleaseLabel = "zzz"
|
||||
$this.PrereleaseNumber = 99999999
|
||||
$this.IsPrerelease = $false
|
||||
$this.VersionType = "GA"
|
||||
if ($this.Patch -ne 0) {
|
||||
if ($this.Major -eq 0) {
|
||||
# Treat initial 0 versions as a prerelease beta's
|
||||
$this.VersionType = "Beta"
|
||||
$this.IsPrerelease = $true
|
||||
}
|
||||
elseif ($this.Patch -ne 0) {
|
||||
$this.VersionType = "Patch"
|
||||
}
|
||||
}
|
||||
@ -160,7 +165,7 @@ class AzureEngSemanticVersion : IComparable {
|
||||
}
|
||||
}
|
||||
|
||||
[void] SetupPythonConventions()
|
||||
[void] SetupPythonConventions()
|
||||
{
|
||||
# Python uses no separators and "b" for beta so this sets up the the object to work with those conventions
|
||||
$this.PrereleaseLabelSeparator = $this.PrereleaseNumberSeparator = $this.BuildNumberSeparator = ""
|
||||
@ -168,7 +173,7 @@ class AzureEngSemanticVersion : IComparable {
|
||||
$this.DefaultAlphaReleaseLabel = "a"
|
||||
}
|
||||
|
||||
[void] SetupDefaultConventions()
|
||||
[void] SetupDefaultConventions()
|
||||
{
|
||||
# Use the default common conventions
|
||||
$this.PrereleaseLabelSeparator = "-"
|
||||
@ -219,20 +224,20 @@ class AzureEngSemanticVersion : IComparable {
|
||||
{
|
||||
$global:Language = ""
|
||||
$versions = @(
|
||||
"1.0.1",
|
||||
"2.0.0",
|
||||
"1.0.1",
|
||||
"2.0.0",
|
||||
"2.0.0-alpha.20200920",
|
||||
"2.0.0-alpha.20200920.1",
|
||||
"2.0.0-beta.2",
|
||||
"1.0.10",
|
||||
"2.0.0-beta.2",
|
||||
"1.0.10",
|
||||
"2.0.0-alpha.20201221.03",
|
||||
"2.0.0-alpha.20201221.1",
|
||||
"2.0.0-alpha.20201221.5",
|
||||
"2.0.0-alpha.20201221.2",
|
||||
"2.0.0-alpha.20201221.10",
|
||||
"2.0.0-beta.1",
|
||||
"2.0.0-beta.10",
|
||||
"1.0.0",
|
||||
"2.0.0-beta.1",
|
||||
"2.0.0-beta.10",
|
||||
"1.0.0",
|
||||
"1.0.0b2",
|
||||
"1.0.2")
|
||||
|
||||
@ -258,7 +263,7 @@ class AzureEngSemanticVersion : IComparable {
|
||||
|
||||
for ($i = 0; $i -lt $expectedSort.Count; $i++)
|
||||
{
|
||||
if ($sort[$i] -ne $expectedSort[$i]) {
|
||||
if ($sort[$i] -ne $expectedSort[$i]) {
|
||||
Write-Host "Error: Incorrect version sort:"
|
||||
Write-Host "Expected: "
|
||||
Write-Host $expectedSort
|
||||
|
||||
Loading…
Reference in New Issue
Block a user