Skip to content

Updates variable value in Entry::Variable to be string rather than array and adds options

Kamil Trzciński requested to merge add-variables-options into master

What does this MR do and why?

Improves based on feedback: #363660 (comment 1189635268). Additionally significantly simplifies variables implementation.

FROM:

variables:
  DEPLOY_ENVIRONMENT:
    value: 
      - "staging"  #  staging should appear by default
      - "canary" # Canary is the second option in a dropdown list
      - "production" # Production is the third option in a dropdown list
    description: "The deployment target. Change this variable to 'canary' or 'production' if needed."

TO:

variables:
  DEPLOY_ENVIRONMENT:
    value: staging
    options: 
      - "staging"
      - "canary"
      - "production"
    description: "The deployment target. Change this variable to 'canary' or 'production' if needed."

Validation that value is contained in options:
Screenshot_2022-11-30_at_17.48.39

Run pipeline page:
Screenshot_2022-11-30_at_19.52.17

Job log (I selected production):
Screenshot_2022-11-30_at_20.09.52

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 Laura Montemayor

Merge request reports