@@ -15,7 +15,7 @@ Param (
15
15
)
16
16
17
17
# Submit API review request and return status whether current revision is approved or pending or failed to create review
18
- function Submit-APIReview ($packagename , $filePath , $uri , $apiKey , $apiLabel )
18
+ function Submit-APIReview ($packagename , $filePath , $uri , $apiKey , $apiLabel , $releaseStatus )
19
19
{
20
20
$multipartContent = [System.Net.Http.MultipartFormDataContent ]::new()
21
21
$FileStream = [System.IO.FileStream ]::new($filePath , [System.IO.FileMode ]::Open)
@@ -33,6 +33,17 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel)
33
33
$StringContent = [System.Net.Http.StringContent ]::new($apiLabel )
34
34
$StringContent.Headers.ContentDisposition = $stringHeader
35
35
$multipartContent.Add ($stringContent )
36
+ Write-Host " Request param, label: $apiLabel "
37
+
38
+ if ($releaseStatus -and ($releaseStatus -ne " Unreleased" ))
39
+ {
40
+ $compareAllParam = [System.Net.Http.Headers.ContentDispositionHeaderValue ]::new(" form-data" )
41
+ $compareAllParam.Name = " compareAllRevisions"
42
+ $compareAllParamContent = [System.Net.Http.StringContent ]::new($true )
43
+ $compareAllParamContent.Headers.ContentDisposition = $compareAllParam
44
+ $multipartContent.Add ($compareAllParamContent )
45
+ Write-Host " Request param, compareAllRevisions: true"
46
+ }
36
47
37
48
$headers = @ {
38
49
" ApiKey" = $apiKey ;
@@ -103,13 +114,14 @@ if ($packages)
103
114
104
115
Write-Host " Version: $ ( $version ) "
105
116
Write-Host " SDK Type: $ ( $pkgInfo.SdkType ) "
117
+ Write-Host " Release Status: $ ( $pkgInfo.ReleaseStatus ) "
106
118
107
119
# Run create review step only if build is triggered from main branch or if version is GA.
108
120
# This is to avoid invalidating review status by a build triggered from feature branch
109
121
if ( ($SourceBranch -eq $DefaultBranch ) -or (-not $version.IsPrerelease ))
110
122
{
111
123
Write-Host " Submitting API Review for package $ ( $pkg ) "
112
- $respCode = Submit-APIReview - packagename $pkg - filePath $pkgPath - uri $APIViewUri - apiKey $APIKey - apiLabel $APILabel
124
+ $respCode = Submit-APIReview - packagename $pkg - filePath $pkgPath - uri $APIViewUri - apiKey $APIKey - apiLabel $APILabel - releaseStatus $pkgInfo .ReleaseStatus
113
125
Write-Host " HTTP Response code: $ ( $respCode ) "
114
126
# HTTP status 200 means API is in approved status
115
127
if ($respCode -eq ' 200' )
0 commit comments