Update APIView Helpers (#6500)

Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-04-01 15:00:01 -07:00 committed by GitHub
parent 19f1aa4879
commit a9d94e3084
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -168,8 +168,8 @@ function Set-ApiViewCommentForPR {
$commentText = @()
$commentText += "## API Change Check"
try {
$response = Invoke-RestMethod -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3
if ($response.Count -eq 0) {
$response = Invoke-WebRequest -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3
if ($response.StatusCode -ne 200) {
LogWarning "API changes are not detected in this pull request."
$commentText += ""
$commentText += "API changes are not detected in this pull request."
@ -179,10 +179,17 @@ function Set-ApiViewCommentForPR {
$commentText += ""
$commentText += "APIView identified API level changes in this PR and created the following API reviews"
$commentText += ""
$commentText += "| Language | API Review for Package |"
$commentText += "|----------|---------|"
$response | ForEach-Object {
$commentText += "| $($_.language) | [$($_.packageName)]($($_.url)) |"
if ($RepoName.StartsWith(("azure-sdk-for-"))) {
$response | ForEach-Object {
$commentText += "[$($_.packageName)]($($_.url))"
}
} else {
$commentText += "| Language | API Review for Package |"
$commentText += "|----------|---------|"
$response | ForEach-Object {
$commentText += "| $($_.language) | [$($_.packageName)]($($_.url)) |"
}
}
}
} catch{