Skip to content

Commit ea2d3ad

Browse files
Sync eng/common directory with azure-sdk-tools for PR 3735 (#3845)
* Detect API changes using new snadboxinx approach * Added strictmode * Remove unset variable * Changes as per strict mode 3 * Rervert strict mode to allow language level fixes to merge first Co-authored-by: praveenkuttappan <[email protected]>
1 parent 8cb8a43 commit ea2d3ad

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function Submit-Request($filePath, $packageName)
2727
if (!$repoName) {
2828
$repoName = "azure/azure-sdk-for-$LanguageShort"
2929
}
30+
$reviewFileName = "$($packageName)_$($LanguageShort).json"
3031
$query = [System.Web.HttpUtility]::ParseQueryString('')
3132
$query.Add('artifactName', $ArtifactName)
3233
$query.Add('buildId', $BuildId)
@@ -35,6 +36,12 @@ function Submit-Request($filePath, $packageName)
3536
$query.Add('repoName', $repoName)
3637
$query.Add('pullRequestNumber', $PullRequestNumber)
3738
$query.Add('packageName', $packageName)
39+
$query.Add('language', $LanguageShort)
40+
$reviewFileFullName = Join-Path -Path $ArtifactPath $packageName $reviewFileName
41+
if (Test-Path $reviewFileFullName)
42+
{
43+
$query.Add('codeFile', $reviewFileName)
44+
}
3845
$uri = [System.UriBuilder]$APIViewUri
3946
$uri.query = $query.toString()
4047
Write-Host "Request URI: $($uri.Uri.OriginalString)"
@@ -65,7 +72,7 @@ function Should-Process-Package($pkgPath, $packageName)
6572
# Get package info from json file created before updating version to daily dev
6673
$pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json
6774
$packagePath = $pkgInfo.DirectoryPath
68-
$modifiedFiles = Get-ChangedFiles -DiffPath "$packagePath/*" -DiffFilterType ''
75+
$modifiedFiles = @(Get-ChangedFiles -DiffPath "$packagePath/*" -DiffFilterType '')
6976
$filteredFileCount = $modifiedFiles.Count
7077
Write-Host "Number of modified files for package: $filteredFileCount"
7178
return ($filteredFileCount -gt 0 -and $pkgInfo.IsNewSdk)
@@ -80,7 +87,6 @@ function Log-Input-Params()
8087
Write-Host "Language: $($Language)"
8188
Write-Host "Commit SHA: $($CommitSha)"
8289
Write-Host "Repo Name: $($RepoFullName)"
83-
Write-Host "Package Name: $($PackageName)"
8490
}
8591

8692
Log-Input-Params

0 commit comments

Comments
 (0)