Skip to content

Deprecate ProjectType.ci_config_variables `sha` arg; add `ref` arg

Leaminn Ma requested to merge update-ci-config-variables-with-ref into master

What does this MR do and why?

This MR solves the first 3 items listed in: Backend: Deprecate "sha" parameter from CI conf... (#389065 - closed)

This MR adds the argument ref to the Types::ProjectType.ci_config_variables field and deprecates sha, as it is actually supposed to be ref.

sha will be removed in a future issue to minimize the possibility of incompatibility if the FE version is out of sync with the BE.

How to set up and validate locally

  1. Set up a project whose .gitlab-ci.yml file has the following contents:
variables:
  CONFIG_VAR_1: 'Value for CONFIG_VAR_1'
  CONFIG_VAR_2: 'Value for CONFIG_VAR_2'

job:
  script: echo
  1. Go to http://gdk.test:3000/-/graphql-explorer and run the following query (update fullPath as necessary).
query getProjectConfigVariables($fullPath: ID!, $ref: String!) {
  project(fullPath: $fullPath) {
    id
    ciConfigVariables(ref: $ref) {
      key
      value
    }
    __typename
  }
}

Variables:

{"fullPath": "group-a/project-1", "ref": "master"}
  1. Observe that the result shows both config variables:

Screenshot_2023-03-28_at_11.26.53_AM

  1. Also observe that if you update the query to ciConfigVariables(sha: $ref), you get the same result.

MR acceptance checklist

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

Related to #389065 (closed)

Edited by Leaminn Ma

Merge request reports