diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index 1cef314133..b0ecc542ff 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -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 } @@ -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" @@ -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 { @@ -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 -}