Skip to content

Commit fd5beac

Browse files
authored
Handle PR changes in the root of the repository (Azure#39771)
* Handle PR changes in the root of the repository * dedupe the changedServices list prior to processing
1 parent bed0e9e commit fd5beac

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,17 @@ function Get-python-AdditionalValidationPackagesFromPackageSet {
6262
$changedServices += $pathComponents[1]
6363
}
6464

65-
# handle any changes under sdk/<file>.<extension>
66-
if ($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") {
65+
# handle any changes under sdk/<file>.<extension> as well as any
66+
# changes to the root of the repository. Changes to the root of
67+
# repository is the case where pathComponents.Lenght -eq 1
68+
if (($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") -or
69+
($pathComponents.Length -eq 1)) {
6770
$changedServices += "template"
6871
}
6972
}
73+
74+
# dedupe the changed service list before processing
75+
$changedServices = $changedServices | Get-Unique
7076
foreach ($changedService in $changedServices) {
7177
$additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService }
7278

@@ -91,8 +97,6 @@ function Get-python-AdditionalValidationPackagesFromPackageSet {
9197
$othersChanged = $targetedFiles | Where-Object { isOther($_) }
9298
}
9399

94-
$changedServices = $changedServices | Get-Unique
95-
96100
if ($toolChanged) {
97101
$additionalPackages = @(
98102
"azure-storage-blob",

0 commit comments

Comments
 (0)