[matrix job] allow customization of resulting job name
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Proposal
It may be interesting to allow customization of resulting job name with parallel:matrix. By exposing a variable CI_NODE_PARENT_NAME, we could let user specify the jobs name. For example
deploystacks:
parallel:
resulting_job_name: "%CI_NODE_PARENT_NAME - %PROVIDER - %STACK"
matrix:
- PROVIDER: aws
STACK:
- monitoring
- app1
- app2
- PROVIDER: ovh
STACK: [monitoring, backup, app]
- PROVIDER: [gcp, vultr]
STACK: [data, processing]
This will generate job names
deploystacks - aws - monitoringdeploystacks - aws - app1deploystacks - aws - app2-
deploystacks - ovh - monitoring...
The idea is to lower the length that can be annoying when using one dimensional matrices introduced in gitlab 13.5 and let user only expose the value of the matrix element instead of parent-node-name [ matrix item]. This behaviour leads to a troublesome experience as, to find the good job, you have to scroll and overlay with the mouse to find the right job you want to access.
Notes:
-
A bit technical side, we generate the matrix job names in https://gitlab.com/gitlab-org/gitlab/-/blob/21c01f3601d8cc2df356ec6bbb7baec3f2b73ed7/lib/gitlab/ci/config/normalizer/matrix_strategy.rb#L51-58. This will be the default naming strategy. Now, when we see
alias, we'll prefer it over the variable value. -
We'll need to support this in
needs:parallel:matrixtoo.