Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools repository #18282

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
# This script fragment is used across our repos to set a variable "SetDevVersion" which
# is used when this pipeline is going to be generating and publishing daily dev builds.
parameters:
ServiceDirectory: ''

steps:
- ${{if ne(parameters.ServiceDirectory, '')}}:
- task: Powershell@2
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory ${{parameters.ServiceDirectory}}
-OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Dump Package properties
condition: succeeded()
- pwsh: |
$setDailyDevBuild = "false"
if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) {
Expand Down
35 changes: 5 additions & 30 deletions eng/common/scripts/Create-APIReview.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel)
try
{
$Response = Invoke-WebRequest -Method 'POST' -Uri $uri -Body $multipartContent -Headers $headers
Write-Host "API Review: $($Response)"
$StatusCode = $Response.StatusCode
}
catch
Expand Down Expand Up @@ -82,47 +81,23 @@ else
}

$FoundFailure = $False
$pkgInfoPath = Join-Path -Path $ArtifactPath "PackageInfo"
foreach ($pkgName in $responses.Keys)
{
$respCode = $responses[$pkgName]
if ($respCode -ne '200')
{
$pkgPropPath = Join-Path -Path $pkgInfoPath ($PackageName + ".json")
if (-Not (Test-Path $pkgPropPath))
$FoundFailure = $True
if ($respCode -eq '201')
{
Write-Host " Package property file path $($pkgPropPath) is invalid."
$FoundFailure = $True
Write-Host "API Review is pending for package $pkgName"
}
else
{
$pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json
$version = [AzureEngSemanticVersion]::ParseVersionString($pkgInfo.Version)
if ($version.IsPrerelease)
{
Write-Host "Package version is not GA. Ignoring API view approval status"
}
elseif ($pkgInfo.SdkType -eq "client" -and $pkgInfo.IsNewSdk)
{
$FoundFailure = $True
if ($respCode -eq '201')
{
Write-Error "Automatic API Review approval is pending for package $($PackageName)"
}
else
{
Write-Error "Failed to create API Review for package $($PackageName)"
}
}
else
{
Write-Host "API review is not approved for package $($PackageName). Management and track1 package can be released without API review approval."
}
Write-Host "Failed to create API Review for package $pkgName"
}
}
}
if ($FoundFailure)
{
Write-Error "Automatic API review is not yet approved for package $($PackageName)"
exit 1
Write-Host "Atleast one API review is not yet approved"
}
2 changes: 0 additions & 2 deletions eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class PackageProps
[string]$ReadMePath
[string]$ChangeLogPath
[string]$Group
[string]$SdkType
[boolean]$IsNewSdk

PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory)
{
Expand Down
34 changes: 0 additions & 34 deletions eng/common/scripts/Save-Package-Properties.ps1

This file was deleted.