GraphQL: Implement projectSetupShellScript
What does this MR do and why?
This MR implements a new field in the runnerCloudProvisioningOptions
GraphQL query: projectSetupShellScript
. This will allow the frontend to provide instructions on how to create a project with a given name in Google Cloud Platform, along with the configuration required so that runners can be provisioned on it.
EE: true
Part of #441115 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Open http://gdk.test:3000/-/graphql-explorer and run the query:
{ project(fullPath: "gitlab-org/playground") { id runnerCloudProvisioningOptions(provider: GOOGLE_CLOUD, cloudProjectId: "my-project-id") { ... on CiRunnerGoogleCloudProvisioningOptions { projectSetupShellScript } } } }
To retrieve the script from the command line, run:
curl --request POST --url 'http://gdk.test:3000/api/graphql' --header "Authorization: Bearer $GITLAB_GDK_TOKEN" --header 'Content-Type: application/json' --data '{"query": "{ project(fullPath: \"gitlab-org/playground\") {id runnerCloudProvisioningOptions(provider: GOOGLE_CLOUD, cloudProjectId: \"my-project-id\") {... on CiRunnerGoogleCloudProvisioningOptions { projectSetupShellScript } }} }"}' | \
jq -r .data.project.runnerCloudProvisioningOptions.projectSetupShellScript