Skip to content

Cloud Connector: Add status check GraphQL API

Matthias Käppler requested to merge 472477-cc-probes-api into master

What does this MR do and why?

NOTE: This change is behind the feature flag cloud_connector_status.

In order to improve onboarding experience onto AI features for both existing and prospective customers, we intend to build diagnostic checks into the GitLab UI (and later also IDEs) that give admins and end-users confidence that their setup is working correctly.

To this end, we introduce a new GraphQL type CloudConnectorStatus. It will trigger several probes that verify that all the individual aspects we require for AI to work end-to-end are in place and set up correctly.

This MR is only a first iteration to provide an initial integration point via GraphQL. Basically anything can change at this point. It has the following limitations:

  • User permission checks via authorize: It is not clear yet if this is something we need or want. We may have to provide access to this query broadly, as long as a valid request token exists.
  • Limited set of probes: I only added two simple probes for demonstration purposes: A LicenseProbe that determines the instance is using the correct license, and a HostProbe that determines whether the given host is reachable from the GitLab instance. Neither are considered final in their respective implementations.
  • Alpha API: All fields are subject to change at this point since we are still finalizing the UI/design that will use this query. I therefore declared this as alpha and made all fields nullable.
  • No localization. Success and failure messages are hard-coded for now. This is mostly to give an idea of the type of success or failure and we can stick it into a prototype UI easily.

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

Example query:

query {
  cloudConnectorStatus {
    success
    probeResults {
      name
      success
      message
    }
  }
}

Example response:

{
  "data": {
    "cloudConnectorStatus": {
      "success": true,
      "probeResults": [
        {
          "name": "license_probe",
          "success": true,
          "message": "Online Cloud License found"
        },
        {
          "name": "host_probe",
          "success": true,
          "message": "customers.gitlab.com reachable"
        },
        {
          "name": "host_probe",
          "success": true,
          "message": "cloud.gitlab.com reachable"
        }
      ]
    }
  }
}

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. In rails console enable the experiment fully
    Feature.enable(:cloud_connector_status)
  2. Log in and visit http://127.0.0.1:3000/-/graphql-explorer
  3. Run the query listed above

Related to #472477 (closed)

Edited by Matthias Käppler

Merge request reports

Loading