Skip to content

Updates Config::Entry::Variable value to support array

What does this MR do and why?

  • Make Config::Entry::Variable value support an array of values for a variable
  • Add allow_array metadata to the variables keyword in Entry::Root to only allow top-level variables to have array values.
  • Update the value field for ConfigVariableType to support multiple values. Since GraphQL does not support scalar unions, we are going to support either an array of stings or a string wrapped in an array.

Screenshots or screen recordings

GraphQL:

query {
  project(fullPath: "root/variables-test"){
    ciConfigVariables(sha:"0dbda96f0c5a5979c80dd56325f2a85c4e92f349"){
    	description
      key
      value
    }
  }
}
{
  "data": {
    "project": {
      "ciConfigVariables": [
        {
          "description": "The deployment target. Change this variable to 'canary' or 'production' if needed.",
          "key": "DEPLOY_ENVIRONMENT",
          "value": ["staging", "Production"]
        }
      ]
    }
  }
}

image

image

NOTE: This work is backend support for frontend: !96542 (merged), which is under the run_pipeline_graphql feature flag.

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

Loading