Scopes: Generate new field for default parent node (#108666)

* Generate new field for default parent node

* Update ScopeSpec with defaultPath and fix list types. Remove unused field

* Update frontend types

* Fix some errors

* ScopesSelector: Update zod types for spec schema

* Promlib: Update Scopes schema

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
This commit is contained in:
Tobias Skarhed
2025-09-26 12:02:45 +02:00
committed by GitHub
co-authored by Matheus Macabu
parent 60fed679c4
commit eb16fa1642
14 changed files with 66 additions and 113 deletions
+2 -4
View File
@@ -80,10 +80,8 @@ type PrometheusQueryProperties struct {
type ScopeSpec struct {
Name string `json:"name"` // This is the identifier from metadata.name of the scope model.
Title string `json:"title"`
Type string `json:"type"`
Description string `json:"description"`
Category string `json:"category"`
Filters []ScopeFilter `json:"filters"`
DefaultPath []string `json:"defaultPath,omitempty"`
Filters []ScopeFilter `json:"filters,omitempty"`
}
// ScopeFilter is a hand copy of the ScopeFilter struct from pkg/apis/scope/v0alpha1/types.go
+6 -13
View File
@@ -188,18 +188,14 @@
"type": "object",
"required": [
"name",
"title",
"type",
"description",
"category",
"filters"
"title"
],
"properties": {
"category": {
"type": "string"
},
"description": {
"type": "string"
"defaultPath": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "array",
@@ -238,9 +234,6 @@
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"additionalProperties": false
+6 -13
View File
@@ -198,18 +198,14 @@
"type": "object",
"required": [
"name",
"title",
"type",
"description",
"category",
"filters"
"title"
],
"properties": {
"category": {
"type": "string"
},
"description": {
"type": "string"
"defaultPath": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "array",
@@ -248,9 +244,6 @@
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"additionalProperties": false
+7 -14
View File
@@ -8,7 +8,7 @@
{
"metadata": {
"name": "default",
"resourceVersion": "1725885733879",
"resourceVersion": "1758739325095",
"creationTimestamp": "2024-03-25T13:19:04Z"
},
"spec": {
@@ -105,11 +105,11 @@
"additionalProperties": false,
"description": "ScopeSpec is a hand copy of the ScopeSpec struct from pkg/apis/scope/v0alpha1/types.go to avoid import (temp fix).",
"properties": {
"category": {
"type": "string"
},
"description": {
"type": "string"
"defaultPath": {
"items": {
"type": "string"
},
"type": "array"
},
"filters": {
"items": {
@@ -148,18 +148,11 @@
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"name",
"title",
"type",
"description",
"category",
"filters"
"title"
],
"type": "object"
},