Skip to content

Add metrics dashboard schema validation as graphQL field for metrics dashboard resource

What does this MR do?

It adds information available at blob view !33202 (diffs) for dashboard YAML files into graphQL schema, to allow more flexible usage of it, which includes adding additional messages when loading metrics dashboard view.

GraphQL

example query

{
  project(fullPath: "root/autodevops-docker-app") {
    id
    environments(name: "production") {
      nodes {
        name
        metricsDashboard(path: ".gitlab/dashboards/empty_panels.yml"){
          path
          schemaValidationWarnings
        }
      }
    }
  }
}

response

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/19",
      "environments": {
        "nodes": [
          {
            "name": "production",
            "metricsDashboard": {
              "path": ".gitlab/dashboards/empty_panels.yml",
              "schemaValidationWarnings": [
                "dashboard: can't be empty",
                "panel_groups: can't be empty"
              ]
            }
          }
        ]
      }
    }
  }
}

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #210289 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading