Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 7854 (#28871)
Browse files Browse the repository at this point in the history
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#7854 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
azure-sdk and benbp authored Mar 11, 2024
1 parent ecbebf5 commit ac9424e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions eng/common/scripts/job-matrix/job-matrix-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit ac9424e

Please sign in to comment.