Deprecate ProjectType.ci_config_variables `sha` arg; add `ref` arg
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
- 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
- Go to
http://gdk.test:3000/-/graphql-explorer
and run the following query (updatefullPath
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"}
- Observe that the result shows both config variables:
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #389065 (closed)
Edited by Leaminn Ma