ea89a68028
* Generate Dashboard kinds with `grafana-app-sdk` Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Hack together a fix for invalid TS codegen for v0 & v1 Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Address Go linter issues Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Address TS linter issues Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Add new app to CODEOWNERS Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Fix a couple of issues detected by tests Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Update OpenAPI definitions and test files Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Remove title from Dashboard v1alpha1 spec Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Remove unused CUE schemas Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * remove unrelated files * allow any in the generated betterer * Add a comment explaining why we don't use deepcopy-gen Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Default to v2alpha1 if dashboards v2 FF is enabled Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> --------- Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
69 lines
1.4 KiB
CUE
69 lines
1.4 KiB
CUE
package kinds
|
|
|
|
import (
|
|
"github.com/grafana/grafana/sdkkinds/dashboard/v0alpha1"
|
|
"github.com/grafana/grafana/sdkkinds/dashboard/v1alpha1"
|
|
"github.com/grafana/grafana/sdkkinds/dashboard/v2alpha1"
|
|
)
|
|
|
|
// Status is the shared status of all dashboard versions.
|
|
DashboardStatus: {
|
|
// Optional conversion status.
|
|
conversion?: ConversionStatus
|
|
}
|
|
|
|
// ConversionStatus is the status of the conversion of the dashboard.
|
|
ConversionStatus: {
|
|
// Whether from another version has failed.
|
|
// If true, means that the dashboard is not valid,
|
|
// and the caller should instead fetch the stored version.
|
|
failed: bool
|
|
|
|
// The version which was stored when the dashboard was created / updated.
|
|
// Fetching this version should always succeed.
|
|
storedVersion: string
|
|
|
|
// The error message from the conversion.
|
|
// Empty if the conversion has not failed.
|
|
error: string
|
|
}
|
|
|
|
dashboard: {
|
|
kind: "Dashboard"
|
|
pluralName: "Dashboards"
|
|
current: "v0alpha1"
|
|
|
|
codegen: {
|
|
ts: {
|
|
enabled: true
|
|
config: {
|
|
enumsAsUnionTypes: true
|
|
}
|
|
}
|
|
go: {
|
|
enabled: true
|
|
}
|
|
}
|
|
|
|
versions: {
|
|
"v0alpha1": {
|
|
schema: {
|
|
spec: v0alpha1.DashboardSpec
|
|
status: DashboardStatus
|
|
}
|
|
}
|
|
"v1alpha1": {
|
|
schema: {
|
|
spec: v1alpha1.DashboardSpec
|
|
status: DashboardStatus
|
|
}
|
|
}
|
|
"v2alpha1": {
|
|
schema: {
|
|
spec: v2alpha1.DashboardSpec
|
|
status: DashboardStatus
|
|
}
|
|
}
|
|
}
|
|
}
|