diff --git a/cspell.config.json b/cspell.config.json index 5f322013..31485a38 100644 --- a/cspell.config.json +++ b/cspell.config.json @@ -6,17 +6,20 @@ "mage_output_file.go", "package.json", "renovate.json", + "query.panel.schema.json", + "query.request.schema.json", + "query.types.json", "yarn.lock" ], - "ignoreRegExpList": [ - "import\\s*\\((.|[\r\n])*?\\)", - "import\\s*.*\".*?\"" - ], + "ignoreRegExpList": ["import\\s*\\((.|[\r\n])*?\\)", "import\\s*.*\".*?\""], "words": [ + "apiserver", + "dataplane", "araddon", "bmike", - "CTAV", "combobox", + "confg", + "CTAV", "Dataframe", "DATAPROXY", "datasource", @@ -26,6 +29,7 @@ "dompurify", "dserrors", "errorsource", + "featuretoggles", "ghinstallation", "githubclient", "githubv", @@ -34,8 +38,8 @@ "grafanabot", "groupby", "healthcheck", - "httpclient", "HTMLURL", + "httpclient", "instancemgmt", "jackspeak", "kminehart", @@ -43,6 +47,9 @@ "Mergeable", "mjseaman", "nazzzzz", + "octocat", + "oldorg", + "oldrepo", "prismjs", "promop", "PTRACE", @@ -52,6 +59,8 @@ "querytype", "rgba", "RUBYGEMS", + "schemabuilder", + "schemads", "seccomp", "shurcoo", "stretchr", @@ -71,11 +80,6 @@ "vals", "vladimirdotk", "Wrapf", - "confg", - "octocat", - "schemads", - "featuretoggles", - "oldorg", - "oldrepo" + "yesoreyeram" ] } diff --git a/go.mod b/go.mod index 48f60093..59d3e455 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,8 @@ require ( require ( github.com/BurntSushi/toml v1.6.0 // indirect github.com/apache/arrow-go/v18 v18.5.1 // indirect + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/clipperhouse/displaywidth v0.6.2 // indirect github.com/clipperhouse/stringish v0.1.1 // indirect @@ -46,6 +48,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 @@ -68,6 +71,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.0.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 // indirect @@ -93,6 +97,7 @@ require ( 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 + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect sigs.k8s.io/randfill v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index bcef7c93..4719a0e4 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.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/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= @@ -50,16 +54,46 @@ 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.1 h1:Xp+7Yn/KOnVWYG8d+hPksOYnCYImE3TieBa7rBOesYM= +github.com/go-openapi/analysis v0.24.1/go.mod h1:dU+qxX7QGU1rl7IYhBC8bIfmWQdX4Buoea4TGtxXY84= +github.com/go-openapi/errors v0.22.4 h1:oi2K9mHTOb5DPW2Zjdzs/NIvwi2N3fARKaTJLdNabaM= +github.com/go-openapi/errors v0.22.4/go.mod h1:z9S8ASTUqx7+CP1Q8dD8ewGH/1JWFFLX/2PmAYNQLgk= github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/loads v0.23.2 h1:rJXAcP7g1+lWyBHC7iTY+WAF0rprtM+pm8Jxv1uQJp4= +github.com/go-openapi/loads v0.23.2/go.mod h1:IEVw1GfRt/P2Pplkelxzj9BYFajiWOtY2nHZNj4UnWY= +github.com/go-openapi/spec v0.22.3 h1:qRSmj6Smz2rEBxMnLRBMeBWxbbOvuOoElvSvObIgwQc= +github.com/go-openapi/spec v0.22.3/go.mod h1:iIImLODL2loCh3Vnox8TY2YWYJZjMAKYyLH2Mu8lOZs= +github.com/go-openapi/strfmt v0.25.0 h1:7R0RX7mbKLa9EYCTHRcCuIPcaqlyQiWNPTXwClK0saQ= +github.com/go-openapi/strfmt v0.25.0/go.mod h1:nNXct7OzbwrMY9+5tLX4I21pzcmE6ccMGXl3jFdPfn8= 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.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.1 h1:rSRXapjQequt7kqalKXdcpIegIShhTPXx7yw0kek2uU= +github.com/go-openapi/swag/fileutils v0.25.1/go.mod h1:+NXtt5xNZZqmpIpjqcujqojGFek9/w55b3ecmOdtg8M= github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.1 h1:XzILnLzhZPZNtmxKaz/2xIGPQsBsvmCjrJOWGNz/ync= +github.com/go-openapi/swag/mangling v0.25.1/go.mod h1:CdiMQ6pnfAgyQGSOIYnZkXvqhnnwOn997uXZMAd/7mQ= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-openapi/validate v0.25.1 h1:sSACUI6Jcnbo5IWqbYHgjibrhhmt3vR6lCzKZnmAgBw= +github.com/go-openapi/validate v0.25.1/go.mod h1:RMVyVFYte0gbSTaZ0N4KmTn6u/kClvAFp+mAVfS/DQc= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.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= @@ -120,6 +154,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= @@ -178,6 +214,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 v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 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.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM= @@ -243,12 +281,16 @@ 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= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss= +go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 h1:XmiuHzgJt067+a6kwyAzkhXooYVv3/TOw9cM2VfJgUM= diff --git a/pkg/github/query_handler.go b/pkg/github/query_handler.go index 1bd49314..fd7536b9 100644 --- a/pkg/github/query_handler.go +++ b/pkg/github/query_handler.go @@ -4,11 +4,11 @@ import ( "context" "encoding/json" - "github.com/grafana/grafana-plugin-sdk-go/backend" - "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" "github.com/pkg/errors" "github.com/grafana/github-datasource/pkg/models" + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" ) // QueryHandler is the main handler for datasource queries. @@ -43,28 +43,28 @@ func UnmarshalQuery(b []byte, v interface{}) *backend.DataResponse { func GetQueryHandlers(s *QueryHandler) *datasource.QueryTypeMux { mux := datasource.NewQueryTypeMux() - mux.HandleFunc(models.QueryTypeCommits, s.HandleCommits) - mux.HandleFunc(models.QueryTypeIssues, s.HandleIssues) - mux.HandleFunc(models.QueryTypeContributors, s.HandleContributors) - mux.HandleFunc(models.QueryTypeLabels, s.HandleLabels) - mux.HandleFunc(models.QueryTypePullRequests, s.HandlePullRequests) - mux.HandleFunc(models.QueryTypePullRequestReviews, s.HandlePullRequestReviews) - mux.HandleFunc(models.QueryTypeReleases, s.HandleReleases) - mux.HandleFunc(models.QueryTypeTags, s.HandleTags) - mux.HandleFunc(models.QueryTypePackages, s.HandlePackages) - mux.HandleFunc(models.QueryTypeMilestones, s.HandleMilestones) - mux.HandleFunc(models.QueryTypeRepositories, s.HandleRepositories) - mux.HandleFunc(models.QueryTypeVulnerabilities, s.HandleVulnerabilities) - mux.HandleFunc(models.QueryTypeProjects, s.HandleProjects) - mux.HandleFunc(models.QueryTypeStargazers, s.HandleStargazers) - mux.HandleFunc(models.QueryTypeWorkflows, s.HandleWorkflows) - mux.HandleFunc(models.QueryTypeWorkflowUsage, s.HandleWorkflowUsage) - mux.HandleFunc(models.QueryTypeWorkflowRuns, s.HandleWorkflowRuns) - mux.HandleFunc(models.QueryTypeCodeScanning, s.HandleCodeScanning) - mux.HandleFunc(models.QueryTypeDeployments, s.HandleDeployments) - mux.HandleFunc(models.QueryTypeOrganizations, s.HandleOrganizations) - mux.HandleFunc(models.QueryTypeCommitFiles, s.HandleCommitFiles) - mux.HandleFunc(models.QueryTypePullRequestFiles, s.HandlePullRequestFiles) + mux.HandleFunc(string(models.QueryTypeCommits), s.HandleCommits) + mux.HandleFunc(string(models.QueryTypeIssues), s.HandleIssues) + mux.HandleFunc(string(models.QueryTypeContributors), s.HandleContributors) + mux.HandleFunc(string(models.QueryTypeLabels), s.HandleLabels) + mux.HandleFunc(string(models.QueryTypePullRequests), s.HandlePullRequests) + mux.HandleFunc(string(models.QueryTypePullRequestReviews), s.HandlePullRequestReviews) + mux.HandleFunc(string(models.QueryTypeReleases), s.HandleReleases) + mux.HandleFunc(string(models.QueryTypeTags), s.HandleTags) + mux.HandleFunc(string(models.QueryTypePackages), s.HandlePackages) + mux.HandleFunc(string(models.QueryTypeMilestones), s.HandleMilestones) + mux.HandleFunc(string(models.QueryTypeRepositories), s.HandleRepositories) + mux.HandleFunc(string(models.QueryTypeVulnerabilities), s.HandleVulnerabilities) + mux.HandleFunc(string(models.QueryTypeProjects), s.HandleProjects) + mux.HandleFunc(string(models.QueryTypeStargazers), s.HandleStargazers) + mux.HandleFunc(string(models.QueryTypeWorkflows), s.HandleWorkflows) + mux.HandleFunc(string(models.QueryTypeWorkflowUsage), s.HandleWorkflowUsage) + mux.HandleFunc(string(models.QueryTypeWorkflowRuns), s.HandleWorkflowRuns) + mux.HandleFunc(string(models.QueryTypeCodeScanning), s.HandleCodeScanning) + mux.HandleFunc(string(models.QueryTypeDeployments), s.HandleDeployments) + mux.HandleFunc(string(models.QueryTypeOrganizations), s.HandleOrganizations) + mux.HandleFunc(string(models.QueryTypeCommitFiles), s.HandleCommitFiles) + mux.HandleFunc(string(models.QueryTypePullRequestFiles), s.HandlePullRequestFiles) return mux } diff --git a/pkg/github/schema.go b/pkg/github/schema.go index a4d540dd..1445ae8f 100644 --- a/pkg/github/schema.go +++ b/pkg/github/schema.go @@ -536,6 +536,6 @@ func getAllTables() []schemas.Table { } } -func normalizeTableNames(table string) string { - return strings.ToLower(strings.ReplaceAll(table, "_", "-")) +func normalizeTableNames(table models.QueryType) string { + return strings.ToLower(strings.ReplaceAll(string(table), "_", "-")) } diff --git a/pkg/github/sql.go b/pkg/github/sql.go index 451d6f15..4d5cc6ed 100644 --- a/pkg/github/sql.go +++ b/pkg/github/sql.go @@ -13,8 +13,8 @@ import ( // tableToQueryType maps normalized table names to their QueryType constants. // Built from the query type constants via normalizeTableNames so the schema // table definitions and this map stay in sync automatically. -var tableToQueryType = func() map[string]string { - qts := []string{ +var tableToQueryType = func() map[string]models.QueryType { + qts := []models.QueryType{ models.QueryTypeCommits, models.QueryTypeIssues, models.QueryTypePullRequests, @@ -37,7 +37,7 @@ var tableToQueryType = func() map[string]string { models.QueryTypeOrganizations, models.QueryTypeGraphQL, } - m := make(map[string]string, len(qts)) + m := make(map[string]models.QueryType, len(qts)) for _, qt := range qts { m[normalizeTableNames(qt)] = qt } @@ -84,7 +84,7 @@ func extractFilterValues(condition schemas.FilterCondition) []string { // applyFilters maps SQL filter predicates to GitHub API query options. // It modifies the options map in-place and returns a list of GitHub search // qualifiers for query types that use the search API. -func applyFilters(queryType string, options map[string]interface{}, filters []schemas.ColumnFilter) []string { +func applyFilters(queryType models.QueryType, options map[string]interface{}, filters []schemas.ColumnFilter) []string { var searchQualifiers []string opts, _ := options["options"].(map[string]interface{}) @@ -307,7 +307,7 @@ func normalizeGrafanaSQLRequest(req *backend.QueryDataRequest) *backend.QueryDat } queries = append(queries, backend.DataQuery{ RefID: q.RefID, - QueryType: queryType, + QueryType: string(queryType), MaxDataPoints: q.MaxDataPoints, Interval: q.Interval, TimeRange: q.TimeRange, diff --git a/pkg/github/sql_handler_test.go b/pkg/github/sql_handler_test.go index e8163f97..b9ec60c7 100644 --- a/pkg/github/sql_handler_test.go +++ b/pkg/github/sql_handler_test.go @@ -18,7 +18,7 @@ func pluginCtxWithFeatureToggle() backend.PluginContext { } func TestTableToQueryTypeCoversAllTypes(t *testing.T) { - allQueryTypes := []string{ + allQueryTypes := []models.QueryType{ models.QueryTypeCommits, models.QueryTypeIssues, models.QueryTypePullRequests, models.QueryTypePullRequestReviews, models.QueryTypeRepositories, models.QueryTypeContributors, @@ -43,7 +43,7 @@ func TestNormalizeAllTableTypes(t *testing.T) { tests := []struct { name string table string - wantType string + wantType models.QueryType wantOwner string wantRepo string unchanged bool @@ -89,8 +89,8 @@ func TestNormalizeAllTableTypes(t *testing.T) { } return } - if q.QueryType != tt.wantType { - t.Errorf("queryType: got %q, want %q", q.QueryType, tt.wantType) + if q.QueryType != string(tt.wantType) { + t.Errorf("queryType: got %q, want %q", q.QueryType, string(tt.wantType)) } var raw map[string]interface{} if err := json.Unmarshal(q.JSON, &raw); err != nil { @@ -120,14 +120,14 @@ func TestNormalizeGrafanaSQLRequest(t *testing.T) { t.Fatalf("expected one query, got %v", out) } q := out.Queries[0] - if q.QueryType != models.QueryTypePullRequests { + if q.QueryType != string(models.QueryTypePullRequests) { t.Errorf("queryType: got %q, want %q", q.QueryType, models.QueryTypePullRequests) } - var raw map[string]interface{} + var raw map[string]any if err := json.Unmarshal(q.JSON, &raw); err != nil { t.Fatal(err) } - if raw["queryType"] != models.QueryTypePullRequests { + if raw["queryType"] != string(models.QueryTypePullRequests) { t.Errorf("JSON queryType: got %v", raw["queryType"]) } if raw["owner"] != "grafana" || raw["repository"] != "grafana" { @@ -148,8 +148,8 @@ func TestNormalizeGrafanaSQLRequest(t *testing.T) { t.Fatalf("expected one query") } q := out.Queries[0] - if q.QueryType != models.QueryTypeIssues { - t.Errorf("queryType: got %q, want %q", q.QueryType, models.QueryTypeIssues) + if q.QueryType != string(models.QueryTypeIssues) { + t.Errorf("queryType: got %q, want %q", q.QueryType, string(models.QueryTypeIssues)) } var raw map[string]interface{} if err := json.Unmarshal(q.JSON, &raw); err != nil { @@ -172,8 +172,8 @@ func TestNormalizeGrafanaSQLRequest(t *testing.T) { if out == nil || len(out.Queries) != 1 { t.Fatalf("expected one query") } - if out.Queries[0].QueryType != models.QueryTypeCommits { - t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, models.QueryTypeCommits) + if out.Queries[0].QueryType != string(models.QueryTypeCommits) { + t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, string(models.QueryTypeCommits)) } }) @@ -189,8 +189,8 @@ func TestNormalizeGrafanaSQLRequest(t *testing.T) { if out == nil || len(out.Queries) != 1 { t.Fatalf("expected one query") } - if out.Queries[0].QueryType != models.QueryTypeCodeScanning { - t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, models.QueryTypeCodeScanning) + if out.Queries[0].QueryType != string(models.QueryTypeCodeScanning) { + t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, string(models.QueryTypeCodeScanning)) } }) @@ -207,8 +207,8 @@ func TestNormalizeGrafanaSQLRequest(t *testing.T) { t.Fatalf("expected one query") } q := out.Queries[0] - if q.QueryType != models.QueryTypeOrganizations { - t.Errorf("queryType: got %q, want %q", q.QueryType, models.QueryTypeOrganizations) + if q.QueryType != string(models.QueryTypeOrganizations) { + t.Errorf("queryType: got %q, want %q", q.QueryType, string(models.QueryTypeOrganizations)) } var raw map[string]interface{} if err := json.Unmarshal(q.JSON, &raw); err != nil { @@ -234,8 +234,8 @@ func TestNormalizeGrafanaSQLRequest(t *testing.T) { if out == nil || len(out.Queries) != 1 { t.Fatalf("expected one query") } - if out.Queries[0].QueryType != models.QueryTypeWorkflowRuns { - t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, models.QueryTypeWorkflowRuns) + if out.Queries[0].QueryType != string(models.QueryTypeWorkflowRuns) { + t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, string(models.QueryTypeWorkflowRuns)) } }) @@ -723,8 +723,8 @@ func TestNormalizeGrafanaSQLRequestWithFilters(t *testing.T) { if out == nil || len(out.Queries) != 1 { t.Fatalf("expected one query") } - if out.Queries[0].QueryType != models.QueryTypeIssues { - t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, models.QueryTypeIssues) + if out.Queries[0].QueryType != string(models.QueryTypeIssues) { + t.Errorf("queryType: got %q, want %q", out.Queries[0].QueryType, string(models.QueryTypeIssues)) } }) } diff --git a/pkg/models/query.go b/pkg/models/query.go index e062fe05..08f171de 100644 --- a/pkg/models/query.go +++ b/pkg/models/query.go @@ -1,54 +1,58 @@ package models +// QueryType defines the query operation +// +enum +type QueryType string + const ( // QueryTypeCommits is sent by the frontend when querying commits in a GitHub repository - QueryTypeCommits = "Commits" + QueryTypeCommits QueryType = "Commits" // QueryTypeIssues is used when querying issues in a GitHub repository - QueryTypeIssues = "Issues" + QueryTypeIssues QueryType = "Issues" // QueryTypeContributors is used when querying contributors in a GitHub repository - QueryTypeContributors = "Contributors" + QueryTypeContributors QueryType = "Contributors" // QueryTypeTags is used when querying tags in a GitHub repository - QueryTypeTags = "Tags" + QueryTypeTags QueryType = "Tags" // QueryTypeReleases is used when querying releases in a GitHub repository - QueryTypeReleases = "Releases" + QueryTypeReleases QueryType = "Releases" // QueryTypePullRequests is used when querying pull requests in a GitHub repository - QueryTypePullRequests = "Pull_Requests" + QueryTypePullRequests QueryType = "Pull_Requests" // QueryTypePullRequestReviews is used when querying pull request reviews in a GitHub repository QueryTypePullRequestReviews = "Pull_Request_Reviews" // QueryTypeLabels is used when querying labels in a GitHub repository - QueryTypeLabels = "Labels" + QueryTypeLabels QueryType = "Labels" // QueryTypeRepositories is used when querying for a GitHub repository - QueryTypeRepositories = "Repositories" + QueryTypeRepositories QueryType = "Repositories" // QueryTypeOrganizations is used when querying for GitHub organizations - QueryTypeOrganizations = "Organizations" + QueryTypeOrganizations QueryType = "Organizations" // QueryTypeGraphQL is used when sending an ad-hoc graphql query - QueryTypeGraphQL = "GraphQL" + QueryTypeGraphQL QueryType = "GraphQL" // QueryTypePackages is used when querying for NPM / Docker / etc packages - QueryTypePackages = "Packages" + QueryTypePackages QueryType = "Packages" // QueryTypeMilestones is used when querying for milestones in a repository - QueryTypeMilestones = "Milestones" + QueryTypeMilestones QueryType = "Milestones" // QueryTypeVulnerabilities is used when querying a vulnerability for a repository - QueryTypeVulnerabilities = "Vulnerabilities" + QueryTypeVulnerabilities QueryType = "Vulnerabilities" // QueryTypeProjects is used when querying projects for an organization - QueryTypeProjects = "Projects" + QueryTypeProjects QueryType = "Projects" // QueryTypeProjectItems is used when querying projects for an organization - QueryTypeProjectItems = "ProjectItems" + QueryTypeProjectItems QueryType = "ProjectItems" // QueryTypeStargazers is used when querying stargazers for a repository - QueryTypeStargazers = "Stargazers" + QueryTypeStargazers QueryType = "Stargazers" // QueryTypeWorkflows is used when querying workflows for an organization - QueryTypeWorkflows = "Workflows" + QueryTypeWorkflows QueryType = "Workflows" // QueryTypeWorkflowUsage is used when querying a specific workflow usage - QueryTypeWorkflowUsage = "Workflow_Usage" + QueryTypeWorkflowUsage QueryType = "Workflow_Usage" // QueryTypeWorkflowRuns is used when querying workflow runs for a repository - QueryTypeWorkflowRuns = "Workflow_Runs" + QueryTypeWorkflowRuns QueryType = "Workflow_Runs" // QueryTypeCodeScanning is used when querying code scanning alerts for a repository - QueryTypeCodeScanning = "Code_Scanning" + QueryTypeCodeScanning QueryType = "Code_Scanning" // QueryTypeDeployments is used when querying deployments for a repository - QueryTypeDeployments = "Deployments" + QueryTypeDeployments QueryType = "Deployments" // QueryTypeCommitFiles is used when querying files changed in a specific commit - QueryTypeCommitFiles = "Commit_Files" + QueryTypeCommitFiles QueryType = "Commit_Files" // QueryTypePullRequestFiles is used when querying files changed in a specific pull request - QueryTypePullRequestFiles = "Pull_Request_Files" + QueryTypePullRequestFiles QueryType = "Pull_Request_Files" ) // Query refers to the structure of a query built using the QueryEditor. diff --git a/pkg/models/query_test.go b/pkg/models/query_test.go new file mode 100644 index 00000000..2d95c136 --- /dev/null +++ b/pkg/models/query_test.go @@ -0,0 +1,316 @@ +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{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeCommits), + GoType: reflect.TypeFor[*CommitsQuery](), + Examples: []data.QueryExample{ + { + Name: "CommitsQuery", + SaveModel: data.AsUnstructured(CommitsQuery{ + Query: common, + Options: ListCommitsOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeTags), + GoType: reflect.TypeFor[*TagsQuery](), + Examples: []data.QueryExample{ + { + Name: "TagsQuery", + SaveModel: data.AsUnstructured(TagsQuery{ + Query: common, + Options: ListTagsOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeLabels), + GoType: reflect.TypeFor[*LabelsQuery](), + Examples: []data.QueryExample{ + { + Name: "LabelsQuery", + SaveModel: data.AsUnstructured(LabelsQuery{ + Query: common, + Options: ListLabelsOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeReleases), + GoType: reflect.TypeFor[*ReleasesQuery](), + Examples: []data.QueryExample{ + { + Name: "ReleasesQuery", + SaveModel: data.AsUnstructured(ReleasesQuery{ + Query: common, + Options: ListReleasesOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeContributors), + GoType: reflect.TypeFor[*ContributorsQuery](), + Examples: []data.QueryExample{ + { + Name: "ContributorsQuery", + SaveModel: data.AsUnstructured(ContributorsQuery{ + Query: common, + Options: ListContributorsOptions{Owner: "yesoreyeram"}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeRepositories), + GoType: reflect.TypeFor[*RepositoriesQuery](), + Examples: []data.QueryExample{ + { + Name: "RepositoriesQuery", + SaveModel: data.AsUnstructured(RepositoriesQuery{ + Query: Query{ + Owner: "yesoreyeram", + }, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + 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, + }, + }, + }, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + 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, + }, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeMilestones), + GoType: reflect.TypeFor[*MilestonesQuery](), + Examples: []data.QueryExample{ + { + Name: "MilestonesQuery", + SaveModel: data.AsUnstructured(MilestonesQuery{ + Query: common, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeVulnerabilities), + GoType: reflect.TypeFor[*VulnerabilityQuery](), + Examples: []data.QueryExample{ + { + Name: "VulnerabilityQuery", + SaveModel: data.AsUnstructured(VulnerabilityQuery{ + Query: common, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeStargazers), + GoType: reflect.TypeFor[*StargazersQuery](), + Examples: []data.QueryExample{ + { + Name: "StargazersQuery", + SaveModel: data.AsUnstructured(StargazersQuery{ + Query: common, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeWorkflows), + GoType: reflect.TypeFor[*WorkflowsQuery](), + Examples: []data.QueryExample{ + { + Name: "WorkflowsQuery", + SaveModel: data.AsUnstructured(WorkflowsQuery{ + Query: common, + Options: ListWorkflowsOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeWorkflowUsage), + GoType: reflect.TypeFor[*WorkflowUsageQuery](), + Examples: []data.QueryExample{ + { + Name: "WorkflowUsageQuery", + SaveModel: data.AsUnstructured(WorkflowUsageQuery{ + Query: common, + Options: WorkflowUsageOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeCodeScanning), + GoType: reflect.TypeFor[*CodeScanningQuery](), + Examples: []data.QueryExample{ + { + Name: "CodeScanningQuery", + SaveModel: data.AsUnstructured(CodeScanningQuery{ + Query: common, + Options: CodeScanningOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeCommitFiles), + GoType: reflect.TypeFor[*CommitFilesQuery](), + Examples: []data.QueryExample{ + { + Name: "CommitFilesQuery", + SaveModel: data.AsUnstructured(CommitFilesQuery{ + Query: common, + Options: CommitFilesOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypePullRequestReviews), + GoType: reflect.TypeFor[*PullRequestReviewsQuery](), + Examples: []data.QueryExample{ + { + Name: "PullRequestReviewsQuery", + SaveModel: data.AsUnstructured(PullRequestReviewsQuery{ + Query: common, + Options: ListPullRequestsOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypePullRequestFiles), + GoType: reflect.TypeFor[*PullRequestFilesQuery](), + Examples: []data.QueryExample{ + { + Name: "PullRequestFilesQuery", + SaveModel: data.AsUnstructured(PullRequestFilesQuery{ + Query: common, + Options: PullRequestFilesOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + Discriminators: data.NewDiscriminators("queryType", QueryTypeWorkflowRuns), + GoType: reflect.TypeFor[*WorkflowRunsQuery](), + Examples: []data.QueryExample{ + { + Name: "WorkflowRunsQuery", + SaveModel: data.AsUnstructured(WorkflowRunsQuery{ + Query: common, + Options: WorkflowRunsOptions{}, + }), + }, + }, + }, schemabuilder.QueryTypeInfo{ + 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.UpdateQueryDefinition(t, "../../src/static/schema/") +} diff --git a/src/static/schema/query.panel.example.json b/src/static/schema/query.panel.example.json new file mode 100644 index 00000000..af64bb64 --- /dev/null +++ b/src/static/schema/query.panel.example.json @@ -0,0 +1,300 @@ +{ + "type": "table", + "targets": [ + { + "refId": "A", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Pull_Requests", + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "B", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Commits", + "options": { + "gitRef": "", + "includeFiles": false, + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "C", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Tags", + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "D", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Labels", + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "E", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Releases", + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "F", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Contributors", + "options": { + "owner": "yesoreyeram", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "G", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Repositories", + "owner": "yesoreyeram", + "repository": "" + }, + { + "refId": "H", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Issues", + "options": { + "filters": { + "states": [ + "OPEN" + ] + }, + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "I", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Packages", + "options": { + "names": "", + "owner": "", + "packageType": "DOCKER", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "J", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Milestones", + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "K", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Vulnerabilities", + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "L", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Stargazers", + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "M", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Workflows", + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "N", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Workflow_Usage", + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "O", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Code_Scanning", + "options": { + "gitRef": "", + "owner": "", + "repository": "", + "state": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "P", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Commit_Files", + "options": { + "commitSha": "", + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "Q", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Pull_Request_Reviews", + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "R", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Pull_Request_Files", + "options": { + "owner": "", + "prNumber": 0, + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "S", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Workflow_Runs", + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "T", + "datasource": { + "type": "grafana-github-datasource", + "uid": "TheUID" + }, + "queryType": "Deployments", + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + ] +} \ No newline at end of file diff --git a/src/static/schema/query.panel.schema.json b/src/static/schema/query.panel.schema.json new file mode 100644 index 00000000..9e17ba47 --- /dev/null +++ b/src/static/schema/query.panel.schema.json @@ -0,0 +1,2853 @@ +{ + "type": "object", + "required": [ + "targets", + "type" + ], + "properties": { + "targets": { + "type": "array", + "items": { + "type": "object", + "oneOf": [ + { + "description": "PullRequestsQuery is used when querying for GitHub Pull Requests", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "timeField" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Pull_Requests$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "CommitsQuery is used when querying for GitHub commits", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "gitRef", + "includeFiles" + ], + "properties": { + "gitRef": { + "type": "string" + }, + "includeFiles": { + "type": "boolean" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Commits$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "TagsQuery is used when querying for GitHub tags", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Tags$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "LabelsQuery is used when querying for GitHub issue labels", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "query" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Labels$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "ReleasesQuery is used when querying for GitHub issue labels", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Releases$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "ContributorsQuery is used when querying for GitHub contributors", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Contributors$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "RepositoriesQuery is used when querying for GitHub repositories", + "type": "object", + "required": [ + "repository", + "owner", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Repositories$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "IssuesQuery is used when querying for GitHub issues", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "filters", + "timeField" + ], + "properties": { + "filters": { + "type": "object", + "properties": { + "assignee": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "mentioned": { + "type": "string" + }, + "milestone": { + "type": "string" + }, + "milestoneNumber": { + "type": "string" + }, + "since": { + "type": "object", + "additionalProperties": false + }, + "states": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + }, + "viewerSubscribed": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "query": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "timeField": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Issues$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "PackagesQuery is used when querying for GitHub packages, including NPM, Maven, PyPi, Rubygems, and Docker", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "names", + "packageType" + ], + "properties": { + "names": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "packageType": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Packages$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "MilestonesQuery is used when querying for GitHub milestones", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "query" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Milestones$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "VulnerabilityQuery is used when querying for GitHub Repository Vulnerabilities", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Vulnerabilities$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "StargazersQuery is used when querying stargazers for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Stargazers$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "WorkflowsQuery is used when querying workflows for an organization", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "timeField" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Workflows$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "WorkflowUsageQuery is used when querying a workflow usage", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "workflow", + "branch" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Workflow_Usage$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "CodeScanningQuery is used when querying code scanning alerts for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "state", + "gitRef" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Code_Scanning$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "CommitFilesQuery is used when querying for files changed in a GitHub commit", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "commitSha" + ], + "properties": { + "commitSha": { + "description": "Ref is the commit SHA to retrieve changed files for", + "type": "string" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Commit_Files$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "PullRequestReviewsQuery is used when querying for GitHub Pull Request Reviews", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "timeField" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Pull_Request_Reviews$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "PullRequestFilesQuery is used when querying for files changed in a GitHub pull request", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "prNumber" + ], + "properties": { + "owner": { + "type": "string" + }, + "prNumber": { + "description": "PRNumber is the pull request number", + "type": "integer" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Pull_Request_Files$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "WorkflowRunsQuery is used when querying workflow runs for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "workflow", + "branch" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Workflow_Runs$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "DeploymentsQuery is used when querying deployments for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Deployments$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + } + ], + "$schema": "https://json-schema.org/draft-04/schema#" + } + }, + "type": { + "description": "the panel type", + "type": "string" + } + }, + "additionalProperties": true, + "$schema": "https://json-schema.org/draft-04/schema#" +} \ No newline at end of file diff --git a/src/static/schema/query.request.example.json b/src/static/schema/query.request.example.json new file mode 100644 index 00000000..cd3a60ec --- /dev/null +++ b/src/static/schema/query.request.example.json @@ -0,0 +1,261 @@ +{ + "from": "now-1h", + "to": "now", + "queries": [ + { + "refId": "A", + "queryType": "Pull_Requests", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "B", + "queryType": "Commits", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "gitRef": "", + "includeFiles": false, + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "C", + "queryType": "Tags", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "D", + "queryType": "Labels", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "E", + "queryType": "Releases", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "F", + "queryType": "Contributors", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "yesoreyeram", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "G", + "queryType": "Repositories", + "maxDataPoints": 1000, + "intervalMs": 5, + "owner": "yesoreyeram", + "repository": "" + }, + { + "refId": "H", + "queryType": "Issues", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "filters": { + "states": [ + "OPEN" + ] + }, + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "I", + "queryType": "Packages", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "names": "", + "owner": "", + "packageType": "DOCKER", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "J", + "queryType": "Milestones", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "K", + "queryType": "Vulnerabilities", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "L", + "queryType": "Stargazers", + "maxDataPoints": 1000, + "intervalMs": 5, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "M", + "queryType": "Workflows", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "N", + "queryType": "Workflow_Usage", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "O", + "queryType": "Code_Scanning", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "gitRef": "", + "owner": "", + "repository": "", + "state": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "P", + "queryType": "Commit_Files", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "commitSha": "", + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "Q", + "queryType": "Pull_Request_Reviews", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "R", + "queryType": "Pull_Request_Files", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "prNumber": 0, + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "S", + "queryType": "Workflow_Runs", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + }, + { + "refId": "T", + "queryType": "Deployments", + "maxDataPoints": 1000, + "intervalMs": 5, + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + ] +} \ No newline at end of file diff --git a/src/static/schema/query.request.schema.json b/src/static/schema/query.request.schema.json new file mode 100644 index 00000000..7ca9de17 --- /dev/null +++ b/src/static/schema/query.request.schema.json @@ -0,0 +1,3023 @@ +{ + "type": "object", + "required": [ + "queries" + ], + "properties": { + "$schema": { + "description": "helper", + "type": "string" + }, + "debug": { + "type": "boolean" + }, + "from": { + "description": "From Start time in epoch timestamps in milliseconds or relative using Grafana time units.", + "type": "string" + }, + "queries": { + "type": "array", + "items": { + "type": "object", + "oneOf": [ + { + "description": "PullRequestsQuery is used when querying for GitHub Pull Requests", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "timeField" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Pull_Requests$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "CommitsQuery is used when querying for GitHub commits", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "gitRef", + "includeFiles" + ], + "properties": { + "gitRef": { + "type": "string" + }, + "includeFiles": { + "type": "boolean" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Commits$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "TagsQuery is used when querying for GitHub tags", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Tags$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "LabelsQuery is used when querying for GitHub issue labels", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "query" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Labels$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "ReleasesQuery is used when querying for GitHub issue labels", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Releases$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "ContributorsQuery is used when querying for GitHub contributors", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Contributors$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "RepositoriesQuery is used when querying for GitHub repositories", + "type": "object", + "required": [ + "repository", + "owner", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Repositories$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "IssuesQuery is used when querying for GitHub issues", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "filters", + "timeField" + ], + "properties": { + "filters": { + "type": "object", + "properties": { + "assignee": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "mentioned": { + "type": "string" + }, + "milestone": { + "type": "string" + }, + "milestoneNumber": { + "type": "string" + }, + "since": { + "type": "object", + "additionalProperties": false + }, + "states": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + }, + "viewerSubscribed": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "query": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "timeField": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Issues$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "PackagesQuery is used when querying for GitHub packages, including NPM, Maven, PyPi, Rubygems, and Docker", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "names", + "packageType" + ], + "properties": { + "names": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "packageType": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Packages$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "MilestonesQuery is used when querying for GitHub milestones", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "query" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Milestones$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "VulnerabilityQuery is used when querying for GitHub Repository Vulnerabilities", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Vulnerabilities$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "StargazersQuery is used when querying stargazers for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Stargazers$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "WorkflowsQuery is used when querying workflows for an organization", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "timeField" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Workflows$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "WorkflowUsageQuery is used when querying a workflow usage", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "workflow", + "branch" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Workflow_Usage$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "CodeScanningQuery is used when querying code scanning alerts for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "state", + "gitRef" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Code_Scanning$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "CommitFilesQuery is used when querying for files changed in a GitHub commit", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "commitSha" + ], + "properties": { + "commitSha": { + "description": "Ref is the commit SHA to retrieve changed files for", + "type": "string" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Commit_Files$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "PullRequestReviewsQuery is used when querying for GitHub Pull Request Reviews", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner", + "timeField" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Pull_Request_Reviews$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "PullRequestFilesQuery is used when querying for files changed in a GitHub pull request", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "prNumber" + ], + "properties": { + "owner": { + "type": "string" + }, + "prNumber": { + "description": "PRNumber is the pull request number", + "type": "integer" + }, + "repository": { + "type": "string" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Pull_Request_Files$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "WorkflowRunsQuery is used when querying workflow runs for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "owner", + "repository", + "workflow", + "branch" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Workflow_Runs$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + }, + { + "description": "DeploymentsQuery is used when querying deployments for a repository", + "type": "object", + "required": [ + "repository", + "owner", + "options", + "queryType", + "refId" + ], + "properties": { + "datasource": { + "description": "The datasource", + "type": "object", + "required": [ + "type" + ], + "properties": { + "apiVersion": { + "description": "The apiserver version", + "type": "string" + }, + "type": { + "description": "The datasource plugin type", + "type": "string", + "pattern": "^grafana-github-datasource$" + }, + "uid": { + "description": "Datasource UID (NOTE: name in k8s)", + "type": "string" + } + }, + "additionalProperties": false + }, + "hide": { + "description": "true if query is disabled (ie should not be returned to the dashboard)\nNOTE: this does not always imply that the query should not be executed since\nthe results from a hidden query may be used as the input to other queries (SSE etc)", + "type": "boolean" + }, + "intervalMs": { + "description": "Interval is the suggested duration between time points in a time series query.\nNOTE: the values for intervalMs is not saved in the query model. It is typically calculated\nfrom the interval required to fill a pixels in the visualization", + "type": "number" + }, + "maxDataPoints": { + "description": "MaxDataPoints is the maximum number of data points that should be returned from a time series query.\nNOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated\nfrom the number of pixels visible in a visualization", + "type": "integer" + }, + "options": { + "type": "object", + "required": [ + "repository", + "owner" + ], + "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" + } + }, + "additionalProperties": false + }, + "owner": { + "type": "string" + }, + "queryType": { + "type": "string", + "pattern": "^Deployments$" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string" + }, + "repository": { + "type": "string" + }, + "resultAssertions": { + "description": "Optionally define expected query result behavior", + "type": "object", + "required": [ + "typeVersion" + ], + "properties": { + "maxFrames": { + "description": "Maximum frame count", + "type": "integer" + }, + "type": { + "description": "Type asserts that the frame matches a known type structure.\n\n\nPossible enum values:\n - `\"\"` \n - `\"timeseries-wide\"` \n - `\"timeseries-long\"` \n - `\"timeseries-many\"` \n - `\"timeseries-multi\"` \n - `\"directory-listing\"` \n - `\"table\"` \n - `\"numeric-wide\"` \n - `\"numeric-multi\"` \n - `\"numeric-long\"` \n - `\"log-lines\"` ", + "type": "string", + "enum": [ + "", + "timeseries-wide", + "timeseries-long", + "timeseries-many", + "timeseries-multi", + "directory-listing", + "table", + "numeric-wide", + "numeric-multi", + "numeric-long", + "log-lines" + ], + "x-enum-description": {} + }, + "typeVersion": { + "description": "TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane\ncontract documentation https://grafana.github.io/dataplane/contract/.", + "type": "array", + "maxItems": 2, + "minItems": 2, + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "timeRange": { + "description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly", + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "description": "From is the start time of the query.", + "type": "string", + "default": "now-6h" + }, + "to": { + "description": "To is the end time of the query.", + "type": "string", + "default": "now" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema" + } + ], + "$schema": "https://json-schema.org/draft-04/schema#" + } + }, + "to": { + "description": "To end time in epoch timestamps in milliseconds or relative using Grafana time units.", + "type": "string" + } + }, + "additionalProperties": false, + "$schema": "https://json-schema.org/draft-04/schema#" +} \ No newline at end of file diff --git a/src/static/schema/query.types.json b/src/static/schema/query.types.json new file mode 100644 index 00000000..dbe4a26c --- /dev/null +++ b/src/static/schema/query.types.json @@ -0,0 +1,1433 @@ +{ + "kind": "QueryTypeDefinitionList", + "apiVersion": "datasource.grafana.app/v0alpha1", + "metadata": { + "resourceVersion": "1775589227943" + }, + "items": [ + { + "metadata": { + "name": "Pull_Requests", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "Simple", + "saveModel": { + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Commits", + "resourceVersion": "1775575194984", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "CommitsQuery", + "saveModel": { + "options": { + "gitRef": "", + "includeFiles": false, + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Tags", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "TagsQuery", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Labels", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "LabelsQuery", + "saveModel": { + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Releases", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "ReleasesQuery", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Contributors", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "ContributorsQuery", + "saveModel": { + "options": { + "owner": "yesoreyeram", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Repositories", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "RepositoriesQuery", + "saveModel": { + "owner": "yesoreyeram", + "repository": "" + } + } + ] + } + }, + { + "metadata": { + "name": "Issues", + "resourceVersion": "1775575194984", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "IssuesQuery", + "saveModel": { + "options": { + "filters": { + "states": [ + "OPEN" + ] + }, + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Packages", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "PackagesQuery", + "saveModel": { + "options": { + "names": "", + "owner": "", + "packageType": "DOCKER", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Milestones", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "MilestonesQuery", + "saveModel": { + "options": { + "owner": "", + "query": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Vulnerabilities", + "resourceVersion": "1775575194984", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "VulnerabilityQuery", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Stargazers", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "StargazersQuery", + "saveModel": { + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Workflows", + "resourceVersion": "1709529769877", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "WorkflowsQuery", + "saveModel": { + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Workflow_Usage", + "resourceVersion": "1775575194984", + "creationTimestamp": "2024-03-04T05:22:49Z" + }, + "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" + }, + "examples": [ + { + "name": "WorkflowUsageQuery", + "saveModel": { + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Code_Scanning", + "resourceVersion": "1775589227943", + "creationTimestamp": "2026-04-07T19:13:47Z" + }, + "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" + }, + "examples": [ + { + "name": "CodeScanningQuery", + "saveModel": { + "options": { + "gitRef": "", + "owner": "", + "repository": "", + "state": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Commit_Files", + "resourceVersion": "1775589227943", + "creationTimestamp": "2026-04-07T19:13:47Z" + }, + "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" + }, + "examples": [ + { + "name": "CommitFilesQuery", + "saveModel": { + "options": { + "commitSha": "", + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Pull_Request_Reviews", + "resourceVersion": "1775589227943", + "creationTimestamp": "2026-04-07T19:13:47Z" + }, + "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" + }, + "examples": [ + { + "name": "PullRequestReviewsQuery", + "saveModel": { + "options": { + "owner": "", + "repository": "", + "timeField": 0 + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Pull_Request_Files", + "resourceVersion": "1775589227943", + "creationTimestamp": "2026-04-07T19:13:47Z" + }, + "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" + }, + "examples": [ + { + "name": "PullRequestFilesQuery", + "saveModel": { + "options": { + "owner": "", + "prNumber": 0, + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Workflow_Runs", + "resourceVersion": "1775589227943", + "creationTimestamp": "2026-04-07T19:13:47Z" + }, + "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" + }, + "examples": [ + { + "name": "WorkflowRunsQuery", + "saveModel": { + "options": { + "branch": "", + "owner": "", + "repository": "", + "workflow": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + }, + { + "metadata": { + "name": "Deployments", + "resourceVersion": "1775589227943", + "creationTimestamp": "2026-04-07T19:13:47Z" + }, + "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" + }, + "examples": [ + { + "name": "DeploymentsQuery", + "saveModel": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "grafana", + "repository": "github-datasource" + } + } + ] + } + } + ] +} \ No newline at end of file