@@ -33,9 +33,24 @@ function Get-python-AdditionalValidationPackagesFromPackageSet {
33
33
return $startsWith
34
34
}
35
35
36
+ $changedServices = @ ()
37
+ foreach ($file in $diffObj.ChangedFiles ) {
38
+ $pathComponents = $file -split " /"
39
+ # handle changes only in sdk/<service>/<file>/<extension>
40
+ if ($pathComponents.Length -eq 3 -and $pathComponents [0 ] -eq " sdk" ) {
41
+ $changedServices += $pathComponents [1 ]
42
+ }
43
+
44
+ # handle any changes under sdk/<file>.<extension>
45
+ if ($pathComponents.Length -eq 2 -and $pathComponents [0 ] -eq " sdk" ) {
46
+ changedServices += " template"
47
+ }
48
+ }
49
+
36
50
$toolChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith (" tool" )}
37
51
$engChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith (" eng" )}
38
52
$othersChanged = $diffObj.ChangedFiles | Where-Object { isOther($_ ) }
53
+ $changedServices = $changedServices | Get-Unique
39
54
40
55
if ($toolChanged ) {
41
56
$additionalPackages = @ (
@@ -73,16 +88,21 @@ function Get-python-AdditionalValidationPackagesFromPackageSet {
73
88
$additionalValidationPackages += $additionalPackages
74
89
}
75
90
91
+ foreach ($changedService in $changedServices ) {
92
+ $additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService }
93
+ $additionalValidationPackages += $additionalPackages
94
+ }
95
+
76
96
$uniqueResultSet = @ ()
77
- foreach ($pkg in $additionalPackages ) {
97
+ foreach ($pkg in $additionalValidationPackages ) {
78
98
if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg ) {
79
99
$pkg.IncludedForValidation = $true
80
100
$uniqueResultSet += $pkg
81
101
}
82
102
}
83
103
84
104
Write-Host " Returning additional packages for validation: $ ( $uniqueResultSet.Count ) "
85
- foreach ($pkg in $uniqueResultSet ) {
105
+ foreach ($pkg in $uniqueResultSet ) {
86
106
Write-Host " - $ ( $pkg.Name ) "
87
107
}
88
108
0 commit comments