Update original file path value in detect change request to APIView (#6443)
Co-authored-by: Praveen Kuttappan <prmarott@microsoft.com>
This commit is contained in:
parent
3dd0144c64
commit
4983de1fb5
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user