Skip to content

Commit c5e7042

Browse files
Add additional create matrix logging (#41854)
To help debug matrix filters and other generation issues add additional logging. Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
1 parent e039cb4 commit c5e7042

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

eng/common/scripts/job-matrix/Create-JobMatrix.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,27 @@ param (
2121
)
2222

2323
. $PSScriptRoot/job-matrix-functions.ps1
24+
. $PSScriptRoot/../logging.ps1
2425

2526
if (!(Test-Path $ConfigPath)) {
2627
Write-Error "ConfigPath '$ConfigPath' does not exist."
2728
exit 1
2829
}
29-
$config = GetMatrixConfigFromFile (Get-Content $ConfigPath -Raw)
30+
$rawConfig = Get-Content $ConfigPath -Raw
31+
$config = GetMatrixConfigFromFile $rawConfig
3032
# Strip empty string filters in order to be able to use azure pipelines yaml join()
3133
$Filters = $Filters | Where-Object { $_ }
3234

35+
LogGroupStart "Matrix generation configuration"
36+
Write-Host "Configuration File: $ConfigPath"
37+
Write-Host $rawConfig
38+
Write-Host "SelectionType: $Selection"
39+
Write-Host "DisplayNameFilter: $DisplayNameFilter"
40+
Write-Host "Filters: $Filters"
41+
Write-Host "Replace: $Replace"
42+
Write-Host "NonSparseParameters: $NonSparseParameters"
43+
LogGroupEnd
44+
3345
[array]$matrix = GenerateMatrix `
3446
-config $config `
3547
-selectFromMatrixType $Selection `
@@ -41,7 +53,8 @@ $Filters = $Filters | Where-Object { $_ }
4153

4254
$serialized = SerializePipelineMatrix $matrix
4355

44-
Write-Output $serialized.pretty
56+
Write-Host "Generated matrix:"
57+
Write-Host $serialized.pretty
4558

4659
if ($CI) {
4760
Write-Output "##vso[task.setVariable variable=matrix;isOutput=true]$($serialized.compressed)"

0 commit comments

Comments
 (0)