Remove order and weight from custom dashboard schema
Problem to solve
The frontend needs an easy way to reorder panels in a dashboard. The current method of using priority and weight keys is cumbersome. It's also difficult for a human reading/editing the dashboard file to visualize what the final order will be.
Currently, backend reorders dashboard groups and panels based on the priority and weight keys. The frontend displays the groups and panels in the order that it receives them in.
Further details
Remove the priority and weight keys from dashboard schema so that groups and panels are displayed in the order that they are defined.
Proposal
- Add a validation warning/error when a
priority
orweight
key is detected in panel_groups or panels respectively. - Remove priority and weight keys from out of the box dashboards defined in config/prometheus
- Remove the weight key from the spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panels.json file.
- Remove priority key from spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panel_groups.json
- Remove the Sorter stage - lib/gitlab/metrics/dashboard/stages/sorter.rb
Documentation
- Remove doc/user/project/integrations/prometheus.md#L262
- Remove doc/user/project/integrations/prometheus.md#L272
- Add a note that mentions how groups and panels will be ordered.
Availability & Testing
Please trigger the package-and-qa
job on the MR relevant for this issue. The order is relevant on these specs but these should not be affected by weight and priority.
What does success look like, and how can we measure that?
TBD
Links / references
Spike that generated this issue: #27834 (closed)