Skip to content

Process and display all product analytics dashboards

Max Woolf requested to merge 379669-process-dashboards into master

What does this MR do and why?

Adds a few pieces to the puzzle to deserialize dashboard definitions in to usable Ruby objects and make them available via our GraphQL API.

📺 Quick demo on unfiltered: https://youtu.be/FKcYiT4h3m8

How to set up and validate locally

  1. Enable the feature flag
    Feature.enable(:cube_api_proxy)
  2. Make sure the following application settings are set. (Their values aren't important for this endpoint.)
  • product_analytics_enabled == true
  • cube_api_base_url
  • cube_api_key
  1. In any repository, create a dashboard definition by creating a file .gitlab/product_analytics/dashboards/north_star.yaml with this content:
---
version: '1'
title: Dashboard Example 1
description: North Star Metrics across all departments for the last 3 quarters.
widgets:
  - title: Overall Conversion Rate
    gridAttributes:
      yPos: 4
      xPos: 1
      width: 12
      height: 2
  1. Make an API call to that project using GraphQL authenticated using a developer or higher on that project.
query {
  project(fullPath: "flightjs/project_twenty") {
    name
    productAnalyticsDashboards {
      nodes {
        title
        description
        widgets {
          nodes {
            title
            gridAttributes
          }
        }
      }
    }
  }
}
  1. Assert that the dashboard title and description is returned.
  2. Attempt to also find a single dashboard:
query {
  project(fullPath: "flightjs/project_twenty") {
    name
    productAnalyticsDashboards(slug: "dashboard_slug") {
      nodes {
        title
        description
        widgets {
          nodes {
            title
            gridAttributes
          }
        }
      }
    }
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #379669 (closed)

Edited by Max Woolf

Merge request reports