From 95593f6fd5acdcadc457eaf7d9d821216d335550 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:10:57 -0400 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 7975 (#35013) * Pass Group in request to get package status --- eng/common/scripts/Validate-Package.ps1 | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/eng/common/scripts/Validate-Package.ps1 b/eng/common/scripts/Validate-Package.ps1 index 57f093d76e69..b12007559a82 100644 --- a/eng/common/scripts/Validate-Package.ps1 +++ b/eng/common/scripts/Validate-Package.ps1 @@ -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 } } \ No newline at end of file