Frontend: Use GraphQL for instance CI variables
Summary
The frontend for grouppipeline security is migrating to use the GraphQL API for all requests. A large part of the remaining work includes migrating the CI variables pages for projects, groups, and GitLab instances. CI variables
can already be fetched through the GraphQL API
, so we now need to make it possible to create, update, and delete them.
How does the frontend update a CI variable?
On the frontend, we are using a client resolver for all our mutations (add/update/delete) for CI Variables on the instance, group, and project level.
Since we have a client resolver, the frontend already has GraphQL mutations for all of this in app/assets/javascripts/ci/ci_variable_list/graphql/mutations/client
. It is just that we call the controller endpoint (namespace/project/-/variables
) under the hood instead of actually making an actual GraphQL request.
Technically we also have REST API endpoints, but the frontend only uses the controller endpoints to update a CI variable.
Proposal
-
Use GraphQL mutations to create, update, and delete instance CI variables
Additional details
Some relevant technical details, if applicable, such as:
- Does this need a feature flag? This will not require a feature flag on the frontend.
- Does there need to be an associated instrumentation issue created related to this work? No
- Is there an example response showing the data structure that should be returned (new endpoints only)? No
- What permissions should be used?
- Is this EE or CE?
-
EE -
CE
-
- Additional comments:
Implementation Table
Group | Issue Link |
---|---|
frontend |
|
backend | #381357 |