Dashboard Migrations: V28 singlestat panel and deprecated variable properties (#108416)

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
This commit is contained in:
Haris Rozajac
2025-08-06 17:51:55 +02:00
committed by GitHub
co-authored by Ivan Ortega
parent 3dcda77462
commit 5ad751ea28
22 changed files with 3067 additions and 134 deletions
@@ -414,6 +414,97 @@ func TestV30(t *testing.T) {
},
},
},
{
name: "already migrated value mappings are preserved correctly",
input: map[string]interface{}{
"title": "V30 Already Migrated Value Mappings Test Dashboard",
"schemaVersion": 29,
"panels": []interface{}{
map[string]interface{}{
"type": "timeseries",
"title": "Panel with already migrated value mappings",
"id": 1,
"fieldConfig": map[string]interface{}{
"defaults": map[string]interface{}{
"mappings": []interface{}{
map[string]interface{}{
"type": "value",
"options": map[string]interface{}{
"20": map[string]interface{}{
"color": nil,
"text": "test",
},
},
},
map[string]interface{}{
"type": "value",
"options": map[string]interface{}{
"30": map[string]interface{}{
"color": nil,
"text": "test1",
},
},
},
map[string]interface{}{
"type": "value",
"options": map[string]interface{}{
"40": map[string]interface{}{
"color": "orange",
"text": "50",
},
},
},
},
},
},
},
},
},
expected: map[string]interface{}{
"title": "V30 Already Migrated Value Mappings Test Dashboard",
"schemaVersion": 30,
"panels": []interface{}{
map[string]interface{}{
"type": "timeseries",
"title": "Panel with already migrated value mappings",
"id": 1,
"fieldConfig": map[string]interface{}{
"defaults": map[string]interface{}{
"mappings": []interface{}{
map[string]interface{}{
"type": "value",
"options": map[string]interface{}{
"20": map[string]interface{}{
"color": nil,
"text": "test",
},
},
},
map[string]interface{}{
"type": "value",
"options": map[string]interface{}{
"30": map[string]interface{}{
"color": nil,
"text": "test1",
},
},
},
map[string]interface{}{
"type": "value",
"options": map[string]interface{}{
"40": map[string]interface{}{
"color": "orange",
"text": "50",
},
},
},
},
},
},
},
},
},
},
{
name: "graph panels with different configurations remain unchanged in V30",
input: map[string]interface{}{