Add YAML errors field to Dashboard objects on GraphQL
What does this MR do and why?
- Adds a new errors field to GraphQL which contains yaml schema errors
- Small simplifications to
Dashboard
model - Fix error when
panels
properties are not present in the YAML
Samples of errors returned on the new field
[
[0] "root is missing required keys: version",
[1] "property '/panels/0' is missing required keys: queryOverrides",
[2] "property '/panels/0/id' is invalid: error_type=schema",
[3] "property '/panels/1' is missing required keys: queryOverrides",
[4] "property '/panels/1/id' is invalid: error_type=schema",
[5] "property '/panels/2' is missing required keys: queryOverrides",
[6] "property '/panels/2/id' is invalid: error_type=schema"
]
[
[0] "root is missing required keys: version, panels"
]
How to validate locally
- Enable
group_analytics_dashboard_dynamic_vsd
feature flag - Create a group customized dashboard following these instructions.
- Make sure to have some errors on the schema leaving the
version
field empty - Execute the following query:
query groupDashboard {
group(fullPath: "vsmg-1712601311") {
name
customizableDashboards {
nodes {
title
errors
}
}
}
}
Errors should be present.
Next steps
We need to bypass GraphQL error handling to display schema errors when they are present with the following:
- Make sure all built-in dashboards,
behavior
,audience
,ai impact
, VSD have a valid schema before proceeding. - Add frontend handling to consume dashboard errors field and present to the users properly on the UI.
- Remove GraphQL not null constraints from fields of
ProductAnalytics::Dashboard
andProductAnalytics::PanelType
. We should allow all fields that are coming from the YAML schema to benull: true
preventing the default API error messages.
related to #444915 (closed)
Edited by Felipe Artur