Dashboard Migrations: V13 no-op, remove 28 and v24 as they are autoMigrations; and remove dead code from DashboardMigrator (#110008)

* migrate to v19

* migrate to v18

* Migration to be verified: v17 Convert minSpan to maxPerRow in panels

* Migration to be verified: 16 Grid layout migration

* Refactor v17 and v19 migrations to use shared helper functions

* Migration to be verified: 15 No-op migration for schema consistency

* Migration to be verified: 14 Shared crosshair to graph tooltip migration

* cleanup

* wip

* complete migration

* fix lint issues

* refactor and test with minimal graph config

* update tests

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* add context and fix latest version

* generate snapshots

* v13 should be no-op

* clean up

* remove v28

* remove singlestat migraiton from frontend migrator because this is an automigration

* remove unused function

* Remove v24 table plugin logic

* cleanup

* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed

* cleanup

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Haris Rozajac
2025-10-09 11:14:02 -06:00
committed by GitHub
co-authored by Dominik Prokop
parent 5eb295d850
commit 4d3c5d1550
45 changed files with 3555 additions and 6766 deletions
@@ -0,0 +1,98 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"panels": [
{
"autoMigrateFrom": "graph",
"grid": {
"threshold1": 200,
"threshold1Color": "yellow",
"threshold2": 400,
"threshold2Color": "red",
"thresholdLine": true
},
"id": 1,
"title": "Graph with Line Thresholds",
"type": "timeseries"
},
{
"autoMigrateFrom": "graph",
"grid": {
"threshold1": 100,
"threshold1Color": "green",
"threshold2": 300,
"threshold2Color": "blue",
"thresholdLine": false
},
"id": 2,
"title": "Graph with Fill Thresholds",
"type": "timeseries"
},
{
"autoMigrateFrom": "graph",
"grid": {
"threshold1": 150,
"threshold1Color": "orange",
"thresholdLine": true
},
"id": 3,
"title": "Graph with Single Threshold",
"type": "timeseries"
},
{
"autoMigrateFrom": "graph",
"grid": {
"threshold1": 200,
"threshold1Color": "yellow",
"thresholdLine": false
},
"id": 4,
"thresholds": [
{
"color": "purple",
"colorMode": "custom",
"value": 50
}
],
"title": "Graph with Existing Thresholds",
"type": "timeseries"
},
{
"autoMigrateFrom": "singlestat",
"id": 5,
"title": "Non-Graph Panel",
"type": "stat"
}
],
"schemaVersion": 13,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "V13 Graph Thresholds Migration Test",
"weekStart": ""
}
@@ -0,0 +1,56 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"panels": [
{
"autoMigrateFrom": "graph",
"id": 4,
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "gdev-prometheus"
},
"editorMode": "builder",
"expr": "{\"a.utf8.metric 🤘\", job=\"prometheus-utf8\"}",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"type": "timeseries"
}
],
"schemaVersion": 13,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "Dashboard with minimal graph panel settings",
"weekStart": ""
}
File diff suppressed because it is too large Load Diff
@@ -21,48 +21,18 @@
"links": [],
"panels": [
{
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
"autoMigrateFrom": "singlestat",
"colors": [
"#FF0000",
"green",
"orange"
],
"grid": {
"max": 10,
"min": 1
},
"id": 1,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"legend": true,
"targets": [
{
"refId": "A"
@@ -71,122 +41,48 @@
"refId": "B"
}
],
"thresholds": "10,20,30",
"type": "stat"
},
{
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
"autoMigrateFrom": "singlestat",
"colors": [
"#FF0000",
"green",
"orange"
],
"gauge": {
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"grid": {
"max": 10,
"min": 1
},
"id": 2,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"thresholds": "10,20,30",
"type": "stat"
},
{
"fieldConfig": {
"defaults": {
"mappings": [
{
"options": {
"20": {
"text": "test"
}
},
"type": "value"
},
{
"options": {
"30": {
"text": "test1"
}
},
"type": "value"
},
{
"options": {
"40": {
"color": "orange",
"text": "50"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
"autoMigrateFrom": "singlestat",
"colors": [
"#FF0000",
"green",
"orange"
],
"grid": {
"max": 10,
"min": 1
},
"id": 3,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"legend": true,
"mappingTypes": [
{
"name": "value to text",
"value": 1
}
],
"targets": [
{
"refId": "A"
@@ -195,7 +91,25 @@
"refId": "B"
}
],
"type": "stat"
"thresholds": "10,20,30",
"type": "stat",
"valueMaps": [
{
"op": "=",
"text": "test",
"value": "20"
},
{
"op": "=",
"text": "test1",
"value": "30"
},
{
"op": "=",
"text": "50",
"value": "40"
}
]
},
{
"id": 4,
@@ -21,48 +21,18 @@
"links": [],
"panels": [
{
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
"autoMigrateFrom": "singlestat",
"colors": [
"#FF0000",
"green",
"orange"
],
"grid": {
"max": 10,
"min": 1
},
"id": 1,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"legend": true,
"targets": [
{
"refId": "A"
@@ -71,47 +41,22 @@
"refId": "B"
}
],
"thresholds": "10,20,30",
"type": "stat"
},
{
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
"autoMigrateFrom": "singlestat",
"colors": [
"#FF0000",
"green",
"orange"
],
"grid": {
"max": 10,
"min": 1
},
"id": 2,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"legend": true,
"targets": [
{
"refId": "A"
@@ -120,122 +65,48 @@
"refId": "B"
}
],
"thresholds": "",
"type": "stat"
},
{
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
"autoMigrateFrom": "singlestat",
"colors": [
"#FF0000",
"green",
"orange"
],
"gauge": {
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"grid": {
"max": 10,
"min": 1
},
"id": 3,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"thresholds": "10,20,30",
"type": "stat"
},
{
"fieldConfig": {
"defaults": {
"mappings": [
{
"options": {
"20": {
"text": "test"
}
},
"type": "value"
},
{
"options": {
"30": {
"text": "test1"
}
},
"type": "value"
},
{
"options": {
"40": {
"color": "orange",
"text": "50"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#FF0000",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "orange",
"value": 20
}
]
}
},
"overrides": []
"autoMigrateFrom": "singlestat",
"colors": [
"#FF0000",
"green",
"orange"
],
"grid": {
"max": 10,
"min": 1
},
"id": 4,
"options": {
"colorMode": "none",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.0",
"legend": true,
"mappingTypes": [
{
"name": "value to text",
"value": 1
}
],
"targets": [
{
"refId": "A"
@@ -244,7 +115,25 @@
"refId": "B"
}
],
"type": "stat"
"thresholds": "10,20,30",
"type": "stat",
"valueMaps": [
{
"op": "=",
"text": "test",
"value": "20"
},
{
"op": "=",
"text": "test1",
"value": "30"
},
{
"op": "=",
"text": "50",
"value": "40"
}
]
},
{
"id": 8,
@@ -257,38 +146,24 @@
"type": "timeseries"
},
{
"autoMigrateFrom": "grafana-singlestat-panel",
"colorBackground": false,
"colorValue": true,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": {
"type": "prometheus"
},
"fieldConfig": {
"defaults": {
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaF2"
},
"overrides": []
"format": "areaF2",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 8,
@@ -297,25 +172,37 @@
"y": 43
},
"id": 5,
"maxDataPoints": 100,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"postfix": "b",
"postfixFontSize": "50%",
"prefix": "a",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": true
},
"pluginVersion": "12.1.0",
"tableColumn": "",
"targets": [
{
"datasource": {
@@ -325,8 +212,18 @@
"refId": "A"
}
],
"thresholds": "",
"title": "grafana-singlestat-panel",
"type": "stat"
"type": "stat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{
"datasource": {