Skip env processing on matrix import step (#5435)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
parent
3dd2a25283
commit
4affaf7b6a
@ -96,7 +96,8 @@ function GenerateMatrix(
|
||||
[String]$displayNameFilter = ".*",
|
||||
[Array]$filters = @(),
|
||||
[Array]$replace = @(),
|
||||
[Array]$nonSparseParameters = @()
|
||||
[Array]$nonSparseParameters = @(),
|
||||
[Switch]$skipEnvironmentVariables
|
||||
) {
|
||||
$matrixParameters, $importedMatrix, $combinedDisplayNameLookup = `
|
||||
ProcessImport $config.matrixParameters $selectFromMatrixType $nonSparseParameters $config.displayNamesLookup
|
||||
@ -124,7 +125,9 @@ function GenerateMatrix(
|
||||
|
||||
$matrix = FilterMatrix $matrix $filters
|
||||
$matrix = ProcessReplace $matrix $replace $combinedDisplayNameLookup
|
||||
$matrix = ProcessEnvironmentVariableReferences $matrix $combinedDisplayNameLookup
|
||||
if (!$skipEnvironmentVariables) {
|
||||
$matrix = ProcessEnvironmentVariableReferences $matrix $combinedDisplayNameLookup
|
||||
}
|
||||
$matrix = FilterMatrixDisplayName $matrix $displayNameFilter
|
||||
return $matrix
|
||||
}
|
||||
@ -427,10 +430,14 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n
|
||||
exit 1
|
||||
}
|
||||
$importedMatrixConfig = GetMatrixConfigFromFile (Get-Content -Raw $importPath)
|
||||
# Add skipEnvironmentVariables so we don't process environment variables on import
|
||||
# because we want top level filters to work against the the env key, not the value.
|
||||
# The environment variables will get resolved after the import.
|
||||
$importedMatrix = GenerateMatrix `
|
||||
-config $importedMatrixConfig `
|
||||
-selectFromMatrixType $selection `
|
||||
-nonSparseParameters $nonSparseParameters
|
||||
-nonSparseParameters $nonSparseParameters `
|
||||
-skipEnvironmentVariables
|
||||
|
||||
$combinedDisplayNameLookup = $importedMatrixConfig.displayNamesLookup
|
||||
foreach ($lookup in $displayNamesLookup.GetEnumerator()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user