Skip to content

Commit

Permalink
Update original file path value in detect change request to APIView (#…
Browse files Browse the repository at this point in the history
…1827)

Co-authored-by: Praveen Kuttappan <[email protected]>
  • Loading branch information
azure-sdk and praveenkuttappan authored Mar 3, 2025
1 parent 51484cb commit 237e18c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions eng/common/scripts/Detect-Api-Changes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,18 @@ function Submit-Request($filePath, $packageName)
$query.Add('language', $LanguageShort)
$query.Add('project', $DevopsProject)
$reviewFileFullName = Join-Path -Path $ArtifactPath $packageName $reviewFileName
# If CI generates token file then it passes both token file name and original file (filePath) to APIView
# If both files are passed then APIView downloads the parent directory as a zip
# If code file is not passed(for e.g. .NET or Java) then APIView needs full path to original file to download only that file.
if (Test-Path $reviewFileFullName)
{
$query.Add('codeFile', $reviewFileName)
# Pass only relative path in package artifact directory when code file is also present
$query.Add('filePath', (Split-Path -Leaf $filePath))
}
else
{
$query.Add('filePath', $filePath)
}
$uri = [System.UriBuilder]$APIViewUri
$uri.query = $query.toString()
Expand Down

0 comments on commit 237e18c

Please sign in to comment.