Skip to content

Add expanded attribute to variables settings

Mireya Andres requested to merge nonexpanded-variables-setting into master

What does this MR do and why?

frontend implementation for #217309 (closed).

Expanded variables will treat values with the $ as a variable reference. Unexpanded variables will otherwise treat them as raw strings.

This MR adds the ability to toggle this attribute for project and group CI/CD variables through the settings page.

Screenshots or screen recordings

Expanded Enabled Expanded Disabled
Screen_Shot_2022-10-27_at_01.54.05 Screen_Shot_2022-10-27_at_01.54.16

Adding/Updating a Variable

Screen_Recording_2022-12-02_at_23.51.48

How to set up and validate locally

  1. For a project or group, go to Settings > CI/CD. Expand the Variables section.
  2. Verify that the Expanded column is in the variables table.
  3. Click Add Variable modal.
  4. Expand variable reference checkbox should be available.
  5. If variable is expanded and value has a $ character, the Variable Reference alert is rendered.
  6. If variable is NOT expanded, value field will show the following tip: Variable value will be evaluated as raw string.
  7. User should also be able to set the variable as expanded or non-expanded when editing an existing variable.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Mireya Andres

Merge request reports