Files
grafana/apps/dashboard/pkg/migration/testdata/input/v38.table_displaymode_comprehensive.json
Ivan Ortega Alba 93c14c52da Migrations: Compare backend and frontend outputs to ensure feature parity (#106851)
* wip: trying to understand how to get the ds info from migrator

* add datasource info provider

* Use DS service to fetch DS data

* add more tests cases to match with migrator cases

* Add snapshots

* Non-existing DS

* Add different DS for snapshots

* fix import

* Fix tests: guard against double initialization

* don't use full datasource package in test

* min version should be 35

* fix test

* fix conversion test

* Dashboards: Support schemaVersion v35 migration in backend

* Dashboards: Support schemaVersion v34 migration in backend

* Dashboards: Support schemaVersion v33 migration in backend

* Apply suggestions from code review

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>

* Apply feedback

* Remove unused parameters

* Refactor to follow Go patterns

* Update logic

* Only write final migration result as output

* Compare backend and frontend results

* Improve snapshots to cover all possible use cases

* Linter

* wip make it consistent v33

* apply feedback

* Return default when the ref cannot be found

* Update apps/dashboard/pkg/migration/schemaversion/v33.go

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>

* apply feedback

* Use same mocks backend/frontend

* restore migrations

* update snapshots

* Adapt migration tests to use min versions

* Ensure v40-v41 works

* Ensure v39-v40 works

* Simplify the naming of the files

* adjust jest to new input convention

* Ensure every migration v36-v41 works

* Improve v38 naming

* Ensure v36 migrates correctly

* Skip v36 refs migrations on rows

* Treat rows as frontend and ensure same results for v36

* Ensure v34 runs with the same logic than the frontend

* Leave empty stadistics as valid option

* ensure v33 is working as the frontend

* Update tests

* Undo frontend changes for legend handling

* Remove filtering by version in the frontend

* linter

* Clean up v33 input JSON

---------

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-07-03 12:23:51 +02:00

187 lines
3.9 KiB
JSON

{
"title": "V38 Table Migration Comprehensive Test Dashboard",
"schemaVersion": 37,
"panels": [
{
"type": "table",
"title": "Table with Basic Gauge",
"id": 1,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "basic"
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Table with Gradient Gauge",
"id": 2,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "gradient-gauge"
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Table with LCD Gauge",
"id": 3,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "lcd-gauge"
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Table with Color Background",
"id": 4,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "color-background"
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Table with Color Background Solid",
"id": 5,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "color-background-solid"
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Table with Unknown Mode",
"id": 6,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "some-other-mode"
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Table with No Display Mode",
"id": 7,
"fieldConfig": {
"defaults": {
"custom": {
"width": 100
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Table with Overrides",
"id": 8,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "basic"
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Field1"
},
"properties": [
{
"id": "custom.displayMode",
"value": "gradient-gauge"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Field2"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-background"
}
]
}
]
}
},
{
"type": "graph",
"title": "Non-table Panel (Should Remain Unchanged)",
"id": 9
},
{
"type": "row",
"title": "Row with Nested Table Panels",
"id": 10,
"collapsed": false,
"panels": [
{
"type": "table",
"title": "Nested Table with Basic Mode",
"id": 11,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "basic"
}
},
"overrides": []
}
},
{
"type": "table",
"title": "Nested Table with Gradient Gauge",
"id": 12,
"fieldConfig": {
"defaults": {
"custom": {
"displayMode": "gradient-gauge"
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "NestedField"
},
"properties": [
{
"id": "custom.displayMode",
"value": "lcd-gauge"
}
]
}
]
}
}
]
}
]
}