Skip to content

Commit 6b952dc

Browse files
authored
Handle PR changes in the root of the repository (Azure#48330)
1 parent fa9b475 commit 6b952dc

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,25 +180,23 @@ function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
180180
$pathComponents = $file -split "/"
181181
# handle changes only in sdk/<service>/<file>.<extension>
182182
if ($pathComponents.Length -eq 3 -and $pathComponents[0] -eq "sdk") {
183-
if (-not $changedServices.Contains($pathComponents[1])) {
184-
$changedServices += $pathComponents[1]
185-
}
183+
$changedServices += $pathComponents[1]
186184
}
187185

188-
# handle any changes under sdk/<file>.<extension>
189-
if ($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") {
190-
if (-not $changedServices.Contains("template")) {
191-
$changedServices += "template"
192-
}
186+
# handle any changes under sdk/<file>.<extension> or any files
187+
# in the repository root
188+
if (($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") -or
189+
($pathComponents.Length -eq 1)) {
190+
$changedServices += "template"
193191
}
194192

195193
# changes to a Azure.*.Shared within a service directory should include all packages within that service directory
196194
if ($file.Replace('\', '/') -match ".*sdk/.*/.*\.Shared/.*") {
197-
if (-not $changedServices.Contains($pathComponents[1])) {
198-
$changedServices += $pathComponents[1]
199-
}
195+
$changedServices += $pathComponents[1]
200196
}
201197
}
198+
# dedupe the changedServices list before processing
199+
$changedServices = $changedServices | Get-Unique
202200
foreach ($changedService in $changedServices) {
203201
$additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService }
204202

0 commit comments

Comments
 (0)