From 2a2c508d24898bb728b5d48676b2819500777eb4 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 999d818b4b03..168260177405 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 08e774623af4ae0521bd4eff35229933e18c96c1 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 168260177405..1784521252df 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('\/')