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

Sync eng/common directory with azure-sdk-tools for PR 1972 #23742

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eng/common/scripts/Create-APIReview.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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')
Expand All @@ -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
{
Expand Down
29 changes: 17 additions & 12 deletions eng/common/scripts/SemVer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down Expand Up @@ -160,15 +165,15 @@ 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 = ""
$this.DefaultPrereleaseLabel = "b"
$this.DefaultAlphaReleaseLabel = "a"
}

[void] SetupDefaultConventions()
[void] SetupDefaultConventions()
{
# Use the default common conventions
$this.PrereleaseLabelSeparator = "-"
Expand Down Expand Up @@ -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")

Expand All @@ -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
Expand Down