Skip to content

Commit 8ad7202

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c8f4ae7 of spec repo
1 parent 4e32b1a commit 8ad7202

File tree

10 files changed

+418
-22
lines changed

10 files changed

+418
-22
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 147 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26583,9 +26583,18 @@ components:
2658326583
Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
2658426584
example:
2658526585
- commit_sha: abc123def456
26586+
policy_id: ftm_policy.quarantine.failure_rate
26587+
policy_meta:
26588+
config:
26589+
failure_rate: 0.1
26590+
required_runs: 100
26591+
failure_rate: 0.25
26592+
total_runs: 200
2658626593
status: quarantined
2658726594
timestamp: 1704067200000
2658826595
- commit_sha: ""
26596+
policy_id: unknown
26597+
policy_meta:
2658926598
status: new
2659026599
timestamp: 1703980800000
2659126600
items:
@@ -26655,6 +26664,11 @@ components:
2665526664
description: The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
2665626665
example: abc123def456
2665726666
type: string
26667+
policy_id:
26668+
$ref: "#/components/schemas/FlakyTestHistoryPolicyId"
26669+
policy_meta:
26670+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMeta"
26671+
nullable: true
2665826672
status:
2665926673
description: The test status at this point in history.
2666026674
example: quarantined
@@ -26669,6 +26683,131 @@ components:
2666926683
- commit_sha
2667026684
- timestamp
2667126685
type: object
26686+
FlakyTestHistoryPolicyId:
26687+
description: The policy that triggered this status change.
26688+
enum:
26689+
- ftm_policy.manual
26690+
- ftm_policy.fixed
26691+
- ftm_policy.disable.failure_rate
26692+
- ftm_policy.disable.branch_flake
26693+
- ftm_policy.disable.days_active
26694+
- ftm_policy.quarantine.failure_rate
26695+
- ftm_policy.quarantine.branch_flake
26696+
- ftm_policy.quarantine.days_active
26697+
- unknown
26698+
example: ftm_policy.quarantine.failure_rate
26699+
nullable: false
26700+
type: string
26701+
x-enum-varnames:
26702+
- MANUAL
26703+
- FIXED
26704+
- DISABLE_FAILURE_RATE
26705+
- DISABLE_BRANCH_FLAKE
26706+
- DISABLE_DAYS_ACTIVE
26707+
- QUARANTINE_FAILURE_RATE
26708+
- QUARANTINE_BRANCH_FLAKE
26709+
- QUARANTINE_DAYS_ACTIVE
26710+
- UNKNOWN
26711+
FlakyTestHistoryPolicyMeta:
26712+
description: Metadata about the policy that triggered this status change.
26713+
properties:
26714+
branches:
26715+
description: Branches where the test was flaky at the time of the status change.
26716+
example: ["main", "develop"]
26717+
items:
26718+
type: string
26719+
nullable: true
26720+
type: array
26721+
config:
26722+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMetaConfig"
26723+
nullable: true
26724+
days_active:
26725+
description: The number of days the test has been active at the time of the status change.
26726+
example: 15
26727+
format: int32
26728+
maximum: 2147483647
26729+
nullable: true
26730+
type: integer
26731+
days_without_flake:
26732+
description: The number of days since the test last exhibited flakiness.
26733+
example: 30
26734+
format: int32
26735+
maximum: 2147483647
26736+
nullable: true
26737+
type: integer
26738+
failure_rate:
26739+
description: The failure rate of the test at the time of the status change.
26740+
example: 0.25
26741+
format: double
26742+
maximum: 1
26743+
minimum: 0
26744+
nullable: true
26745+
type: number
26746+
state:
26747+
description: The previous state of the test.
26748+
example: quarantined
26749+
nullable: true
26750+
type: string
26751+
total_runs:
26752+
description: The total number of test runs at the time of the status change.
26753+
example: 200
26754+
format: int32
26755+
maximum: 2147483647
26756+
nullable: true
26757+
type: integer
26758+
type: object
26759+
FlakyTestHistoryPolicyMetaConfig:
26760+
description: Configuration parameters of the policy that triggered this status change.
26761+
properties:
26762+
branches:
26763+
description: The branches considered by the policy.
26764+
example: ["main"]
26765+
items:
26766+
type: string
26767+
nullable: true
26768+
type: array
26769+
days_active:
26770+
description: The number of days a test must have been active for the policy to trigger.
26771+
example: 30
26772+
format: int32
26773+
maximum: 2147483647
26774+
nullable: true
26775+
type: integer
26776+
failure_rate:
26777+
description: The failure rate threshold for the policy to trigger.
26778+
example: 0.7
26779+
format: double
26780+
maximum: 1
26781+
minimum: 0
26782+
nullable: true
26783+
type: number
26784+
forget_branches:
26785+
description: Branches excluded from the policy evaluation.
26786+
example: ["release"]
26787+
items:
26788+
type: string
26789+
nullable: true
26790+
type: array
26791+
required_runs:
26792+
description: The minimum number of test runs required for the policy to trigger.
26793+
example: 100
26794+
format: int32
26795+
maximum: 2147483647
26796+
nullable: true
26797+
type: integer
26798+
state:
26799+
description: The target state the policy transitions the test from.
26800+
example: quarantined
26801+
nullable: true
26802+
type: string
26803+
test_services:
26804+
description: Test services excluded from the policy evaluation.
26805+
example: ["my-service"]
26806+
items:
26807+
type: string
26808+
nullable: true
26809+
type: array
26810+
type: object
2667226811
FlakyTestPipelineStats:
2667326812
description: CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.
2667426813
properties:
@@ -26748,6 +26887,14 @@ components:
2674826887
FlakyTestsSearchFilter:
2674926888
description: Search filter settings.
2675026889
properties:
26890+
include_history:
26891+
default: false
26892+
description: |-
26893+
Whether to include the status change history for each flaky test in the response.
26894+
When set to true, each test will include a `history` array with chronological status changes.
26895+
Defaults to false.
26896+
example: true
26897+
type: boolean
2675126898
query:
2675226899
default: "*"
2675326900
description: |-
@@ -26793,14 +26940,6 @@ components:
2679326940
properties:
2679426941
filter:
2679526942
$ref: "#/components/schemas/FlakyTestsSearchFilter"
26796-
include_history:
26797-
default: false
26798-
description: |-
26799-
Whether to include the status change history for each flaky test in the response.
26800-
When set to true, each test will include a `history` array with chronological status changes.
26801-
Defaults to false.
26802-
example: true
26803-
type: boolean
2680426943
page:
2680526944
$ref: "#/components/schemas/FlakyTestsSearchPageOptions"
2680626945
sort:

