@@ -40,34 +40,43 @@ function Get-python-AdditionalValidationPackagesFromPackageSet {
4040 # packages WITHIN that service. This is because the service level file changes are likely to
4141 # have an impact on the packages within that service.
4242 $changedServices = @ ()
43- foreach ($file in $diffObj.ChangedFiles ) {
44- $pathComponents = $file -split " /"
45- # handle changes only in sdk/<service>/<file>/<extension>
46- if ($pathComponents.Length -eq 3 -and $pathComponents [0 ] -eq " sdk" ) {
47- $changedServices += $pathComponents [1 ]
48- }
43+ if ($diffObj.ChangedFiles ) {
44+ foreach ($file in $diffObj.ChangedFiles ) {
45+ $pathComponents = $file -split " /"
46+ # handle changes only in sdk/<service>/<file>/<extension>
47+ if ($pathComponents.Length -eq 3 -and $pathComponents [0 ] -eq " sdk" ) {
48+ $changedServices += $pathComponents [1 ]
49+ }
4950
50- # handle any changes under sdk/<file>.<extension>
51- if ($pathComponents.Length -eq 2 -and $pathComponents [0 ] -eq " sdk" ) {
52- $changedServices += " template"
51+ # handle any changes under sdk/<file>.<extension>
52+ if ($pathComponents.Length -eq 2 -and $pathComponents [0 ] -eq " sdk" ) {
53+ $changedServices += " template"
54+ }
5355 }
54- }
55- foreach ( $changedService in $changedServices ) {
56- $additionalPackages = $AllPkgProps | Where-Object { $_ .ServiceDirectory -eq $changedService }
57-
58- foreach ( $ pkg in $additionalPackages ) {
59- if ( $uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg ) {
60- # notice the lack of setting IncludedForValidation to true. This is because these " changed services"
61- # are specifically where a file within the service, but not an individual package within that service has changed.
62- # we want this package to be fully validated
63- $uniqueResultSet += $pkg
56+ foreach ( $changedService in $changedServices ) {
57+ $additionalPackages = $AllPkgProps | Where-Object { $_ .ServiceDirectory -eq $changedService }
58+
59+ foreach ( $pkg in $additionalPackages ) {
60+ if ( $uniqueResultSet -notcontains $ pkg -and $LocatedPackages -notcontains $pkg ) {
61+ # notice the lack of setting IncludedForValidation to true. This is because these "changed services"
62+ # are specifically where a file within the service, but not an individual package within that service has changed.
63+ # we want this package to be fully validated
64+ $uniqueResultSet += $pkg
65+ }
6466 }
6567 }
6668 }
6769
68- $toolChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith (" tool" )}
69- $engChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith (" eng" )}
70- $othersChanged = $diffObj.ChangedFiles | Where-Object { isOther($_ ) }
70+ $toolChanged = @ ()
71+ $othersChanged = @ ()
72+ $engChanged = @ ()
73+
74+ if ($diffObj.ChangedFiles ) {
75+ $toolChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith (" tool" )}
76+ $engChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith (" eng" )}
77+ $othersChanged = $diffObj.ChangedFiles | Where-Object { isOther($_ ) }
78+ }
79+
7180 $changedServices = $changedServices | Get-Unique
7281
7382 if ($toolChanged ) {
0 commit comments