Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 46,531
    • Issues 46,531
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,507
    • Merge requests 1,507
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and 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.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #364643
Closed
Open
Issue created Jun 08, 2022 by Grzegorz Korba@Wirone📖Contributor

[Docs] Misinformation about nesting `!reference`

There is information:

You can't reuse a section that already includes a !reference tag. Only one level of nesting is supported.

But today my colleague did some refactoring and used something like this:

.notification:
  icon:
    - MSG_ICON=$(if [[ $CI_JOB_STATUS == "success" ]]; then echo ":white_check_mark:"; else echo ":warning:"; fi)
  image_build:
    - !reference [ .notification, icon ]
    - ...

.actual_job:
  script:
    - ...
  after_script:
    - !reference [ .notification, image_build ]

and it worked properly 🤔 So what is the current state of !reference - does it support nesting? If yes, what are the limitations? Or maybe the wording is incorrect, so in fact "one level of nesting is supported" (and then "You can't reuse a section that already includes a !reference tag" is misleading)?

We use Gitlab 14.10.

Assignee
Assign to
Time tracking