Skip to content

Commit 0c1c5e2

Browse files
Sync eng/common directory with azure-sdk-tools for PR 1448 (Azure#17085)
* Added more logging to API view create * Updated logs with arch board rescue email address * Fix as per review comments * Update logging to show API URL Co-authored-by: praveenkuttappan <[email protected]>
1 parent 4ab18e2 commit 0c1c5e2

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

eng/common/scripts/Create-APIReview.ps1

+12-9
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel)
4141
try
4242
{
4343
$Response = Invoke-WebRequest -Method 'POST' -Uri $uri -Body $multipartContent -Headers $headers
44-
Write-Host "API Review: $($Response)"
44+
Write-Host "API Review URL: $($Response.Content)"
4545
$StatusCode = $Response.StatusCode
4646
}
4747
catch
4848
{
49+
Write-Host "Exception details: $($_.Exception.Response)"
4950
$StatusCode = $_.Exception.Response.StatusCode
5051
}
5152

@@ -101,6 +102,9 @@ foreach ($pkgName in $responses.Keys)
101102
{
102103
$pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json
103104
$version = [AzureEngSemanticVersion]::ParseVersionString($pkgInfo.Version)
105+
Write-Host "Package name: $($PackageName)"
106+
Write-Host "Version: $($version)"
107+
Write-Host "SDK Type: $($pkgInfo.SdkType)"
104108
if ($version.IsPrerelease)
105109
{
106110
Write-Host "Package version is not GA. Ignoring API view approval status"
@@ -110,12 +114,16 @@ foreach ($pkgName in $responses.Keys)
110114
$FoundFailure = $True
111115
if ($respCode -eq '201')
112116
{
113-
Write-Error "Automatic API Review approval is pending for package $($PackageName)"
117+
Write-Host "Package version $($version) is GA and automatic API Review is not yet approved for package $($PackageName)."
118+
Write-Host "Build and release is not allowed for GA package without API review approval."
119+
Write-Host "You will need to queue another build to proceed further after API review is approved"
120+
Write-Host "You can check http://aka.ms/azsdk/engsys/apireview/faq for more details on API Approval."
114121
}
115122
else
116123
{
117-
Write-Error "Failed to create API Review for package $($PackageName)"
118-
}
124+
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."
125+
}
126+
exit 1
119127
}
120128
else
121129
{
@@ -124,8 +132,3 @@ foreach ($pkgName in $responses.Keys)
124132
}
125133
}
126134
}
127-
if ($FoundFailure)
128-
{
129-
Write-Error "Automatic API review is not yet approved for package $($PackageName)"
130-
exit 1
131-
}

0 commit comments

Comments
 (0)