Schema: convert dashboards from v1beta1 to v2beta1 (#109037)

- Implement full conversion pipeline from v1beta1 → v2beta1
- Ensure frontend–backend parity for all dashboard serialization paths
- Add automatic data loss detection for conversions (panels, queries, annotations, links, variables)
- Extract atomic conversion functions for v0 → v1beta1 → v2alpha1 → v2beta1
- Introduce conversion metrics and detailed logging for loss tracking
- Normalize datasource resolution, defaults, and annotation processing
- Improve panel layout serialization and y-coordinate normalization
- Fix inconsistencies in nested panels and collapsed row behavior
- Refine variable handling:
  - Filter refId from variable query specs
  - Default variable refresh to 'never' (matches frontend)
  - Fix constant and interval variable handling for missing queries
- Unify schema defaults (enable, hide, iconColor, editable, liveNow)
- Fix pluginId usage (UID vs type) and datasource references
- Fix metrics.go bug swallowing errors (return nil → return err)
- Add tests for version-specific conversion error handling
- Add data loss detection tests using source/target version comparison
- Clean up lint issues, legacy code, and redundant files
- Update OpenAPI snapshots and migrated dashboards
- Improve backend migrator to reuse datasource provider and match frontend logic

Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
This commit is contained in:
Ivan Ortega Alba
2025-11-12 11:43:46 +01:00
committed by GitHub
co-authored by Haris Rozajac Oscar Kilhed Stephanie Hingtgen
parent 09942c08db
commit e463781077
273 changed files with 75003 additions and 588 deletions
@@ -183,6 +183,24 @@
},
"fieldConfig": {
"defaults": {
"actions": [
{
"fetch": {
"body": "{}",
"headers": [
[
"Content-Type",
"application/json"
]
],
"method": "GET",
"queryParams": [],
"url": "/api/health"
},
"title": "Get instance health",
"type": "fetch"
}
],
"color": {
"fixedColor": "blue",
"mode": "shades"
@@ -195,6 +213,13 @@
},
"inspect": false
},
"links": [
{
"targetBlank": true,
"title": "Google Grafana",
"url": "https://google.com/search?q=grafana"
}
],
"mappings": [],
"thresholds": {
"mode": "absolute",
@@ -208,27 +233,7 @@
"value": 80
}
]
},
"actions": [
{
"fetch": {
"body": "{}",
"headers": [["Content-Type", "application/json"]],
"method": "GET",
"queryParams": [],
"url": "/api/health"
},
"title": "Get instance health",
"type": "fetch"
}
],
"links": [
{
"targetBlank": true,
"title": "Google Grafana",
"url": "https://google.com/search?q=grafana"
}
]
}
},
"overrides": []
},
@@ -612,4 +617,4 @@
"title": "Panel Tests - Table - Sparklines",
"uid": "d6373b49-1957-4f00-9218-ee2120d3ecd9",
"weekStart": ""
}
}