Skip to content

Commit

Permalink
fix contributor query
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantxu committed Feb 20, 2024
1 parent a8b2c50 commit 77aa770
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/models/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down
140 changes: 135 additions & 5 deletions src/static/schema/query.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"kind": "QueryTypeDefinitionList",
"apiVersion": "query.grafana.app/v0alpha1",
"metadata": {
"resourceVersion": "1708445934187"
"resourceVersion": "1708446413913"
},
"items": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 77aa770

Please sign in to comment.