From 77aa7701640851530c1385b143d14bc4b66d849d Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 20 Feb 2024 11:27:15 -0500 Subject: [PATCH] fix contributor query --- pkg/models/schema_test.go | 2 +- src/static/schema/query.types.json | 140 +++++++++++++++++++++++++++-- 2 files changed, 136 insertions(+), 6 deletions(-) diff --git a/pkg/models/schema_test.go b/pkg/models/schema_test.go index 0122a2d2..21efce6f 100644 --- a/pkg/models/schema_test.go +++ b/pkg/models/schema_test.go @@ -78,7 +78,7 @@ func TestSchemaDefinitions(t *testing.T) { }, }, }, schema.QueryTypeInfo{ - Discriminators: schema.NewDiscriminators("queryType", QueryTypeReleases), + Discriminators: schema.NewDiscriminators("queryType", QueryTypeContributors), GoType: reflect.TypeOf(&ContributorsQuery{}), Examples: []schema.QueryExample{ { diff --git a/src/static/schema/query.types.json b/src/static/schema/query.types.json index 22debf78..e4656dc1 100644 --- a/src/static/schema/query.types.json +++ b/src/static/schema/query.types.json @@ -2,7 +2,7 @@ "kind": "QueryTypeDefinitionList", "apiVersion": "query.grafana.app/v0alpha1", "metadata": { - "resourceVersion": "1708445934187" + "resourceVersion": "1708446413913" }, "items": [ { @@ -974,6 +974,136 @@ "resourceVersion": "1708445934187", "creationTimestamp": "2024-02-20T16:18:03Z" }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Releases" + } + ], + "querySchema": { + "$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", + "queryPayload": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "owner", + "repository": "repo" + } + } + ] + } + }, + { + "metadata": { + "name": "Releases", + "resourceVersion": "1708446330765", + "creationTimestamp": "2024-02-20T16:18:54Z" + }, + "spec": { + "discriminators": [ + { + "field": "queryType", + "value": "Releases" + } + ], + "querySchema": { + "$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", + "queryPayload": { + "options": { + "owner": "", + "repository": "" + }, + "owner": "owner", + "repository": "repo" + } + } + ] + } + }, + { + "metadata": { + "name": "Releases", + "resourceVersion": "1708446413913", + "creationTimestamp": "2024-02-20T16:25:30Z" + }, "spec": { "discriminators": [ { @@ -1035,15 +1165,15 @@ }, { "metadata": { - "name": "Releases", - "resourceVersion": "1708445934187", - "creationTimestamp": "2024-02-20T16:18:54Z" + "name": "Contributors", + "resourceVersion": "1708446413913", + "creationTimestamp": "2024-02-20T16:26:53Z" }, "spec": { "discriminators": [ { "field": "queryType", - "value": "Releases" + "value": "Contributors" } ], "querySchema": {