Skip to content

Remove "sha" argument from GraphQL ciConfigVariables

Leaminn Ma requested to merge remove-sha-from-ci-config-variables into master

What does this MR do and why?

In !116032 (merged), we deprecated the sha argument from ProjectType.ci_config_variables and updated the FE to use the new ref argument. This was done as a first step to gracefully deprecate sha so that there aren't issues with the FE if it's a version behind the latest BE release.

Now that the MR thereof has been pushed to production, and the ProjectType.ci_config_variables is in alpha, we can proceed immediately with removing the sha argument altogether.

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 use sha (ciConfigVariables(sha: $ref)), you get an error output.

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 #404493 (closed)

Edited by Leaminn Ma

Merge request reports