Skip to content

Improve Analytics dashboards schema errors

What does this MR do and why?

Replaces the vague GraphQL error messages returned when an Analytics dashboard configuration is invalid with friendlier error messages from the new errors field in the CustomizableDashboard GraphQL object type to display in the UI when they are present. In order to bypass the default GraphQL error handling to display these schema errors, this MR allows any fields coming from the YAML config – specifically from ProductAnalytics::Dashboard and ProductAnalytics::PanelType – to be nullable.

This MR also does the following:

  • Adds a Contains errors badge to any invalid dashboards listed in the Analytics dashboards page. Previously, no errors were displayed.
  • Updates all built-in dashboard configurations – Value Streams Dashboard, Behavior, Audience, AI Impact – to ensure that they match the dashboard JSON schema defined in ee/app/validators/json_schemas/analytics_dashboard.json.

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.

View Before After
Dashboards List Screenshot 2024-05-15 at 1.27.21 PM.png Screenshot 2024-05-15 at 1.30.05 PM.png
Dashboard Screenshot 2024-05-15 at 1.27.29 PM.png Screenshot 2024-05-15 at 1.29.47 PM.png

How to set up and validate locally

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

  1. Please make sure that you have a GitLab Ultimate license.

  2. Create a group or select an existing one

  3. Follow the instructions to add a YAML configuration for the group and use the example below for your schema:

    title: 'Custom Dashboard - Test VSD'
    description: 'Custom description'
    panels: 
      - visualization: dora_chart # broken panel - missing `title` and `gridAttributes`
        queryOverrides: {}
  4. Navigate to Analyze > Analytics Dashboards in the left hand menu

  5. Verify that a Contains errors badge should appear next to Custom Dashboard - Test VSD

  6. Select Custom Dashboard - Test VSD

  7. Verify that an alert appears listing all of the dashboard schema's errors with a link to the troubleshooting section in the Analytics dashboards doc

Related to #444915

Edited by Rudy Crespo

Merge request reports