Skip to content

Commit 95593f6

Browse files
authored
Sync eng/common directory with azure-sdk-tools for PR 7975 (#35013)
* Pass Group in request to get package status
1 parent 6e8c5c9 commit 95593f6

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

eng/common/scripts/Validate-Package.ps1

+17-8
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,21 @@ function CreateUpdatePackageWorkItem($pkgInfo)
187187
}
188188

189189
# Read package property file and identify all packages to process
190-
Write-Host "Processing package: $PackageName"
190+
Write-Host "Processing artifact: $PackageName"
191191
Write-Host "Is Release Build: $IsReleaseBuild"
192192
$packagePropertyFile = Join-Path $ConfigFileDir "$PackageName.json"
193193
$pkgInfo = Get-Content $packagePropertyFile | ConvertFrom-Json
194-
194+
$pkgName = $pkgInfo.Name
195195
$changeLogPath = $pkgInfo.ChangeLogPath
196196
$versionString = $pkgInfo.Version
197-
Write-Host "Checking if we need to create or update work item for package $packageName with version $versionString."
198-
$isShipped = IsVersionShipped $packageName $versionString
197+
Write-Host "Checking if we need to create or update work item for package $pkgName with version $versionString."
198+
$isShipped = IsVersionShipped $pkgName $versionString
199199
if ($isShipped) {
200200
Write-Host "Package work item already exists for version [$versionString] that is marked as shipped. Skipping the update of package work item."
201201
exit 0
202202
}
203203

204-
Write-Host "Validating package $packageName with version $versionString."
204+
Write-Host "Validating package $pkgName with version $versionString."
205205

206206
# Change log validation
207207
$changeLogStatus = [PSCustomObject]@{
@@ -212,10 +212,19 @@ $changeLogStatus = [PSCustomObject]@{
212212
ValidateChangeLog $changeLogPath $versionString $changeLogStatus
213213

214214
# API review and package name validation
215-
$apireviewDetails = VerifyAPIReview $PackageName $pkgInfo.Version $Language
215+
$fulPackageName = $pkgName
216+
$groupId = $null
217+
if ($pkgInfo.PSObject.Members.Name -contains "Group") {
218+
$groupId = $pkgInfo.Group
219+
}
220+
if ($groupId){
221+
$fulPackageName = "${groupId}:${pkgName}"
222+
}
223+
Write-Host "Checking API review status for package $fulPackageName"
224+
$apireviewDetails = VerifyAPIReview $fulPackageName $pkgInfo.Version $Language
216225

217226
$pkgValidationDetails= [PSCustomObject]@{
218-
Name = $PackageName
227+
Name = $pkgName
219228
Version = $pkgInfo.Version
220229
ChangeLogValidation = $changeLogStatus
221230
APIReviewValidation = $apireviewDetails.ApiviewApproval
@@ -246,7 +255,7 @@ Write-Host "Package Name status:" $apireviewDetails.PackageNameApproval.Status
246255
if ($IsReleaseBuild)
247256
{
248257
if (!$updatedWi -or $changelogStatus.Status -ne "Success" -or $apireviewDetails.ApiviewApproval.Status -ne "Approved" -or $apireviewDetails.PackageNameApproval.Status -ne "Approved") {
249-
Write-Error "At least one of the Validations above failed for package $PackageName with version $versionString."
258+
Write-Error "At least one of the Validations above failed for package $pkgName with version $versionString."
250259
exit 1
251260
}
252261
}

0 commit comments

Comments
 (0)