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 1448 #17085

Merged
merged 4 commits into from
Mar 5, 2021
Merged
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
21 changes: 12 additions & 9 deletions eng/common/scripts/Create-APIReview.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel)
try
{
$Response = Invoke-WebRequest -Method 'POST' -Uri $uri -Body $multipartContent -Headers $headers
Write-Host "API Review: $($Response)"
Write-Host "API Review URL: $($Response.Content)"
$StatusCode = $Response.StatusCode
}
catch
{
Write-Host "Exception details: $($_.Exception.Response)"
$StatusCode = $_.Exception.Response.StatusCode
}

Expand Down Expand Up @@ -101,6 +102,9 @@ foreach ($pkgName in $responses.Keys)
{
$pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json
$version = [AzureEngSemanticVersion]::ParseVersionString($pkgInfo.Version)
Write-Host "Package name: $($PackageName)"
Write-Host "Version: $($version)"
Write-Host "SDK Type: $($pkgInfo.SdkType)"
if ($version.IsPrerelease)
{
Write-Host "Package version is not GA. Ignoring API view approval status"
Expand All @@ -110,12 +114,16 @@ foreach ($pkgName in $responses.Keys)
$FoundFailure = $True
if ($respCode -eq '201')
{
Write-Error "Automatic API Review approval is pending for package $($PackageName)"
Write-Host "Package version $($version) is GA and automatic API Review is not yet approved for package $($PackageName)."
Write-Host "Build and release is not allowed for GA package without API review approval."
Write-Host "You will need to queue another build to proceed further after API review is approved"
Write-Host "You can check http://aka.ms/azsdk/engsys/apireview/faq for more details on API Approval."
}
else
{
Write-Error "Failed to create API Review for package $($PackageName)"
}
Write-Host "Failed to create API Review for package $($PackageName). Please reach out to Azure SDK engineering systems on teams channel and share this build details."
}
exit 1
}
else
{
Expand All @@ -124,8 +132,3 @@ foreach ($pkgName in $responses.Keys)
}
}
}
if ($FoundFailure)
{
Write-Error "Automatic API review is not yet approved for package $($PackageName)"
exit 1
}