features/v2/test_optimization.feature

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Feature: Test Optimization
117117
Scenario: Search flaky tests returns "Bad Request" response
118118
Given operation "SearchFlakyTests" enabled
119119
And new "SearchFlakyTests" request
120-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
120+
And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
121121
When the request is sent
122122
Then the response status is 400 Bad Request
123123

@@ -133,7 +133,7 @@ Feature: Test Optimization
133133
Scenario: Search flaky tests returns "OK" response
134134
Given operation "SearchFlakyTests" enabled
135135
And new "SearchFlakyTests" request
136-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
136+
And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
137137
When the request is sent
138138
Then the response status is 200 OK
139139

@@ -149,19 +149,21 @@ Feature: Test Optimization
149149
Scenario: Search flaky tests returns "OK" response with history
150150
Given operation "SearchFlakyTests" enabled
151151
And new "SearchFlakyTests" request
152-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"limit": 10}, "sort": "fqn", "include_history": true}, "type": "search_flaky_tests_request"}}
152+
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\"", "include_history": true}, "page": {"limit": 10}, "sort": "fqn"}, "type": "search_flaky_tests_request"}}
153153
When the request is sent
154154
Then the response status is 200 OK
155155
And the response "data[0].attributes" has field "history"
156156
And the response "data[0].attributes.history[0]" has field "status"
157157
And the response "data[0].attributes.history[0]" has field "commit_sha"
158158
And the response "data[0].attributes.history[0]" has field "timestamp"
159+
And the response "data[0].attributes.history[0]" has field "policy_id"
160+
And the response "data[0].attributes.history[0]" has field "policy_meta"
159161

