@@ -89,9 +89,13 @@ function Upload-SourceArtifact($filePath, $apiLabel, $releaseStatus, $packageVer
89
89
return $StatusCode
90
90
}
91
91
92
- function Upload-ReviewTokenFile ($packageName , $apiLabel , $releaseStatus , $reviewFileName , $packageVersion )
92
+ function Upload-ReviewTokenFile ($packageName , $apiLabel , $releaseStatus , $reviewFileName , $packageVersion , $filePath )
93
93
{
94
- $params = " buildId=${BuildId} &artifactName=${ArtifactName} &originalFilePath=${packageName} &reviewFilePath=${reviewFileName} "
94
+ Write-Host " Original File path: $filePath "
95
+ $fileName = Split-Path - Leaf $filePath
96
+ Write-Host " OriginalFile name: $fileName "
97
+
98
+ $params = " buildId=${BuildId} &artifactName=${ArtifactName} &originalFilePath=${fileName} &reviewFilePath=${reviewFileName} "
95
99
$params += " &label=${apiLabel} &repoName=${RepoName} &packageName=${packageName} &project=internal&packageVersion=${packageVersion} "
96
100
if ($MarkPackageAsShipped ) {
97
101
$params += " &setReleaseTag=true"
@@ -135,17 +139,17 @@ function Get-APITokenFileName($packageName)
135
139
}
136
140
}
137
141
138
- function Submit-APIReview ($packageInfo , $packagePath )
142
+ function Submit-APIReview ($packageInfo , $packagePath , $packageArtifactName )
139
143
{
140
144
$packageName = $packageInfo.Name
141
145
$apiLabel = " Source Branch:${SourceBranch} "
142
146
143
147
# Get generated review token file if present
144
148
# APIView processes request using different API if token file is already generated
145
- $reviewTokenFileName = Get-APITokenFileName $packageName
149
+ $reviewTokenFileName = Get-APITokenFileName $packageArtifactName
146
150
if ($reviewTokenFileName ) {
147
151
Write-Host " Uploading review token file $reviewTokenFileName to APIView."
148
- return Upload- ReviewTokenFile $packageName $apiLabel $packageInfo.ReleaseStatus $reviewTokenFileName $packageInfo.Version
152
+ return Upload- ReviewTokenFile $packageName $apiLabel $packageInfo.ReleaseStatus $reviewTokenFileName $packageInfo.Version $packagePath
149
153
}
150
154
else {
151
155
Write-Host " Uploading $packagePath to APIView."
@@ -205,7 +209,7 @@ function ProcessPackage($packageName)
205
209
if ( ($SourceBranch -eq $DefaultBranch ) -or (-not $version.IsPrerelease ) -or $MarkPackageAsShipped )
206
210
{
207
211
Write-Host " Submitting API Review request for package $ ( $pkg ) , File path: $ ( $pkgPath ) "
208
- $respCode = Submit-APIReview $pkgInfo $pkgPath
212
+ $respCode = Submit-APIReview $pkgInfo $pkgPath $packageName
209
213
Write-Host " HTTP Response code: $ ( $respCode ) "
210
214
211
215
# no need to check API review status when marking a package as shipped
0 commit comments