Ivan Ortega Alba
e463781077
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 >
2025-11-12 11:43:46 +01:00
Ivan Ortega Alba
a72e02f88a
Fix dashboard migration discrepancies between backend and frontend implementations (use toEqual) ( #110268 )
...
**Highlights**
* **Single-version migrations**: add `targetVersion` to migrator & model, separate outputs, enforce exact version.
* **Datasource fixes**: include `apiVersion` in tests, empty-string → `{}`, preserve `{}` refs, drop unwanted defaults.
* **Panel defaults & nesting**: only top-level panels get defaults; preserve empty `transformations` context-aware; filter repeated panels.
* **Migration parity**
* V16: collapsed rows, grid height parsing (`px`).
* V17: omit `maxPerRow` when `minSpan=1`.
* V19–V20: cleanup defaults (`targetBlank`, style).
* V23–V24: template vars + table panel consistency.
* V28: full singlestat/stat parity, mappings & color.
* V30–V36: threshold logic, empty refs, nested targets.
* **Save-model cleanup**: replicate frontend defaults/filtering, drop null IDs, metadata, unused props.
* **Testing**: unified suites, dev dashboards (v42), full unit coverage for major migrations.
Co-authored-by: Ivan Ortega [ivanortegaalba@gmail.com ](mailto:ivanortegaalba@gmail.com )
Co-authored-by: Dominik Prokop [dominik.prokop@grafana.com ](mailto:dominik.prokop@grafana.com )
2025-09-24 12:20:25 +02:00