160162
@generated @skip @team:DataDog/ci-app-backend @with-pagination
161163
Scenario: Search flaky tests returns "OK" response with pagination
162164
Given operation "SearchFlakyTests" enabled
163165
And new "SearchFlakyTests" request
164-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
166+
And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
165167
When the request with pagination is sent
166168
Then the response status is 200 OK
167169

services/test_optimization/src/v2/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export { FlakyTest } from "./models/FlakyTest";
1414
export { FlakyTestAttributes } from "./models/FlakyTestAttributes";
1515
export { FlakyTestAttributesFlakyState } from "./models/FlakyTestAttributesFlakyState";
1616
export { FlakyTestHistory } from "./models/FlakyTestHistory";
17+
export { FlakyTestHistoryPolicyId } from "./models/FlakyTestHistoryPolicyId";
18+
export { FlakyTestHistoryPolicyMeta } from "./models/FlakyTestHistoryPolicyMeta";
19+
export { FlakyTestHistoryPolicyMetaConfig } from "./models/FlakyTestHistoryPolicyMetaConfig";
1720
export { FlakyTestPipelineStats } from "./models/FlakyTestPipelineStats";
1821
export { FlakyTestRunMetadata } from "./models/FlakyTestRunMetadata";
1922
export { FlakyTestsPagination } from "./models/FlakyTestsPagination";

services/test_optimization/src/v2/models/FlakyTestHistory.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { AttributeTypeMap } from "@datadog/datadog-api-client";
22

3+
import { FlakyTestHistoryPolicyId } from "./FlakyTestHistoryPolicyId";
4+
import { FlakyTestHistoryPolicyMeta } from "./FlakyTestHistoryPolicyMeta";
5+
36
/**
47
* A single history entry representing a status change for a flaky test.
58
*/
@@ -8,6 +11,14 @@ export class FlakyTestHistory {
811
* The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
912
*/
1013
"commitSha": string;
14+
/**
15+
* The policy that triggered this status change.
16+
*/
17+
"policyId"?: FlakyTestHistoryPolicyId;
18+
/**
19+
* Metadata about the policy that triggered this status change.
20+
*/
21+
"policyMeta"?: FlakyTestHistoryPolicyMeta;
1122
/**
1223
* The test status at this point in history.
1324
*/
@@ -36,6 +47,14 @@ export class FlakyTestHistory {
3647
type: "string",
3748
required: true,
3849
},
50+
policyId: {
51+
baseName: "policy_id",
52+
type: "FlakyTestHistoryPolicyId",
53+
},
54+
policyMeta: {
55+
baseName: "policy_meta",
56+
type: "FlakyTestHistoryPolicyMeta",
57+
},
3958
status: {
4059
baseName: "status",
4160
type: "string",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { UnparsedObject } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* The policy that triggered this status change.
5+
*/
6+
export type FlakyTestHistoryPolicyId =
7+
| typeof MANUAL
8+
| typeof FIXED
9+
| typeof DISABLE_FAILURE_RATE
10+
| typeof DISABLE_BRANCH_FLAKE
11+
| typeof DISABLE_DAYS_ACTIVE
12+
| typeof QUARANTINE_FAILURE_RATE
13+
| typeof QUARANTINE_BRANCH_FLAKE
14+
| typeof QUARANTINE_DAYS_ACTIVE
15+
| typeof UNKNOWN
16+
| UnparsedObject;
17+
export const MANUAL = "ftm_policy.manual";
18+
export const FIXED = "ftm_policy.fixed";
19+
export const DISABLE_FAILURE_RATE = "ftm_policy.disable.failure_rate";
20+
export const DISABLE_BRANCH_FLAKE = "ftm_policy.disable.branch_flake";
21+
export const DISABLE_DAYS_ACTIVE = "ftm_policy.disable.days_active";
22+
export const QUARANTINE_FAILURE_RATE = "ftm_policy.quarantine.failure_rate";
23+
export const QUARANTINE_BRANCH_FLAKE = "ftm_policy.quarantine.branch_flake";
24+
export const QUARANTINE_DAYS_ACTIVE = "ftm_policy.quarantine.days_active";
25+
export const UNKNOWN = "unknown";

0 commit comments

Comments
 (0)