Frontend: Surface pre-defined variables used by a job in the job detail page

Release notes

Problem to solve

It's not possible to tell which variables are used by a job by looking at the pipeline or job UI. It makes it difficult to debug pipelines. See related issue #22204 (closed)

Proposal

Show a list of pre-define variables only used by a job in a Variables tab of the job detail page. The variables that we'll show will be the same variables that can be outputted using the env command. See the related discussion while excluding custom variables that defined through the UI or YAML and the different tokens (CI_JOB_TOKEN, JWT token)

  • In the variables tab, show a list of the variables
  • The list is view-only, formatted as a table
  • The list will present ONLY the predefined variables while excluding the various tokens (e.g. CI_JOB_TOKEN, JWT tokens)
  • When the list of variables is long the list will be scrollable like the logs
  • It should be possible to search the list by using the native keyboard shortcut for searching (CMD+F on Mac)

👉 Design on Figma

Job logs Variables
image image

Permissions

Use the same permissions that we follow for viewing Settings>>CI/CD for projects for added precaution. If user doesn't have permissions to view variables, don't show the Variables tab.

Open questions

  • Does the env command output all variables used by the job? Are any variables types missing that we need to consider and communicate to the user that they won't show up in the variables tab?

Intended users

Feature Usage Metrics

Track the usage of the Variables tab.

Tier

Available to Premium customers only

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by Dov Hershkovitch