Sync eng/common directory with azure-sdk-tools for PR 7975 (#7380)

* Pass Group in request to get package status

* Refer package name from package info to query API review status

* fix unknown property error

---------

Co-authored-by: Praveen Kuttappan <prmarott@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-04-01 13:12:29 -04:00 коммит произвёл GitHub
Родитель 708af9dfe2
Коммит 50be724724
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 17 добавлений и 8 удалений

Просмотреть файл

@ -187,21 +187,21 @@ function CreateUpdatePackageWorkItem($pkgInfo)
}
# Read package property file and identify all packages to process
Write-Host "Processing package: $PackageName"
Write-Host "Processing artifact: $PackageName"
Write-Host "Is Release Build: $IsReleaseBuild"
$packagePropertyFile = Join-Path $ConfigFileDir "$PackageName.json"
$pkgInfo = Get-Content $packagePropertyFile | ConvertFrom-Json
$pkgName = $pkgInfo.Name
$changeLogPath = $pkgInfo.ChangeLogPath
$versionString = $pkgInfo.Version
Write-Host "Checking if we need to create or update work item for package $packageName with version $versionString."
$isShipped = IsVersionShipped $packageName $versionString
Write-Host "Checking if we need to create or update work item for package $pkgName with version $versionString."
$isShipped = IsVersionShipped $pkgName $versionString
if ($isShipped) {
Write-Host "Package work item already exists for version [$versionString] that is marked as shipped. Skipping the update of package work item."
exit 0
}
Write-Host "Validating package $packageName with version $versionString."
Write-Host "Validating package $pkgName with version $versionString."
# Change log validation
$changeLogStatus = [PSCustomObject]@{
@ -212,10 +212,19 @@ $changeLogStatus = [PSCustomObject]@{
ValidateChangeLog $changeLogPath $versionString $changeLogStatus
# API review and package name validation
$apireviewDetails = VerifyAPIReview $PackageName $pkgInfo.Version $Language
$fulPackageName = $pkgName
$groupId = $null
if ($pkgInfo.PSObject.Members.Name -contains "Group") {
$groupId = $pkgInfo.Group
}
if ($groupId){
$fulPackageName = "${groupId}:${pkgName}"
}
Write-Host "Checking API review status for package $fulPackageName"
$apireviewDetails = VerifyAPIReview $fulPackageName $pkgInfo.Version $Language
$pkgValidationDetails= [PSCustomObject]@{
Name = $PackageName
Name = $pkgName
Version = $pkgInfo.Version
ChangeLogValidation = $changeLogStatus
APIReviewValidation = $apireviewDetails.ApiviewApproval
@ -246,7 +255,7 @@ Write-Host "Package Name status:" $apireviewDetails.PackageNameApproval.Status
if ($IsReleaseBuild)
{
if (!$updatedWi -or $changelogStatus.Status -ne "Success" -or $apireviewDetails.ApiviewApproval.Status -ne "Approved" -or $apireviewDetails.PackageNameApproval.Status -ne "Approved") {
Write-Error "At least one of the Validations above failed for package $PackageName with version $versionString."
Write-Error "At least one of the Validations above failed for package $pkgName with version $versionString."
exit 1
}
}