diff --git a/go.mod b/go.mod index 410a6598..d1fc47d7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.26.1 require ( github.com/bradleyfalzon/ghinstallation/v2 v2.18.0 github.com/google/go-github/v84 v84.0.0 - github.com/grafana/grafana-plugin-sdk-go v0.291.0 + github.com/grafana/grafana-plugin-sdk-go v0.292.0 github.com/grafana/schemads v0.0.7 github.com/influxdata/tdigest v0.0.1 github.com/pkg/errors v0.9.1 @@ -18,6 +18,8 @@ require ( require ( github.com/BurntSushi/toml v1.6.0 // indirect github.com/apache/arrow-go/v18 v18.5.2 // indirect + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/buger/jsonparser v1.1.2 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/clipperhouse/displaywidth v0.10.0 // indirect github.com/clipperhouse/uax29/v2 v2.6.0 // indirect @@ -28,8 +30,15 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.22.5 // indirect github.com/go-openapi/jsonreference v0.21.5 // indirect + github.com/go-openapi/spec v0.22.4 // indirect github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/swag/conv v0.25.5 // indirect github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/go-openapi/swag/jsonutils v0.25.5 // indirect + github.com/go-openapi/swag/loading v0.25.5 // indirect + github.com/go-openapi/swag/stringutils v0.25.5 // indirect + github.com/go-openapi/swag/typeutils v0.25.5 // indirect + github.com/go-openapi/swag/yamlutils v0.25.5 // indirect github.com/goccy/go-json v0.10.5 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -45,6 +54,7 @@ require ( github.com/huandu/go-clone v1.7.3 // indirect github.com/huandu/go-sqlbuilder v1.39.1 // indirect github.com/huandu/xstrings v1.4.0 // indirect + github.com/invopop/jsonschema v0.13.0 // indirect github.com/jaegertracing/jaeger-idl v0.6.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -67,6 +77,7 @@ require ( github.com/unknwon/com v1.0.1 // indirect github.com/unknwon/log v0.0.0-20200308114134-929b1006e34a // indirect github.com/urfave/cli v1.22.17 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/zeebo/xxh3 v1.1.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect @@ -74,12 +85,12 @@ require ( go.opentelemetry.io/contrib/propagators/jaeger v1.42.0 // indirect go.opentelemetry.io/contrib/samplers/jaegerremote v0.36.0 // indirect go.opentelemetry.io/otel v1.43.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 // indirect go.opentelemetry.io/otel/metric v1.43.0 // indirect go.opentelemetry.io/otel/sdk v1.43.0 // indirect go.opentelemetry.io/otel/trace v1.43.0 // indirect - go.opentelemetry.io/proto/otlp v1.9.0 // indirect + go.opentelemetry.io/proto/otlp v1.10.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect @@ -87,12 +98,13 @@ require ( golang.org/x/sync v0.20.0 // indirect golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 // indirect golang.org/x/tools v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 // indirect sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect ) require ( @@ -107,7 +119,7 @@ require ( github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.7.0 // indirect github.com/hashicorp/yamux v0.1.2 // indirect - github.com/magefile/mage v1.16.1 // indirect + github.com/magefile/mage v1.17.1 // indirect github.com/mattetti/filebuffer v1.0.1 // indirect github.com/mattn/go-runewidth v0.0.19 // indirect github.com/oklog/run v1.1.0 // indirect @@ -119,9 +131,9 @@ require ( github.com/prometheus/procfs v0.16.1 // indirect github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect golang.org/x/net v0.52.0 // indirect - golang.org/x/sys v0.42.0 // indirect + golang.org/x/sys v0.43.0 // indirect golang.org/x/text v0.35.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect - google.golang.org/grpc v1.79.3 // indirect + google.golang.org/grpc v1.80.0 // indirect google.golang.org/protobuf v1.36.11 // indirect ) diff --git a/go.sum b/go.sum index 450355e2..7c478d2b 100644 --- a/go.sum +++ b/go.sum @@ -10,12 +10,16 @@ github.com/apache/thrift v0.22.0 h1:r7mTJdj51TMDe6RtcmNdQxgn9XcyfGDOzegMDRg47uc= github.com/apache/thrift v0.22.0/go.mod h1:1e7J/O1Ae6ZQMTYdy9xa3w9k+XHWPfRvdPyJeynQ+/g= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw= +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradleyfalzon/ghinstallation/v2 v2.18.0 h1:WPqnN6NS9XvYlOgZQAIseN7Z1uAiE+UxgDKlW7FvFuU= github.com/bradleyfalzon/ghinstallation/v2 v2.18.0/go.mod h1:gpoSwwWc4biE49F7n+roCcpkEkZ1Qr9soZ2ESvMiouU= github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk= +github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -48,16 +52,50 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/analysis v0.24.3 h1:a1hrvMr8X0Xt69KP5uVTu5jH62DscmDifrLzNglAayk= +github.com/go-openapi/analysis v0.24.3/go.mod h1:Nc+dWJ/FxZbhSow5Yh3ozg5CLJioB+XXT6MdLvJUsUw= +github.com/go-openapi/errors v0.22.7 h1:JLFBGC0Apwdzw3484MmBqspjPbwa2SHvpDm0u5aGhUA= +github.com/go-openapi/errors v0.22.7/go.mod h1://QW6SD9OsWtH6gHllUCddOXDL0tk0ZGNYHwsw4sW3w= github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= github.com/go-openapi/jsonreference v0.21.5 h1:6uCGVXU/aNF13AQNggxfysJ+5ZcU4nEAe+pJyVWRdiE= github.com/go-openapi/jsonreference v0.21.5/go.mod h1:u25Bw85sX4E2jzFodh1FOKMTZLcfifd1Q+iKKOUxExw= +github.com/go-openapi/loads v0.23.3 h1:g5Xap1JfwKkUnZdn+S0L3SzBDpcTIYzZ5Qaag0YDkKQ= +github.com/go-openapi/loads v0.23.3/go.mod h1:NOH07zLajXo8y55hom0omlHWDVVvCwBM/S+csCK8LqA= +github.com/go-openapi/spec v0.22.4 h1:4pxGjipMKu0FzFiu/DPwN3CTBRlVM2yLf/YTWorYfDQ= +github.com/go-openapi/spec v0.22.4/go.mod h1:WQ6Ai0VPWMZgMT4XySjlRIE6GP1bGQOtEThn3gcWLtQ= +github.com/go-openapi/strfmt v0.26.1 h1:7zGCHji7zSYDC2tCXIusoxYQz/48jAf2q+sF6wXTG+c= +github.com/go-openapi/strfmt v0.26.1/go.mod h1:Zslk5VZPOISLwmWTMBIS7oiVFem1o1EI6zULY8Uer7Y= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/swag/conv v0.25.5 h1:wAXBYEXJjoKwE5+vc9YHhpQOFj2JYBMF2DUi+tGu97g= +github.com/go-openapi/swag/conv v0.25.5/go.mod h1:CuJ1eWvh1c4ORKx7unQnFGyvBbNlRKbnRyAvDvzWA4k= +github.com/go-openapi/swag/fileutils v0.25.5 h1:B6JTdOcs2c0dBIs9HnkyTW+5gC+8NIhVBUwERkFhMWk= +github.com/go-openapi/swag/fileutils v0.25.5/go.mod h1:V3cT9UdMQIaH4WiTrUc9EPtVA4txS0TOmRURmhGF4kc= github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/swag/jsonutils v0.25.5 h1:XUZF8awQr75MXeC+/iaw5usY/iM7nXPDwdG3Jbl9vYo= +github.com/go-openapi/swag/jsonutils v0.25.5/go.mod h1:48FXUaz8YsDAA9s5AnaUvAmry1UcLcNVWUjY42XkrN4= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5 h1:SX6sE4FrGb4sEnnxbFL/25yZBb5Hcg1inLeErd86Y1U= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5/go.mod h1:/2KvOTrKWjVA5Xli3DZWdMCZDzz3uV/T7bXwrKWPquo= +github.com/go-openapi/swag/loading v0.25.5 h1:odQ/umlIZ1ZVRteI6ckSrvP6e2w9UTF5qgNdemJHjuU= +github.com/go-openapi/swag/loading v0.25.5/go.mod h1:I8A8RaaQ4DApxhPSWLNYWh9NvmX2YKMoB9nwvv6oW6g= +github.com/go-openapi/swag/mangling v0.25.5 h1:hyrnvbQRS7vKePQPHHDso+k6CGn5ZBs5232UqWZmJZw= +github.com/go-openapi/swag/mangling v0.25.5/go.mod h1:6hadXM/o312N/h98RwByLg088U61TPGiltQn71Iw0NY= +github.com/go-openapi/swag/stringutils v0.25.5 h1:NVkoDOA8YBgtAR/zvCx5rhJKtZF3IzXcDdwOsYzrB6M= +github.com/go-openapi/swag/stringutils v0.25.5/go.mod h1:PKK8EZdu4QJq8iezt17HM8RXnLAzY7gW0O1KKarrZII= +github.com/go-openapi/swag/typeutils v0.25.5 h1:EFJ+PCga2HfHGdo8s8VJXEVbeXRCYwzzr9u4rJk7L7E= +github.com/go-openapi/swag/typeutils v0.25.5/go.mod h1:itmFmScAYE1bSD8C4rS0W+0InZUBrB2xSPbWt6DLGuc= +github.com/go-openapi/swag/yamlutils v0.25.5 h1:kASCIS+oIeoc55j28T4o8KwlV2S4ZLPT6G0iq2SSbVQ= +github.com/go-openapi/swag/yamlutils v0.25.5/go.mod h1:Gek1/SjjfbYvM+Iq4QGwa/2lEXde9n2j4a3wI3pNuOQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.0 h1:7SgOMTvJkM8yWrQlU8Jm18VeDPuAvB/xWrdxFJkoFag= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.0/go.mod h1:14iV8jyyQlinc9StD7w1xVPW3CO3q1Gj04Jy//Kw4VM= github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-openapi/validate v0.25.2 h1:12NsfLAwGegqbGWr2CnvT65X/Q2USJipmJ9b7xDJZz0= +github.com/go-openapi/validate v0.25.2/go.mod h1:Pgl1LpPPGFnZ+ys4/hTlDiRYQdI1ocKypgE+8Q8BLfY= +github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= +github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -87,8 +125,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/grafana/grafana-plugin-sdk-go v0.291.0 h1:VlA6wYdjMxx7xpthEd0qZgbtfqlRWRZJ3CqnMNks0+U= -github.com/grafana/grafana-plugin-sdk-go v0.291.0/go.mod h1:cLkz5/DpTRGiX65qF1k4RoIydzWtYbwTD/asDOY7aMk= +github.com/grafana/grafana-plugin-sdk-go v0.292.0 h1:HaFIbBmPX9K+BVsVemid+poDEbja+HJ8VE+6tVnZKLU= +github.com/grafana/grafana-plugin-sdk-go v0.292.0/go.mod h1:lnWyfzENuIU+N2EzivEe9YJob8AAqPl7HBMXMbPyv3k= github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8= github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls= github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= @@ -118,6 +156,8 @@ github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/influxdata/tdigest v0.0.1 h1:XpFptwYmnEKUqmkcDjrzffswZ3nvNeevbUSLPP/ZzIY= github.com/influxdata/tdigest v0.0.1/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y= +github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E= +github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/jaegertracing/jaeger-idl v0.6.0 h1:LOVQfVby9ywdMPI9n3hMwKbyLVV3BL1XH2QqsP5KTMk= github.com/jaegertracing/jaeger-idl v0.6.0/go.mod h1:mpW0lZfG907/+o5w5OlnNnig7nHJGT3SfKmRqC42HGQ= github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= @@ -144,8 +184,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/magefile/mage v1.16.1 h1:j5UwkdA48xTlGs0Hcm1Q3sSAcxBorntQjiewDNMsqlo= -github.com/magefile/mage v1.16.1/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/magefile/mage v1.17.1 h1:F1d2lnLSlbQDM0Plq6Ac4NtaHxkxTK8t5nrMY9SkoNA= +github.com/magefile/mage v1.17.1/go.mod h1:Yj51kqllmsgFpvvSzgrZPK9WtluG3kUhFaBUVLo4feA= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattetti/filebuffer v1.0.1 h1:gG7pyfnSIZCxdoKq+cPa8T0hhYtD9NxCdI4D7PTjRLM= @@ -176,6 +216,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s= +github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 h1:zrbMGy9YXpIeTnGj4EljqMiZsIcE09mmF8XsD5AYOJc= github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6/go.mod h1:rEKTHC9roVVicUIfZK7DYrdIoM0EOr8mK1Hj5s3JjH0= github.com/olekukonko/errors v1.2.0 h1:10Zcn4GeV59t/EGqJc8fUjtFT/FuUh5bTMzZ1XwmCRo= @@ -241,6 +283,8 @@ github.com/unknwon/log v0.0.0-20200308114134-929b1006e34a/go.mod h1:1xEUf2abjfP9 github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.17 h1:SYzXoiPfQjHBbkYxbew5prZHS1TOLT3ierW8SYLqtVQ= github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= @@ -262,10 +306,10 @@ go.opentelemetry.io/contrib/samplers/jaegerremote v0.36.0/go.mod h1:tjrgaYHDx+1C go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 h1:THuZiwpQZuHPul65w4WcwEnkX2QIuMT+UFoOrygtoJw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0/go.mod h1:J2pvYM5NGHofZ2/Ru6zw/TNWnEQp5crgyDeSrYpXkAw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0 h1:zWWrB1U6nqhS/k6zYB74CjRpuiitRtLLi68VcgmOEto= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0/go.mod h1:2qXPNBX1OVRC0IwOnfo1ljoid+RD0QK3443EaqVlsOU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 h1:88Y4s2C8oTui1LGM6bTWkw0ICGcOLCAI5l6zsD1j20k= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0/go.mod h1:Vl1/iaggsuRlrHf/hfPJPvVag77kKyvrLeD10kpMl+A= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 h1:RAE+JPfvEmvy+0LzyUA25/SGawPwIUbZ6u0Wug54sLc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0/go.mod h1:AGmbycVGEsRx9mXMZ75CsOyhSP6MFIcj/6dnG+vhVjk= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM= go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= @@ -277,8 +321,8 @@ go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHS go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= -go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= -go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= +go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= +go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= @@ -319,8 +363,8 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 h1:bTLqdHv7xrGlFbvf5/TXNxy/iUwwdkjhqQTJDjW7aj0= golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4/go.mod h1:g5NllXBEermZrmR51cJDQxmJUHUOfRAaNyWBM+R+548= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -344,12 +388,12 @@ gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 h1:JLQynH/LBHfCTSbDWl+py8C+Rg/k1OVH3xfcaiANuF0= -google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:kSJwQxqmFXeo79zOmbrALdflXQeAYcUbgS7PbpMknCY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 h1:ggcbiqK8WWh6l1dnltU4BgWGIGo+EVYxCaAPih/zQXQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= -google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:7QBABkRtR8z+TEnmXTqIqwJLlzrZKVfAUm7tY3yGv0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 h1:m8qni9SQFH0tJc1X0vmnpw/0t+AImlSvp30sEupozUg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= +google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -372,3 +416,5 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/pkg/github/sql_handler_test.go b/pkg/github/sql_handler_test.go index 6ffe9da8..5d654fbb 100644 --- a/pkg/github/sql_handler_test.go +++ b/pkg/github/sql_handler_test.go @@ -6,12 +6,13 @@ import ( "github.com/grafana/github-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/config" "github.com/grafana/grafana-plugin-sdk-go/experimental/featuretoggles" ) func pluginCtxWithFeatureToggle() backend.PluginContext { return backend.PluginContext{ - GrafanaConfig: backend.NewGrafanaCfg(map[string]string{ + GrafanaConfig: config.NewGrafanaCfg(map[string]string{ featuretoggles.EnabledFeatures: "dsAbstractionApp", }), } @@ -808,7 +809,7 @@ func TestNormalizeGrafanaSQLRequestWithoutFeatureToggle(t *testing.T) { queryJSON := []byte(`{"refId":"A","grafanaSql":true,"table":"issues_grafana_grafana"}`) req := &backend.QueryDataRequest{ PluginContext: backend.PluginContext{ - GrafanaConfig: backend.NewGrafanaCfg(map[string]string{}), + GrafanaConfig: config.NewGrafanaCfg(map[string]string{}), }, Queries: []backend.DataQuery{ {RefID: "A", JSON: queryJSON}, @@ -827,7 +828,7 @@ func TestNormalizeGrafanaSQLRequestWithoutFeatureToggle(t *testing.T) { queryJSON := []byte(`{"refId":"A","queryType":"Pull_Requests","owner":"grafana","repository":"grafana"}`) req := &backend.QueryDataRequest{ PluginContext: backend.PluginContext{ - GrafanaConfig: backend.NewGrafanaCfg(map[string]string{}), + GrafanaConfig: config.NewGrafanaCfg(map[string]string{}), }, Queries: []backend.DataQuery{ {RefID: "A", JSON: queryJSON}, @@ -847,7 +848,7 @@ func TestNormalizeGrafanaSQLRequestWithoutFeatureToggle(t *testing.T) { normalQueryJSON := []byte(`{"refId":"B","queryType":"Pull_Requests","owner":"grafana","repository":"grafana"}`) req := &backend.QueryDataRequest{ PluginContext: backend.PluginContext{ - GrafanaConfig: backend.NewGrafanaCfg(map[string]string{}), + GrafanaConfig: config.NewGrafanaCfg(map[string]string{}), }, Queries: []backend.DataQuery{ {RefID: "A", JSON: sqlQueryJSON}, diff --git a/pkg/models/query_test.go b/pkg/models/query_test.go new file mode 100644 index 00000000..abeff7a7 --- /dev/null +++ b/pkg/models/query_test.go @@ -0,0 +1,315 @@ +package models + +import ( + "reflect" + "testing" + + "github.com/shurcooL/githubv4" + "github.com/stretchr/testify/require" + + data "github.com/grafana/grafana-plugin-sdk-go/experimental/apis/datasource/v0alpha1" + "github.com/grafana/grafana-plugin-sdk-go/experimental/schemabuilder" +) + +func TestSchemaDefinitions(t *testing.T) { + builder, err := schemabuilder.NewSchemaBuilder( + schemabuilder.BuilderOptions{ + PluginID: []string{"grafana-github-datasource"}, + ScanCode: []schemabuilder.CodePaths{{ + BasePackage: "github.com/grafana/github-datasource/pkg/models", + CodePath: "./", + }}, + }, + ) + + common := Query{ + Repository: "github-datasource", + Owner: "grafana", + } + + require.NoError(t, err) + err = builder.AddQueries([]schemabuilder.QueryTypeInfo{{ + GoType: reflect.TypeFor[*PullRequestsQuery](), + Discriminators: data.NewDiscriminators("queryType", QueryTypePullRequests), + Examples: []data.QueryExample{ + { + Name: "Simple", + SaveModel: data.AsUnstructured(PullRequestsQuery{ + Query: common, + Options: ListPullRequestsOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeCommits), + GoType: reflect.TypeFor[*CommitsQuery](), + Examples: []data.QueryExample{ + { + Name: "CommitsQuery", + SaveModel: data.AsUnstructured(CommitsQuery{ + Query: common, + Options: ListCommitsOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeTags), + GoType: reflect.TypeFor[*TagsQuery](), + Examples: []data.QueryExample{ + { + Name: "TagsQuery", + SaveModel: data.AsUnstructured(TagsQuery{ + Query: common, + Options: ListTagsOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeLabels), + GoType: reflect.TypeFor[*LabelsQuery](), + Examples: []data.QueryExample{ + { + Name: "LabelsQuery", + SaveModel: data.AsUnstructured(LabelsQuery{ + Query: common, + Options: ListLabelsOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeReleases), + GoType: reflect.TypeFor[*ReleasesQuery](), + Examples: []data.QueryExample{ + { + Name: "ReleasesQuery", + SaveModel: data.AsUnstructured(ReleasesQuery{ + Query: common, + Options: ListReleasesOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeContributors), + GoType: reflect.TypeFor[*ContributorsQuery](), + Examples: []data.QueryExample{ + { + Name: "ContributorsQuery", + SaveModel: data.AsUnstructured(ContributorsQuery{ + Query: common, + Options: ListContributorsOptions{Owner: "yesoreyeram"}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeRepositories), + GoType: reflect.TypeFor[*RepositoriesQuery](), + Examples: []data.QueryExample{ + { + Name: "RepositoriesQuery", + SaveModel: data.AsUnstructured(RepositoriesQuery{ + Query: Query{ + Owner: "yesoreyeram", + }, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeIssues), + GoType: reflect.TypeFor[*IssuesQuery](), + Examples: []data.QueryExample{ + { + Name: "IssuesQuery", + SaveModel: data.AsUnstructured(IssuesQuery{ + Query: common, + Options: ListIssuesOptions{ + Filters: &githubv4.IssueFilters{ + States: &[]githubv4.IssueState{ + githubv4.IssueStateOpen, + }, + }, + }, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypePackages), + GoType: reflect.TypeFor[*PackagesQuery](), + Examples: []data.QueryExample{ + { + Name: "PackagesQuery", + SaveModel: data.AsUnstructured(PackagesQuery{ + Query: common, + Options: ListPackagesOptions{ + PackageType: githubv4.PackageTypeDocker, + }, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeMilestones), + GoType: reflect.TypeFor[*MilestonesQuery](), + Examples: []data.QueryExample{ + { + Name: "MilestonesQuery", + SaveModel: data.AsUnstructured(MilestonesQuery{ + Query: common, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeVulnerabilities), + GoType: reflect.TypeFor[*VulnerabilityQuery](), + Examples: []data.QueryExample{ + { + Name: "VulnerabilityQuery", + SaveModel: data.AsUnstructured(VulnerabilityQuery{ + Query: common, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeStargazers), + GoType: reflect.TypeFor[*StargazersQuery](), + Examples: []data.QueryExample{ + { + Name: "StargazersQuery", + SaveModel: data.AsUnstructured(StargazersQuery{ + Query: common, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeWorkflows), + GoType: reflect.TypeFor[*WorkflowsQuery](), + Examples: []data.QueryExample{ + { + Name: "WorkflowsQuery", + SaveModel: data.AsUnstructured(WorkflowsQuery{ + Query: common, + Options: ListWorkflowsOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeWorkflowUsage), + GoType: reflect.TypeFor[*WorkflowUsageQuery](), + Examples: []data.QueryExample{ + { + Name: "WorkflowUsageQuery", + SaveModel: data.AsUnstructured(WorkflowUsageQuery{ + Query: common, + Options: WorkflowUsageOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeCodeScanning), + GoType: reflect.TypeFor[*CodeScanningQuery](), + Examples: []data.QueryExample{ + { + Name: "CodeScanningQuery", + SaveModel: data.AsUnstructured(CodeScanningQuery{ + Query: common, + Options: CodeScanningOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeCommitFiles), + GoType: reflect.TypeFor[*CommitFilesQuery](), + Examples: []data.QueryExample{ + { + Name: "CommitFilesQuery", + SaveModel: data.AsUnstructured(CommitFilesQuery{ + Query: common, + Options: CommitFilesOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypePullRequestReviews), + GoType: reflect.TypeFor[*PullRequestReviewsQuery](), + Examples: []data.QueryExample{ + { + Name: "PullRequestReviewsQuery", + SaveModel: data.AsUnstructured(PullRequestReviewsQuery{ + Query: common, + Options: ListPullRequestsOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypePullRequestFiles), + GoType: reflect.TypeFor[*PullRequestFilesQuery](), + Examples: []data.QueryExample{ + { + Name: "PullRequestFilesQuery", + SaveModel: data.AsUnstructured(PullRequestFilesQuery{ + Query: common, + Options: PullRequestFilesOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeWorkflowRuns), + GoType: reflect.TypeFor[*WorkflowRunsQuery](), + Examples: []data.QueryExample{ + { + Name: "WorkflowRunsQuery", + SaveModel: data.AsUnstructured(WorkflowRunsQuery{ + Query: common, + Options: WorkflowRunsOptions{}, + }), + }, + }, + }, { + Discriminators: data.NewDiscriminators("queryType", QueryTypeDeployments), + GoType: reflect.TypeFor[*DeploymentsQuery](), + Examples: []data.QueryExample{ + { + Name: "DeploymentsQuery", + SaveModel: data.AsUnstructured(DeploymentsQuery{ + Query: common, + Options: ListDeploymentsOptions{}, + }), + }, + }, + // }, schemabuilder.QueryTypeInfo{ + // Discriminators: data.NewDiscriminators("queryType", QueryTypeOrganizations), + // GoType: reflect.TypeFor[*OrganizationsQuery](), + // Examples: []data.QueryExample{ + // { + // Name: "OrganizationsQuery", + // SaveModel: data.AsUnstructured(OrganizationsQuery{}), + // }, + // }, + // }, schemabuilder.QueryTypeInfo{ + // Discriminators: data.NewDiscriminators("queryType", QueryTypeProjects), + // GoType: reflect.TypeFor[*ProjectsQuery](), + // Examples: []data.QueryExample{ + // { + // Name: "ProjectsQuery", + // SaveModel: data.AsUnstructured(ProjectsQuery{ + // Options: ProjectOptions{}, + // }), + // }, + // }, + // }, schemabuilder.QueryTypeInfo{ + // Discriminators: data.NewDiscriminators("queryType", QueryTypeGraphQL), + // GoType: reflect.TypeFor[*GraphQLQuery](), + // Examples: []data.QueryExample{ + // { + // Name: "GraphQLQuery", + // SaveModel: data.AsUnstructured(GraphQLQuery{ + // Query: common, + // Options: ListDeploymentsOptions{}, + // }), + // }, + // }, + }}) + + require.NoError(t, err) + + // Update the query schemas resource + builder.UpdateProviderFiles(t, "v0alpha1", "../../src/schema/") +} diff --git a/src/schema/v0alpha1/query.examples.json b/src/schema/v0alpha1/query.examples.json new file mode 100644 index 00000000..da677433 --- /dev/null +++ b/src/schema/v0alpha1/query.examples.json @@ -0,0 +1,259 @@ +{ + "examples": [ + { + "name": "Simple", + "queryType": "Pull_Requests", + "saveModel": { + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "CommitsQuery", + "queryType": "Commits", + "saveModel": { + "options": { + "gitRef": "", + "includeFiles": false, + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "TagsQuery", + "queryType": "Tags", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "LabelsQuery", + "queryType": "Labels", + "saveModel": { + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "ReleasesQuery", + "queryType": "Releases", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "ContributorsQuery", + "queryType": "Contributors", + "saveModel": { + "options": { + "owner": "yesoreyeram", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "RepositoriesQuery", + "queryType": "Repositories", + "saveModel": { + "owner": "yesoreyeram", + "repository": "" + } + }, + { + "name": "IssuesQuery", + "queryType": "Issues", + "saveModel": { + "options": { + "filters": { + "states": [ + "OPEN" + ] + }, + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "PackagesQuery", + "queryType": "Packages", + "saveModel": { + "options": { + "names": "", + "owner": "", + "packageType": "DOCKER", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "MilestonesQuery", + "queryType": "Milestones", + "saveModel": { + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "VulnerabilityQuery", + "queryType": "Vulnerabilities", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "StargazersQuery", + "queryType": "Stargazers", + "saveModel": { + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "WorkflowsQuery", + "queryType": "Workflows", + "saveModel": { + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "WorkflowUsageQuery", + "queryType": "Workflow_Usage", + "saveModel": { + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "CodeScanningQuery", + "queryType": "Code_Scanning", + "saveModel": { + "options": { + "gitRef": "", + "owner": "", + "repository": "", + "state": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "CommitFilesQuery", + "queryType": "Commit_Files", + "saveModel": { + "options": { + "commitSha": "", + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "PullRequestReviewsQuery", + "queryType": "Pull_Request_Reviews", + "saveModel": { + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "PullRequestFilesQuery", + "queryType": "Pull_Request_Files", + "saveModel": { + "options": { + "owner": "", + "prNumber": 0, + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "WorkflowRunsQuery", + "queryType": "Workflow_Runs", + "saveModel": { + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + }, + { + "name": "DeploymentsQuery", + "queryType": "Deployments", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] +} \ No newline at end of file diff --git a/src/schema/v0alpha1/query.types.json b/src/schema/v0alpha1/query.types.json new file mode 100644 index 00000000..24bb7b0d --- /dev/null +++ b/src/schema/v0alpha1/query.types.json @@ -0,0 +1,1158 @@ +{ + "kind": "QueryTypeDefinitionList", + "apiVersion": "datasource.grafana.app/v0alpha1", + "metadata": { + "resourceVersion": "1776862963042" + }, + "items": [ + { + "metadata": { + "name": "Pull_Requests", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Pull_Requests" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "PullRequestsQuery is used when querying for GitHub Pull Requests", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "query": { + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + }, + "timeField": { + "description": "TimeField defines what time field to filter by", + "type": "integer" + } + }, + "required": [ + "repository", + "owner", + "timeField" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Commits", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Commits" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "CommitsQuery is used when querying for GitHub commits", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "gitRef": { + "type": "string" + }, + "includeFiles": { + "type": "boolean" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "gitRef", + "includeFiles" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Tags", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Tags" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "TagsQuery is used when querying for GitHub tags", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + } + }, + "required": [ + "repository", + "owner" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Labels", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Labels" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "LabelsQuery is used when querying for GitHub issue labels", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "query": { + "description": "Query searches labels by name and description", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "query" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Releases", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Releases" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "ReleasesQuery is used when querying for GitHub issue labels", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + } + }, + "required": [ + "repository", + "owner" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Contributors", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Contributors" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "ContributorsQuery is used when querying for GitHub contributors", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "query": { + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + } + }, + "required": [ + "repository", + "owner" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Repositories", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Repositories" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "RepositoriesQuery is used when querying for GitHub repositories", + "properties": { + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Issues", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Issues" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "IssuesQuery is used when querying for GitHub issues", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "filters": { + "additionalProperties": false, + "properties": { + "assignee": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "mentioned": { + "type": "string" + }, + "milestone": { + "type": "string" + }, + "milestoneNumber": { + "type": "string" + }, + "since": { + "additionalProperties": false, + "type": "object" + }, + "states": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "type": "string" + }, + "viewerSubscribed": { + "type": "boolean" + } + }, + "type": "object" + }, + "owner": { + "type": "string" + }, + "query": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "timeField": { + "type": "integer" + } + }, + "required": [ + "repository", + "owner", + "filters", + "timeField" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Packages", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Packages" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "PackagesQuery is used when querying for GitHub packages, including NPM, Maven, PyPi, Rubygems, and Docker", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "names": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "packageType": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "names", + "packageType" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Milestones", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Milestones" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "MilestonesQuery is used when querying for GitHub milestones", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "query": { + "description": "Query searches milestones by name and description", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "query" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Vulnerabilities", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Vulnerabilities" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "VulnerabilityQuery is used when querying for GitHub Repository Vulnerabilities", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + } + }, + "required": [ + "repository", + "owner" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Stargazers", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Stargazers" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "StargazersQuery is used when querying stargazers for a repository", + "properties": { + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Workflows", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Workflows" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "WorkflowsQuery is used when querying workflows for an organization", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + }, + "timeField": { + "description": "The field used to check if an entry is in the requested range.", + "type": "integer" + } + }, + "required": [ + "owner", + "repository", + "timeField" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Workflow_Usage", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Workflow_Usage" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "WorkflowUsageQuery is used when querying a workflow usage", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "branch": { + "description": "Branch is the branch to filter the runs by.", + "type": "string" + }, + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + }, + "workflow": { + "description": "Workflow is the id or the workflow file name.", + "type": "string" + } + }, + "required": [ + "owner", + "repository", + "workflow", + "branch" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Code_Scanning", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Code_Scanning" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "CodeScanningQuery is used when querying code scanning alerts for a repository", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "gitRef": { + "description": "Ref is the Git reference for the results we want to list.\nThe ref for a branch can be formatted either as refs/heads/\u003cbranch name\u003e or simply \u003cbranch name\u003e.\nTo reference a pull request use refs/pull/\u003cnumber\u003e/merge.", + "type": "string" + }, + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + }, + "state": { + "description": "State is the state of the code scanning alerts. Can be one of: open, closed, dismissed, fixed.", + "type": "string" + } + }, + "required": [ + "owner", + "repository", + "state", + "gitRef" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Commit_Files", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Commit_Files" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "CommitFilesQuery is used when querying for files changed in a GitHub commit", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "commitSha": { + "description": "Ref is the commit SHA to retrieve changed files for", + "type": "string" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "owner", + "repository", + "commitSha" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Pull_Request_Reviews", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Pull_Request_Reviews" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "PullRequestReviewsQuery is used when querying for GitHub Pull Request Reviews", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "query": { + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + }, + "timeField": { + "description": "TimeField defines what time field to filter by", + "type": "integer" + } + }, + "required": [ + "repository", + "owner", + "timeField" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Pull_Request_Files", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Pull_Request_Files" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "PullRequestFilesQuery is used when querying for files changed in a GitHub pull request", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "owner": { + "type": "string" + }, + "prNumber": { + "description": "PRNumber is the pull request number", + "type": "integer" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "owner", + "repository", + "prNumber" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Workflow_Runs", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Workflow_Runs" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "WorkflowRunsQuery is used when querying workflow runs for a repository", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "branch": { + "description": "Branch is the branch to filter the runs by.", + "type": "string" + }, + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + }, + "workflow": { + "description": "Workflow is the id or the workflow file name.", + "type": "string" + } + }, + "required": [ + "owner", + "repository", + "workflow", + "branch" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + }, + { + "metadata": { + "name": "Deployments", + "resourceVersion": "1776862963042", + "creationTimestamp": "2026-04-22T13:02:43Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Deployments" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft-04/schema", + "additionalProperties": false, + "description": "DeploymentsQuery is used when querying deployments for a repository", + "properties": { + "options": { + "additionalProperties": false, + "properties": { + "environment": { + "description": "Environment is the name of the environment (e.g., \"production\", \"staging\") to filter by", + "type": "string" + }, + "gitRef": { + "description": "GitRef is the name of the ref (branch, tag, or SHA) to filter by", + "type": "string" + }, + "owner": { + "description": "Owner is the owner of the repository (ex: grafana)", + "type": "string" + }, + "repository": { + "description": "Repository is the name of the repository being queried (ex: grafana)", + "type": "string" + }, + "sha": { + "description": "SHA is the SHA recorded at creation time to filter by", + "type": "string" + }, + "task": { + "description": "Task is the name of the task (e.g., \"deploy\", \"deploy:migrations\") to filter by", + "type": "string" + } + }, + "required": [ + "repository", + "owner" + ], + "type": "object" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "owner", + "options" + ], + "type": "object" + } + } + } + ] +} \ No newline at end of file