From 9eb12d68ba72e07799358e035fc7844121813b55 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 3752101717..115c6eaf8a 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 1113ba06f715d0ea25a7a23eb49c359dd58a3985 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 115c6eaf8a..257ea37c4f 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 28480b95d0fcb3805b3c579b28d8971ed158da0f 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 257ea37c4f..3c88398ce5 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])" }