From fb59024217d7e49ecd4ae7779d8f3894464652d2 Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Tue, 28 Sep 2021 13:46:27 -0400 Subject: [PATCH 1/3] Pass package name from calling pipeline to uniquely identify pull request review --- eng/common/scripts/Detect-Api-Changes.ps1 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index 375210171794..115c6eaf8a71 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -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) { @@ -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)" @@ -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) @@ -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 @@ -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 detectiopn request status for $pkg: $($responses[$pkg])" } From 1b59452346c0d9907d3518406507908c874ebb0a Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Tue, 28 Sep 2021 14:52:22 -0400 Subject: [PATCH 2/3] Update log summary --- eng/common/scripts/Detect-Api-Changes.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index 115c6eaf8a71..257ea37c4f55 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -112,5 +112,5 @@ foreach ($artifact in $ArtifactList) foreach($pkg in $responses.keys) { - Write-Host "API detectiopn request status for $pkg: $($responses[$pkg])" + Write-Host "API detectiopn request status for $($pkg) : $($responses[$pkg])" } From ae6b871f2ecefeffe590e6fc1f3644fb4a1005f5 Mon Sep 17 00:00:00 2001 From: praveenkuttappan <55455725+praveenkuttappan@users.noreply.github.com> Date: Tue, 28 Sep 2021 15:53:04 -0400 Subject: [PATCH 3/3] Update eng/common/scripts/Detect-Api-Changes.ps1 Co-authored-by: Wes Haggard --- eng/common/scripts/Detect-Api-Changes.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index 257ea37c4f55..3c88398ce55d 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -112,5 +112,5 @@ foreach ($artifact in $ArtifactList) foreach($pkg in $responses.keys) { - Write-Host "API detectiopn request status for $($pkg) : $($responses[$pkg])" + Write-Host "API detection request status for $($pkg) : $($responses[$pkg])" }