Skip to content
Snippets Groups Projects

Improve Analytics dashboards schema errors

Merged Rudy Crespo requested to merge 444915-improve-schema-errors-with-custom-validation into master
1 unresolved thread

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 (closed)

Edited by Rudy Crespo

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Rudy Crespo requested review from @apennells

    requested review from @apennells

  • Rudy Crespo requested review from @lvanc

    requested review from @lvanc

  • Rudy Crespo requested review from @lciutacu

    requested review from @lciutacu

  • Rudy Crespo requested review from @tyleramos

    requested review from @tyleramos

  • added workflowin review label and removed workflowin dev label

  • Rudy Crespo changed the description

    changed the description

  • Lorena Ciutacu approved this merge request

    approved this merge request

  • Lorena Ciutacu removed review request for @lciutacu

    removed review request for @lciutacu

  • added pipelinetier-2 label and removed pipelinetier-1 label

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 199f8d14

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 110    | 0      | 10      | 93    | 120   | ✅     |
    | Verify      | 31     | 0      | 1       | 30    | 32    | ✅     |
    | Govern      | 64     | 0      | 1       | 41    | 65    | ✅     |
    | Plan        | 54     | 0      | 2       | 47    | 56    | ✅     |
    | Data Stores | 31     | 0      | 0       | 22    | 31    | ✅     |
    | Analytics   | 1      | 0      | 1       | 0     | 2     | ✅     |
    | Package     | 19     | 0      | 12      | 19    | 31    | ✅     |
    | Monitor     | 8      | 0      | 0       | 7     | 8     | ✅     |
    | Release     | 5      | 0      | 0       | 5     | 5     | ✅     |
    | Manage      | 0      | 0      | 1       | 0     | 1     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 323    | 0      | 28      | 264   | 351   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-package-and-test: :white_check_mark: test report for 199f8d14

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Plan        | 127    | 0      | 11      | 0     | 138   | ✅     |
    | Create      | 318    | 0      | 36      | 6     | 354   | ✅     |
    | Data Stores | 22     | 0      | 0       | 0     | 22    | ✅     |
    | Monitor     | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Verify      | 10     | 0      | 0       | 0     | 10    | ✅     |
    | Govern      | 26     | 0      | 0       | 0     | 26    | ✅     |
    | Release     | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Package     | 6      | 0      | 8       | 0     | 14    | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 519    | 0      | 55      | 6     | 574   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
  • :tools: Generated by gitlab_quality-test_tooling.


    :snail: Slow tests detected in this merge request. These slow tests might be related to this merge request's changes.

    Click to expand
    Job File Name Duration Expected duration
    #6865913768 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 69.98 s < 27.12 s
    #6872133036 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 81.61 s < 27.12 s
    #6873512899 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 70.9 s < 27.12 s
    #6893947509 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 73.39 s < 27.12 s
    #6896678584 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 68.11 s < 27.12 s
    #6902732828 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 77.83 s < 27.12 s
    #6904432824 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 79.0 s < 27.12 s
    #6904438476 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 86.77 s < 27.12 s
    #6904433008 spec/features/projects/badges/list_spec.rb#L44 list of badges user changes current ref of build status badge 65.91 s < 50.13 s
    #6904438664 spec/features/projects/badges/list_spec.rb#L44 list of badges user changes current ref of build status badge 66.01 s < 50.13 s
    #6905880278 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 71.27 s < 27.12 s
    #6905880382 spec/features/projects/badges/list_spec.rb#L44 list of badges user changes current ref of build status badge 65.86 s < 50.13 s
    #6907145683 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 77.77 s < 27.12 s
  • A deleted user added rspec:slow test detected label
  • Jiaan Louw requested review from @jiaan

    requested review from @jiaan

  • Tyler Amos approved this merge request

    approved this merge request

  • Tyler Amos removed review request for @tyleramos

    removed review request for @tyleramos

  • Rudy Crespo added 282 commits

    added 282 commits

    Compare with previous version

  • Rudy Crespo reset approvals from @lciutacu by pushing to the branch

    reset approvals from @lciutacu by pushing to the branch

  • Rudy Crespo added 43 commits

    added 43 commits

    Compare with previous version

  • Elwyn Benson
  • Rudy Crespo
  • Elwyn Benson
  • Jiaan Louw removed review request for @jiaan

    removed review request for @jiaan

  • Rudy Crespo added 106 commits

    added 106 commits

    • 82c00b9b...6e0ae9b7 - 95 commits from branch master
    • 0fe4c79c - 1 earlier commit
    • 2325bdd8 - Fixed failing rspec tests
    • 3b552665 - Updated schema to align with VSD config
    • e88fa2bb - Bumped up schema version
    • 46b5f415 - Remove hardcoded raise for visualization field
    • 8c36f146 - Added a little top margin to alert
    • e4821ebc - Bumped up schema version and removed made nullable fields optional
    • 45b1b74a - Removed required queryOverrides field
    • 02caf737 - Removed unnecessary visualization error specs
    • 121b6252 - Refactored dashboard error state
    • 820928d8 - Added version to YAML config section of VSD docs

    Compare with previous version

  • Rudy Crespo requested review from @lciutacu

    requested review from @lciutacu

  • Rudy Crespo requested review from @elwyn-gitlab

    requested review from @elwyn-gitlab

  • Rudy Crespo requested review from @felipe_artur

    requested review from @felipe_artur

  • Rudy Crespo requested review from @apennells

    requested review from @apennells

  • Alex Pennells approved this merge request

    approved this merge request

  • Alex Pennells removed review request for @apennells

    removed review request for @apennells

  • Elwyn Benson requested changes

    requested changes

  • Felipe Cardozo approved this merge request

    approved this merge request

  • added pipelinetier-3 label and removed pipelinetier-2 label

  • Rudy Crespo added 3 commits

    added 3 commits

    • 9582eb2f - Addressed visualization resolver spec nitpick
    • 2d117ed9 - Made newly nullable fields required again in schema
    • 96ff8fbc - Removed optional tags from required fields in VSD docs

    Compare with previous version

  • Rudy Crespo reset approvals from @felipe_artur by pushing to the branch

    reset approvals from @felipe_artur by pushing to the branch

  • Rudy Crespo mentioned in issue #462677

    mentioned in issue #462677

  • Rudy Crespo
  • Rudy Crespo requested review from @elwyn-gitlab

    requested review from @elwyn-gitlab

  • Felipe Cardozo approved this merge request

    approved this merge request

  • Elwyn Benson resolved all threads

    resolved all threads

  • Elwyn Benson approved this merge request

    approved this merge request

  • Elwyn Benson enabled an automatic merge when the pipeline for 238b0614 succeeds

    enabled an automatic merge when the pipeline for 238b0614 succeeds

  • Libor Vanc approved this merge request

    approved this merge request

  • Libor Vanc removed review request for @lvanc

    removed review request for @lvanc

  • Lorena Ciutacu approved this merge request

    approved this merge request

  • Lorena Ciutacu removed review request for @lciutacu

    removed review request for @lciutacu

  • Rudy Crespo aborted the automatic merge because source branch was updated

    aborted the automatic merge because source branch was updated

  • Rudy Crespo added 407 commits

    added 407 commits

    • 96ff8fbc...44cc7ab4 - 393 commits from branch master
    • 44cc7ab4...8ea58818 - 4 earlier commits
    • 0b5f8759 - Remove hardcoded raise for visualization field
    • b33369f0 - Added a little top margin to alert
    • b4ffc3ae - Bumped up schema version and removed made nullable fields optional
    • 7c2d4784 - Removed required queryOverrides field
    • 11235753 - Removed unnecessary visualization error specs
    • 97faf66d - Refactored dashboard error state
    • 55b8a677 - Added version to YAML config section of VSD docs
    • e0852c20 - Addressed visualization resolver spec nitpick
    • 991c339f - Made newly nullable fields required again in schema
    • 199f8d14 - Removed optional tags from required fields in VSD docs

    Compare with previous version

  • Felipe Cardozo resolved all threads

    resolved all threads

  • Felipe Cardozo enabled an automatic merge when the pipeline for 199f8d14 succeeds

    enabled an automatic merge when the pipeline for 199f8d14 succeeds

  • Felipe Cardozo mentioned in commit aeb4ccf4

    mentioned in commit aeb4ccf4

  • Jiaan Louw mentioned in commit 4c5af150

    mentioned in commit 4c5af150

  • Jiaan Louw mentioned in merge request !153832 (merged)

    mentioned in merge request !153832 (merged)

  • added workflowstaging label and removed workflowcanary label

  • Rudy Crespo mentioned in merge request !154012 (merged)

    mentioned in merge request !154012 (merged)

  • mentioned in issue #444915 (closed)

  • Rudy Crespo mentioned in merge request !155896 (merged)

    mentioned in merge request !155896 (merged)

  • Jiaan Louw mentioned in issue #467670

    mentioned in issue #467670

  • Please register or sign in to reply
    Loading