Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 43,072
    • Issues 43,072
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,384
    • Merge requests 1,384
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #35742
Closed (duplicated) (duplicated)
Open
Created Nov 06, 2019 by Julianne Gendrano@jgendrano

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

  • Devon (DevOps Engineer)
  • Sidney (Systems Administrator)

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:

  • gitlab-foss#24207 (closed)
  • #14543 (closed)

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
Edited Oct 04, 2021 by Darren Eastman
Assignee
Assign to
Time tracking