Allow for variable substitution in CI tag names (Dynamic Tags)
Note
The issue to follow for the Dynamic Tags use case is the Expand YAML element values using new topological sorting logic
Problem to solve
This is a feature request coming from a previously closed issue. There has been requests from multiple customers to implement it. This feature would allow tags within the gitlab-ci.yml file to be able to utilize variables, which they currently are not able to.
In this closed issue, a user points out that utilizing a variable like $CI_BUILD_REF_NAME
does not work and actually hangs in the tags:
section.
deploy:
stage: deploy
environment:
name: $CI_BUILD_REF_NAME
only:
- /^env-.*$/
tags:
- deploy
- $CI_BUILD_REF_NAME
This is similar, and possibly related to #14543 (closed) but not exactly the same per this comment.
Intended users
Further details
The issue has been closed but multiple paying customers in the last ~5 months have asked for it to be looked at as a viable feature again.
Proposal
The proposal from the previous issue included these possible solutions --
When evaluating a .gitlab-ci.yml file to schedule a job, first perform variable substitution prior to the logic used for selecting a runner.
Additionally consider implementing regex-style variable manipulation as proposed in gitlab-foss#24044 (closed). These two improvements combined would be especially powerful.
Permissions and Security
Documentation
Testing
What does success look like, and how can we measure that?
What is the type of buyer?
Links / references
Related issues:
Related customer info:
- https://gitlab.zendesk.com/agent/tickets/134282
- https://gitlab.zendesk.com/agent/tickets/78493
- Large customer interested in feature: https://gitlab.my.salesforce.com/00161000008qoc2