Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 3735 (#1324)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
azure-sdk and praveenkuttappan authored Jul 25, 2022
1 parent e129196 commit d3153c8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions eng/common/scripts/Detect-Api-Changes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function Submit-Request($filePath, $packageName)
if (!$repoName) {
$repoName = "azure/azure-sdk-for-$LanguageShort"
}
$reviewFileName = "$($packageName)_$($LanguageShort).json"
$query = [System.Web.HttpUtility]::ParseQueryString('')
$query.Add('artifactName', $ArtifactName)
$query.Add('buildId', $BuildId)
Expand All @@ -35,6 +36,12 @@ function Submit-Request($filePath, $packageName)
$query.Add('repoName', $repoName)
$query.Add('pullRequestNumber', $PullRequestNumber)
$query.Add('packageName', $packageName)
$query.Add('language', $LanguageShort)
$reviewFileFullName = Join-Path -Path $ArtifactPath $packageName $reviewFileName
if (Test-Path $reviewFileFullName)
{
$query.Add('codeFile', $reviewFileName)
}
$uri = [System.UriBuilder]$APIViewUri
$uri.query = $query.toString()
Write-Host "Request URI: $($uri.Uri.OriginalString)"
Expand Down Expand Up @@ -65,7 +72,7 @@ function Should-Process-Package($pkgPath, $packageName)
# Get package info from json file created before updating version to daily dev
$pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json
$packagePath = $pkgInfo.DirectoryPath
$modifiedFiles = Get-ChangedFiles -DiffPath "$packagePath/*" -DiffFilterType ''
$modifiedFiles = @(Get-ChangedFiles -DiffPath "$packagePath/*" -DiffFilterType '')
$filteredFileCount = $modifiedFiles.Count
Write-Host "Number of modified files for package: $filteredFileCount"
return ($filteredFileCount -gt 0 -and $pkgInfo.IsNewSdk)
Expand All @@ -80,7 +87,6 @@ function Log-Input-Params()
Write-Host "Language: $($Language)"
Write-Host "Commit SHA: $($CommitSha)"
Write-Host "Repo Name: $($RepoFullName)"
Write-Host "Package Name: $($PackageName)"
}

Log-Input-Params
Expand Down

0 comments on commit d3153c8

Please sign in to comment.