Commit Graph

43 Commits

Author SHA1 Message Date
Ivan Ortega Alba
40fb421556 Schema: Implement v2beta1 → v2alpha1 conversion (#113876) 2025-11-19 15:56:33 +01:00
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
Haris Rozajac
d9067b27eb Dashboard Migrations: V2 - legacy services.filter and graphite panel type (#112282)
* migrate to v2

* Fix tests

* graphite panels should be auto-migrated

* lint

* Provisioning: Fix dashboard export to preserve original API version

* Add error handling for the edge case where conversion fails but no
storedVersion is available.
2025-10-15 10:34:12 -06:00
Haris Rozajac
e5ef29c202 Dashboard Migrations: V3 - no-op; remove v3 from DashboardMigrator.ts (#112239) 2025-10-14 18:39:24 -06:00
Haris Rozajac
01c4cb1fac Dashboard Migrations: V4 - no-op and clean up dead code from DashboardMigrator.ts (#112225) 2025-10-14 14:38:31 -06:00
Haris Rozajac
f27900702c Dashboard Migrations: V5 - no-op (#112224)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* migrate to v11

* migrate to v10

* add test files

* update

* migrate to v9

* migrate to v8

* add context and fix latest version

* add context

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* add context

* snapshots

* generate snapshots

* update

* snapshots

* wip

* fix test

* remove nav when cleaning up defaults

* migrate to v6

* update comments

* migrate to v5

* 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

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* update snapshot

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-14 07:53:13 -06:00
Haris Rozajac
394922c4c8 Dashboard Migrations: V6 pulldowns to annotations; variables (#112221)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* migrate to v11

* migrate to v10

* add test files

* update

* migrate to v9

* migrate to v8

* add context and fix latest version

* add context

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* add context

* snapshots

* generate snapshots

* update

* snapshots

* wip

* fix test

* remove nav when cleaning up defaults

* migrate to v6

* update comments

* 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

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* remove test

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-14 07:16:34 -06:00
Haris Rozajac
58915bd384 Dashboard Migrations: V7 - nav to timepicker (#112140)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* migrate to v11

* migrate to v10

* add test files

* update

* migrate to v9

* migrate to v8

* add context and fix latest version

* add context

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* add context

* snapshots

* generate snapshots

* update

* snapshots

* wip

* fix test

* remove nav when cleaning up defaults

* 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

* update snapshot

* update snapshot

* update snapshot

* lint

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-10 13:46:52 -06:00
Haris Rozajac
b232a812ab Dashboard Migrations: V8 - update old influxdb schema (#111423)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* migrate to v11

* migrate to v10

* add test files

* update

* migrate to v9

* migrate to v8

* add context and fix latest version

* add context

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* add context

* snapshots

* generate snapshots

* update

* snapshots

* fix test

* 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

* update snapshot

* update snapshot

* update snapshot

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-10 12:47:26 -06:00
Haris Rozajac
c67974251d Dashboard Migrations: V9 - singlestat panel thresholds (#111422)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* migrate to v11

* migrate to v10

* add test files

* update

* migrate to v9

* add context and fix latest version

* add context

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* add context

* snapshots

* generate snapshots

* update

* fix test

* 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

* update snapshot

* update snapshot

* update snapshot

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-10 10:39:21 -06:00
Haris Rozajac
01ec8e3a4a Dashboard Migrations: V10 - table panel styles.thresholds (#111420)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* migrate to v11

* migrate to v10

* add test files

* update

* add context and fix latest version

* add context

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* add context

* snapshots

* generate snapshots

* fix test

* 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

* update snapshot

* update snapshot

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-09 16:36:24 -06:00
Haris Rozajac
bba720557c Dashboard Migrations: v11 - no-op (#111273)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* migrate to v11

* add test files

* update

* add context and fix latest version

* add context

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* snapshots

* fix test

* 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

* update snapshot

* es lint

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-09 14:58:47 -06:00
Haris Rozajac
5c815a1733 Dashboard Migrations: v12 - template variables (#110253)
* 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

* migrate to v12

* extract defaults outside the func

* lint

* lint

* add missing showValues prop

* update

* add context and fix latest version

* add context

* generate snapshots

* v13 should be no-op

* clean up

* fix tests

* fix test

* 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

* es int

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-10-09 13:29:06 -06:00
Haris Rozajac
4d3c5d1550 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>
2025-10-09 11:14:02 -06:00
Dominik Prokop
825f8fc7ff Dashboard migrations: Fix span: 0 bug and panel ordering in v16 dashboard migration (#112051)
Fix span: 0 bug and panel ordering in v16 dashboard migration

Fix span: 0 handling to match frontend behavior by defaulting to DEFAULT_PANEL_SPAN.
Fix panel ordering issue by using stable sort instead of unstable sort.
Fix collapsed property handling to only set when input row has collapse property.
Add comprehensive test cases for span: 0 bug and collapsed property behavior.
Add sanitized test input file for span: 0 demo dashboard with generic values instead of internal Grafana infrastructure references.

All backend migration tests and frontend comparison tests pass.
2025-10-06 13:29:33 +02:00
Ivan Ortega Alba
6d2fa6c583 Dashboard: Backend always set metricEditorMode: 0 regardless metricQueryType and expression (#111613)
- Fix metricEditorMode logic to match frontend hasOwnProperty behavior
- Fix metricQueryType to only set when property doesn't exist
- Fix statistics processing to handle all types like frontend does
- Fix null statistic handling to match frontend behavior
- Fix object string representation to match JavaScript behavior
- Add comprehensive test coverage for all CloudWatch migration scenarios
- Achieve 100% backend-frontend consistency for v34 migration

* Fix v34 CloudWatch migration backend-frontend inconsistencies

- Fix metricEditorMode logic to match frontend hasOwnProperty behavior
- Fix metricQueryType to only set when property doesn't exist
- Fix statistics processing to handle all types like frontend does
- Fix null statistic handling to match frontend behavior
- Fix object string representation to match JavaScript behavior
- Add comprehensive test coverage for all CloudWatch migration scenarios
- Achieve 100% backend-frontend consistency for v34 migration

* Improve v34 CloudWatch migration test coverage

- Add targeted tests for hasOwnProperty logic coverage
- Add comprehensive getSuffixForStat coverage (all data types)
- Add generateNextRefId double letter generation tests
- Simplify test cases while maintaining full coverage
- Achieve 93%+ coverage on all critical v34 functions
- Remove redundant test cases for better maintainability

* Clean up v34 CloudWatch migration code

- Remove unnecessary comments and documentation
- Simplify function signatures and logic
- Maintain functionality while improving readability
- Keep essential logic intact with cleaner code

* Only remove unnecessary comments
2025-09-29 11:35:58 +02: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
Dominik Prokop
b4e63c36c3 Migration v42: HideFrom tooltip consistency migration (#110517)
* Migration to be verified: v42 HideFrom tooltip migration

* snap update

* make gen cue

* Add comments of 42 being the final version
2025-09-05 15:07:30 +02:00
Dominik Prokop
7324087273 Dashboard migration: v14 Broken dash repro (#110405)
* Broken dash repro

* Fix V16 migration to preserve panels when rows array is empty

- Fixed bug where panels were deleted when migrating dashboards with empty rows array
- Updated v16.go to match frontend implementation behavior
- Added test case for empty rows scenario in v16_test.go
- Renamed test files to v16.empty-rows-and-panels-array.json for clarity
- All migration tests passing (419 test cases)
2025-09-01 13:02:59 +00:00
Ivan Ortega Alba
a7e4447d0e DashboardMigration: V16 was removing panels when repeatInteration is null (#110151) 2025-08-26 14:20:22 +02:00
Dominik Prokop
86aa5dca11 Migration v14: Shared crosshair to graph tooltip migration (#109606)
* 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

---------

Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
2025-08-21 16:44:14 -06:00
Dominik Prokop
af1b878cb7 Migration v15: No-op migration for schema consistency (#109604)
* 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

* Update v27.go

* Update v16.go

* cleanup

---------

Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
2025-08-20 19:01:45 +00:00
Dominik Prokop
49739618fa Dashboard Migrations v16: Grid layout migration (#109603)
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels

* Address review comments: use Go idiom for variable naming and sort.Ints for sorting

* Migration to be verified: 16 Grid layout migration

* Refactor v17 and v19 migrations to use shared helper functions

* Address reviews comments

---------

Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-08-20 17:31:32 +00:00
Dominik Prokop
4e5a51968f Dashboard Migrations v17: Convert minSpan to maxPerRow in panels (#109592)
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels

* Address review comments: use Go idiom for variable naming and sort.Ints for sorting
2025-08-18 08:02:37 -06:00
Haris Rozajac
4a3b8a567f Dashboard Migrations: v18 - gauge options (#109496)
* migrate to v19

* migrate to v18

* Update v19.go
2025-08-13 15:01:50 -06:00
Haris Rozajac
d84408e52d Dashboard Migrations: v19 - panel links (#109495)
* migrate to v19

* clean up

* apply feedback
2025-08-13 13:51:19 -06:00
Dominik Prokop
09d6d97535 Dashboard Migrations: V20 variable syntax migration for data links and field options (#109203)
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-08-08 09:46:34 +00:00
Haris Rozajac
8f2d27044d Dashboard Migrations: V21 data links (#108950)
---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-08-08 08:55:32 +00:00
Haris Rozajac
abdf1943b9 Dashboard Migrations: V22 table panel styles - set property to 'auto' (#108949)
* Dashboard Migrations: V31 LabelsToFields-Merge Migration

* Dashboard Migrations: V32 No-op migration

* simplify

* Refactor to reduce nesting

* Dashboard Migrations: V30 value mappings and tooltip options

* Do not automigrate since graph is migrated in v27

* Refactor to reduce nesting

* Add test case for invalid mapping

* migrate to v29

* wip

* Fix tests

* fix output

* wip

* fix min version issue

* fix wire

* ignore gauge logic as it never get's executed

* add panel migration to test

* improvements

* update

* cleanup

* address mappings inconsistencies

* cleanup

* fix lint issues

* add cfg when initializing

* v27 migration

* migrate to v26

* preallocate array

* remove logic for grafana-singlestat because it's shared with stat logic; improve error handling and testing

* fix go lint

* don't preallocate; cleanup comments

* cleanup

* wip

* run internal provider function when getting a single panel

* clean up; add tests

* add tests for panel plugin service

* remove obsolete mock for getting panel plugin

* add tests for the whole pipeline

* fix test and lint

* migrate to v23

* migrate to v22

* refactor

* fix test

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-08-08 08:03:02 +00:00
Haris Rozajac
4b78e54304 Dashboard Migrations: V23 handle variable multi and current properties (#108937)
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-08-07 22:41:42 +00:00
Haris Rozajac
6ca8c6c6da Dashboard Migrations: v25 & v24; migrate angular table (#108826)
* Dashboard Migrations: V31 LabelsToFields-Merge Migration

* Dashboard Migrations: V32 No-op migration

* simplify

* Refactor to reduce nesting

* Dashboard Migrations: V30 value mappings and tooltip options

* Do not automigrate since graph is migrated in v27

* Refactor to reduce nesting

* Add test case for invalid mapping

* migrate to v29

* wip

* Fix tests

* fix output

* wip

* fix min version issue

* fix wire

* ignore gauge logic as it never get's executed

* add panel migration to test

* improvements

* update

* cleanup

* address mappings inconsistencies

* cleanup

* fix lint issues

* add cfg when initializing

* v27 migration

* migrate to v26

* preallocate array

* remove logic for grafana-singlestat because it's shared with stat logic; improve error handling and testing

* fix go lint

* don't preallocate; cleanup comments

* cleanup

* wip

* run internal provider function when getting a single panel

* clean up; add tests

* add tests for panel plugin service

* remove obsolete mock for getting panel plugin

* add tests for the whole pipeline

* fix test and lint

* fix test

* Fix missing scenarios

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-08-07 14:14:39 -06:00
Haris Rozajac
1b244cd036 Dashboard Migrations: v26 text2 to text (#108646)
---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-08-06 17:00:48 +00:00
Haris Rozajac
fdfe123305 Dashboard Migrations: v27 repeated panels and constant variable (#108644) 2025-08-06 16:22:11 +00:00
Haris Rozajac
5ad751ea28 Dashboard Migrations: V28 singlestat panel and deprecated variable properties (#108416)
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-08-06 17:51:55 +02:00
Haris Rozajac
2f8ec01c6c Dashboard Migrations: V29 query variable refresh property and options (#108088)
* Dashboard Migrations: V31 LabelsToFields-Merge Migration

* Dashboard Migrations: V32 No-op migration

* simplify

* Refactor to reduce nesting

* Dashboard Migrations: V30 value mappings and tooltip options

* Do not automigrate since graph is migrated in v27

* Refactor to reduce nesting

* Add test case for invalid mapping

* migrate to v29

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-07-15 17:27:04 +00:00
Ivan Ortega Alba
1200b684c6 Dashboard Migrations: V30 value mappings and tooltip options (#107970)
* Dashboard Migrations: V30 value mappings and tooltip options
2025-07-15 16:44:11 +00:00
Ivan Ortega Alba
14cb6aea92 Dashboard Migrations: V32 no-op migration + V31 LabelsToFields-Merge Migration (#107947)
* Dashboard Migrations: V31 LabelsToFields-Merge Migration

* Dashboard Migrations: V32 No-op migration
2025-07-15 15:28:48 +00:00
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
Ivan Ortega Alba
07f5a72842 Dashboard Migrations: V33 Replace string-based datasource by datasource ref (#106848)
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-06-26 19:04:43 +02:00
Ivan Ortega Alba
238cff5e8a Dashboard Migrations: V34 CloudWatch Multi-Statistics Migration (#106656)
* 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

* Apply suggestions from code review

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

* Apply feedback

* Remove unused parameters

---------

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-06-19 07:03:14 +00:00
Ivan Ortega Alba
09bbdfe8ab Dashboard Migrations: V35 ensures X-axis visibility in timeseries (#106633)
* Add datasource info provider

* Dashboards: Support schemaVersion v35 migration in backend

* update go mods

---------

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-06-17 10:38:48 +02:00
Ivan Ortega Alba
59c2f15433 Dashboard V0->V1 Migration: Schema migration v36 (#100757)
---------

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-06-16 15:53:41 +02:00
Igor Suleymanov
5d2ba10113 K8s/Dashboards: Extract Dashboard APIs to an app submodule (#102029)
* Move dashboard k8s APIs to a separate app

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Copy dashboard code in Dockerfile

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Fix conversion generation

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Update OpenAPI snapshot for dashboard/v0alpha1

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-03-13 11:05:01 +02:00