Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 2046 (Azure#20911)
Browse files Browse the repository at this point in the history
* Pass package name from calling pipeline to uniquely identify pull request review

* Update log summary

* Update eng/common/scripts/Detect-Api-Changes.ps1

Co-authored-by: Wes Haggard <[email protected]>

Co-authored-by: praveenkuttappan <[email protected]>
Co-authored-by: praveenkuttappan <[email protected]>
Co-authored-by: Wes Haggard <[email protected]>
  • Loading branch information
4 people authored Sep 29, 2021
1 parent c1c84eb commit 6216cd9
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions eng/common/scripts/Detect-Api-Changes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Param (
)

# Submit API review request and return status whether current revision is approved or pending or failed to create review
function Submit-Request($filePath)
function Submit-Request($filePath, $packageName)
{
$repoName = $RepoFullName
if (!$repoName) {
Expand All @@ -29,6 +29,7 @@ function Submit-Request($filePath)
$query.Add('commitSha', $CommitSha)
$query.Add('repoName', $repoName)
$query.Add('pullRequestNumber', $PullRequestNumber)
$query.Add('packageName', $packageName)
$uri = [System.UriBuilder]$APIViewUri
$uri.query = $query.toString()
Write-Host "Request URI: $($uri.Uri.OriginalString)"
Expand Down Expand Up @@ -71,6 +72,7 @@ function Log-Input-Params()
Write-Host "Language: $($Language)"
Write-Host "Commit SHA: $($CommitSha)"
Write-Host "Repo Name: $($RepoFullName)"
Write-Host "Package Name: $($PackageName)"
}

. (Join-Path $PSScriptRoot common.ps1)
Expand All @@ -95,7 +97,7 @@ foreach ($artifact in $ArtifactList)
if (Should-Process-Package -pkgPath $pkgPath -packageName $artifact.name)
{
$filePath = $pkgPath.Replace($ArtifactPath , "").Replace("\", "/")
$respCode = Submit-Request -filePath $filePath
$respCode = Submit-Request -filePath $filePath -packageName $artifact.name
if ($respCode -ne '200')
{
$responses[$artifact.name] = $respCode
Expand All @@ -108,12 +110,7 @@ foreach ($artifact in $ArtifactList)
}
}

if ($responses)
foreach($pkg in $responses.keys)
{
# Will update this with a link to wiki on how to resolve
Write-Warning "API change detection failed for following packages. Please check above for package level error details."
foreach($pkg in $responses.keys)
{
Write-Host "$pkg failed with $($responses[$pkg]) code"
}
Write-Host "API detection request status for $($pkg) : $($responses[$pkg])"
}

0 comments on commit 6216cd9

Please sign in to comment.