Process and display all product analytics dashboards
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.
How to set up and validate locally
- Enable the feature flag
Feature.enable(:cube_api_proxy)
- 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
- 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
- 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
}
}
}
}
}
}
- Assert that the dashboard title and description is returned.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #379669 (closed)
Edited by Max Woolf