Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable API review gen in CI for Go (#18235)
* Enable API review gen in CI for Go
- Loading branch information
1 parent
d17638f
commit 931f528
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Param( | ||
[Parameter(Mandatory=$True)] | ||
[string] $ServiceDirectory, | ||
[Parameter(Mandatory=$True)] | ||
[string] $OutPath, | ||
[Parameter(Mandatory=$True)] | ||
[string] $ApiviewUri, | ||
[Parameter(Mandatory=$True)] | ||
[string] $ApiKey, | ||
[Parameter(Mandatory=$True)] | ||
[string] $ApiLabel, | ||
[Parameter(Mandatory=$True)] | ||
[string] $SourceBranch, | ||
[Parameter(Mandatory=$True)] | ||
[string] $DefaultBranch, | ||
[Parameter(Mandatory=$True)] | ||
[string] $ConfigFileDir | ||
) | ||
|
||
|
||
Write-Host "$PSScriptRoot" | ||
. (Join-Path $PSScriptRoot .. common scripts common.ps1) | ||
$createReviewScript = (Join-Path $PSScriptRoot .. common scripts Create-APIReview.ps1) | ||
|
||
foreach ($sdk in (Get-AllPackageInfoFromRepo $ServiceDirectory)) | ||
{ | ||
Write-Host "Creating API review artifact for $($sdk.Name)" | ||
New-Item -ItemType Directory -Path $OutPath/$($sdk.Name) -force | ||
$fileName = Split-Path -Path $sdk.Name -Leaf | ||
Compress-Archive -Path $sdk.DirectoryPath -DestinationPath $outPath/$($sdk.Name)/$fileName -force | ||
Rename-Item $outPath/$($sdk.Name)/$fileName.zip -NewName "$fileName.gosource" | ||
|
||
Write-Host "Send request to APIView to create review for $($sdk.Name)" | ||
&($createReviewScript) -ArtifactPath $outPath -APIViewUri $ApiviewUri -APIKey $ApiKey -APILabel $ApiLabel -PackageName $sdk.Name -SourceBranch $SourceBranch -DefaultBranch $DefaultBranch -ConfigFileDir $ConfigFileDir | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters