Loading
Add value aliases to parallel:matrix job names
What does this MR do and why?
Adds an optional { value:, alias: } form for parallel:matrix values. The alias is used in the generated job name, while the CI/CD variable keeps the full value. This keeps job names readable and under the 255-character limit when matrix values are long, such as image references, URLs, or paths.
build:
parallel:
matrix:
- OS: [ubuntu, alpine]
IMAGE:
- value: registry.example.com/builder-u20:0.0.3
alias: u20
- registry.example.com/builder-u22:0.0.1This generates build: [ubuntu, u20], build: [ubuntu, registry.example.com/builder-u22:0.0.1], and so on. $IMAGE always contains the full value.
needs:parallel:matrixfinds the needed job by its full value or its alias. Thevalue/aliashash form is rejected inneeds.- When aliases are used, matrices that generate duplicate job names are rejected. Matrices without aliases keep the current behavior.
- The CI JSON schema is not changed yet: the pipeline rejects the new form while the flag is disabled, so the editor should too. The schema update will follow with the rollout in #634481.
- The change is behind the
ci_parallel_matrix_value_aliasfeature flag (beta, disabled by default). With the flag disabled, the hash form fails validation.
This builds on the patch that @nikhil_raman shared in the issue.
References
- Related to #285853
- Design agreed in #285853 (comment 1987955811)
- Related epic: &11791
Screenshots or screen recordings
Not applicable: no UI changes. Job names keep the existing job: [a, b] format.
How to set up and validate locally
- In the Rails console, enable the feature flag:
Feature.enable(:ci_parallel_matrix_value_alias) - Run a pipeline with the example from
doc/ci/yaml/_index.md#parallelmatrix. - Check the job names, and check that
$IMAGEcontains the full value in each job.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Ugo Mignon