Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 2046 #20911

Merged
merged 3 commits into from
Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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])"
}