From 1301a98331f5cf3a02f11ce2c5d35dd44cfbe8d4 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Tue, 14 Jan 2025 16:16:29 -0800 Subject: [PATCH 1/2] ensure that packages that come back from AdditionalValidationPackages are NOT counted as 'includedForValidation: true' if they also exist in the original 'these packages changed' set --- eng/common/scripts/Package-Properties.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 999d818b4b0..16826017740 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -187,12 +187,17 @@ function Get-PrPkgProperties([string]$InputDiffJson) { } } + $existingPackageNames = $packagesWithChanges | ForEach-Object { $_.Name } foreach ($addition in $additionalValidationPackages) { $key = $addition.Replace($RepoRoot, "").TrimStart('\/') if ($lookup[$key]) { - $lookup[$key].IncludedForValidation = $true - $packagesWithChanges += $lookup[$key] + $pkg = $lookup[$key] + + if ($pkg.Name -notin $existingPackageNames) { + $pkg.IncludedForValidation = $true + $packagesWithChanges += $pkg + } } } From 4b6603bd70b2d92924219efcecdd56ffbb33d11d Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:38:05 -0800 Subject: [PATCH 2/2] Update eng/common/scripts/Package-Properties.ps1 Co-authored-by: Ben Broderick Phillips --- eng/common/scripts/Package-Properties.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 16826017740..1784521252d 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -187,7 +187,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) { } } - $existingPackageNames = $packagesWithChanges | ForEach-Object { $_.Name } + $existingPackageNames = @($packagesWithChanges | ForEach-Object { $_.Name }) foreach ($addition in $additionalValidationPackages) { $key = $addition.Replace($RepoRoot, "").TrimStart('\/')