From 04dc5357e9c425b268f92ffc1ebb2fc9758ce3f3 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Sun, 2 Mar 2025 22:21:12 -0500 Subject: [PATCH] Update original file path value in detect change request to APIView --- eng/common/scripts/Detect-Api-Changes.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index 831c55dedc1..6be93332118 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -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()