Schema V2: Simplify annotations v1<->v2 conversions (#107390)

* Initial migration pending to test

* Update tests

* apply feedback

* Remove unnecessary types

* Fix types

* Update tests

* fixing tests

* Default DS for transformer

* Update the default DS

* Update the generated sdk files

* Restore commented tests

* Update tests

* Updating snapshots

* fix

* Do not preserve empty datasource in panel spec

* update provisioning v2 sample dashboard

* Fix test

* Prettier

* Fix import e2e

* Prettier

* restore commented tests

* Update to support annotations

* Lint

* Make gen apps

* Make the build pass

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

* Update grafana-app-sdk to 0.39.2

* Workspace update

* make gen-cue

* Runtime error fix

* Update dashboard spec

* Update go workspaces

* Schema V2: Simplify annotations v1<->v2 conversions

* Update public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.ts

* Cleanup and some more tests

* test improvement

* Update public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.ts

* Update go.sum

* make generate

* Update public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.ts

Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>

* ts

* make gen-apps

* Update response transformers to correctly handle v2->v1 annotations

* Update dashboards openapi snapshot

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
This commit is contained in:
Dominik Prokop
2025-07-08 14:42:30 +02:00
committed by GitHub
parent feedb5c0a6
commit d5a1781fb6
16 changed files with 876 additions and 192 deletions
@@ -394,7 +394,7 @@ AnnotationQuerySpec: {
name: string
builtIn?: bool | *false
filter?: AnnotationPanelFilter
legacyOptions?: [string]: _ //Catch-all field for datasource-specific properties
legacyOptions?: [string]: _ // Catch-all field for datasource-specific properties. Should not be available in as code tooling.
}
AnnotationQueryKind: {
@@ -398,7 +398,7 @@ AnnotationQuerySpec: {
name: string
builtIn?: bool | *false
filter?: AnnotationPanelFilter
legacyOptions?: [string]: _ //Catch-all field for datasource-specific properties
legacyOptions?: [string]: _ // Catch-all field for datasource-specific properties. Should not be available in as code tooling.
}
AnnotationQueryKind: {
@@ -30,7 +30,7 @@ type DashboardAnnotationQuerySpec struct {
Name string `json:"name"`
BuiltIn *bool `json:"builtIn,omitempty"`
Filter *DashboardAnnotationPanelFilter `json:"filter,omitempty"`
// Catch-all field for datasource-specific properties
// Catch-all field for datasource-specific properties. Should not be available in as code tooling.
LegacyOptions map[string]interface{} `json:"legacyOptions,omitempty"`
}
@@ -643,7 +643,7 @@ func schema_pkg_apis_dashboard_v2alpha1_DashboardAnnotationQuerySpec(ref common.
},
"legacyOptions": {
SchemaProps: spec.SchemaProps{
Description: "Catch-all field for datasource-specific properties",
Description: "Catch-all field for datasource-specific properties. Should not be available in as code tooling.",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,