Skip to content

Commit

Permalink
gen_types
Browse files Browse the repository at this point in the history
  • Loading branch information
epompeii committed Jul 8, 2024
1 parent 6645f37 commit 457ecd2
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 107 deletions.
3 changes: 2 additions & 1 deletion lib/bencher_json/src/project/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ pub struct JsonReportQueryParams {
pub start_time: Option<DateTimeMillis>,
/// Filter for reports before the given date time in milliseconds.
pub end_time: Option<DateTimeMillis>,
/// Only return reports with an archived branch or testbed.
/// If set to `true`, only return reports with an archived branch or testbed.
/// If not set or set to `false`, only returns reports with non-archived branches and testbeds.
pub archived: Option<bool>,
}

Expand Down
3 changes: 2 additions & 1 deletion lib/bencher_json/src/project/threshold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ pub struct JsonThresholdQueryParams {
pub testbed: Option<String>,
/// Filter by measure name, exact match.
pub measure: Option<String>,
/// Only return thresholds with an archived branch, testbed, or measure.
/// If set to `true`, only return thresholds with an archived branch, testbed, or measure.
/// If not set or set to `false`, only returns thresholds with non-archived branches, testbeds, and measures.
pub archived: Option<bool>,
}

Expand Down
233 changes: 138 additions & 95 deletions services/api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2496,6 +2496,24 @@
"schema": {
"$ref": "#/components/schemas/ProjAlertsSort"
}
},
{
"in": "query",
"name": "active",
"description": "If set to `true`, only returns active alerts. If set to `false`, only returns non-active alerts. If not set, returns all alerts.",
"schema": {
"nullable": true,
"type": "boolean"
}
},
{
"in": "query",
"name": "archived",
"description": "If set to `true`, only returns archived alerts. If not set or set to `false`, only returns alerts with non-archived branches, testbeds, or measures.",
"schema": {
"nullable": true,
"type": "boolean"
}
}
],
"responses": {
Expand Down Expand Up @@ -2876,6 +2894,15 @@
"$ref": "#/components/schemas/ProjBenchmarksSort"
}
},
{
"in": "query",
"name": "archived",
"description": "If set to `true`, only returns archived benchmarks. If not set or set to `false`, only returns non-archived benchmarks.",
"schema": {
"nullable": true,
"type": "boolean"
}
},
{
"in": "query",
"name": "name",
Expand Down Expand Up @@ -3349,6 +3376,15 @@
"$ref": "#/components/schemas/ProjBranchesSort"
}
},
{
"in": "query",
"name": "archived",
"description": "If set to `true`, only returns archived branches, if set to `true`. If not set or set to `false`, only returns non-archived branches.",
"schema": {
"nullable": true,
"type": "boolean"
}
},
{
"in": "query",
"name": "name",
Expand Down Expand Up @@ -3822,6 +3858,15 @@
"$ref": "#/components/schemas/ProjMeasuresSort"
}
},
{
"in": "query",
"name": "archived",
"description": "If set to `true`, only returns archived measures if set to `true`. If not set or set to `false`, only returns non-archived measures.",
"schema": {
"nullable": true,
"type": "boolean"
}
},
{
"in": "query",
"name": "name",
Expand Down Expand Up @@ -5076,6 +5121,15 @@
"$ref": "#/components/schemas/ProjReportsSort"
}
},
{
"in": "query",
"name": "archived",
"description": "If set to `true`, only return reports with an archived branch or testbed. If not set or set to `false`, only returns reports with non-archived branches and testbeds.",
"schema": {
"nullable": true,
"type": "boolean"
}
},
{
"in": "query",
"name": "branch",
Expand Down Expand Up @@ -5416,83 +5470,6 @@
}
}
},
"/v0/projects/{project}/stats/alerts": {
"get": {
"tags": [
"projects",
"alerts"
],
"summary": "View the total number of active alerts for a project",
"description": "View the total number of active alerts for a project. If the project is public, then the user does not need to be authenticated. If the project is private, then the user must be authenticated and have `view` permissions for the project. Use this endpoint to monitor the number of active alerts for a project.",
"operationId": "proj_alert_stats_get",
"parameters": [
{
"in": "path",
"name": "project",
"description": "The slug or UUID for a project.",
"required": true,
"schema": {
"$ref": "#/components/schemas/ResourceId"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"headers": {
"access-control-allow-headers": {
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"access-control-allow-methods": {
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"access-control-allow-origin": {
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"access-control-expose-headers": {
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"x-total-count": {
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/JsonAlertStats"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v0/projects/{project}/testbeds": {
"get": {
"tags": [
Expand Down Expand Up @@ -5550,6 +5527,15 @@
"$ref": "#/components/schemas/ProjTestbedsSort"
}
},
{
"in": "query",
"name": "archived",
"description": "If set to `true`, only returns archived testbeds. If not set or set to `false`, only returns non-archived testbeds.",
"schema": {
"nullable": true,
"type": "boolean"
}
},
{
"in": "query",
"name": "name",
Expand Down Expand Up @@ -6023,6 +6009,15 @@
"$ref": "#/components/schemas/ProjThresholdsSort"
}
},
{
"in": "query",
"name": "archived",
"description": "If set to `true`, only return thresholds with an archived branch, testbed, or measure. If not set or set to `false`, only returns thresholds with non-archived branches, testbeds, and measures.",
"schema": {
"nullable": true,
"type": "boolean"
}
},
{
"in": "query",
"name": "branch",
Expand Down Expand Up @@ -8062,17 +8057,6 @@
"uuid"
]
},
"JsonAlertStats": {
"type": "object",
"properties": {
"active": {
"$ref": "#/components/schemas/BigInt"
}
},
"required": [
"active"
]
},
"JsonAlerts": {
"type": "array",
"items": {
Expand Down Expand Up @@ -8177,6 +8161,14 @@
"JsonBenchmark": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
}
]
},
"created": {
"$ref": "#/components/schemas/DateTime"
},
Expand Down Expand Up @@ -8208,6 +8200,14 @@
"JsonBenchmarkMetric": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
}
]
},
"boundary": {
"nullable": true,
"allOf": [
Expand Down Expand Up @@ -8311,6 +8311,14 @@
"JsonBranch": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
}
]
},
"created": {
"$ref": "#/components/schemas/DateTime"
},
Expand Down Expand Up @@ -8350,6 +8358,14 @@
"JsonBranchVersion": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
}
]
},
"created": {
"$ref": "#/components/schemas/DateTime"
},
Expand Down Expand Up @@ -8797,6 +8813,14 @@
"JsonMeasure": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
}
]
},
"created": {
"$ref": "#/components/schemas/DateTime"
},
Expand Down Expand Up @@ -11052,6 +11076,14 @@
"JsonTestbed": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
}
]
},
"created": {
"$ref": "#/components/schemas/DateTime"
},
Expand Down Expand Up @@ -11336,6 +11368,11 @@
"JsonUpdateBenchmark": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"description": "Set whether the benchmark is archived.",
"type": "boolean"
},
"name": {
"nullable": true,
"description": "The new name of the benchmark. Maximum length is 1,024 characters.",
Expand All @@ -11359,14 +11396,10 @@
"JsonUpdateBranch": {
"type": "object",
"properties": {
"hash": {
"archived": {
"nullable": true,
"description": "The full `git` commit hash for the next version of the branch. This is useful in cases where there may be a race condition when a start point branch has been updated but its benchmarks have not yet finished.",
"allOf": [
{
"$ref": "#/components/schemas/GitHash"
}
]
"description": "Set whether the branch is archived.",
"type": "boolean"
},
"name": {
"nullable": true,
Expand Down Expand Up @@ -11408,6 +11441,11 @@
"JsonUpdateMeasure": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"description": "Set whether the measure is archived.",
"type": "boolean"
},
"name": {
"nullable": true,
"description": "The new name of the measure. Maximum length is 64 characters.",
Expand Down Expand Up @@ -11484,6 +11522,11 @@
"JsonUpdateTestbed": {
"type": "object",
"properties": {
"archived": {
"nullable": true,
"description": "Set whether the testbed is archived.",
"type": "boolean"
},
"name": {
"nullable": true,
"description": "The new name of the testbed. Maximum length is 64 characters.",
Expand Down
Loading

0 comments on commit 457ecd2

Please sign in to comment.