Skip to content

Commit 6ee12bc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 7923551 of spec repo (#3428)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 6a0f7ed commit 6ee12bc

8 files changed

Lines changed: 191 additions & 4 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24023,6 +24023,22 @@ components:
2402324023
type: string
2402424024
flaky_state:
2402524025
$ref: '#/components/schemas/FlakyTestAttributesFlakyState'
24026+
history:
24027+
description: 'Chronological history of status changes for this flaky test,
24028+
ordered from most recent to oldest.
24029+
24030+
Includes state transitions like new -> quarantined -> fixed, along with
24031+
the associated commit SHA when available.'
24032+
example:
24033+
- commit_sha: abc123def456
24034+
status: quarantined
24035+
timestamp: 1704067200000
24036+
- commit_sha: ''
24037+
status: new
24038+
timestamp: 1703980800000
24039+
items:
24040+
$ref: '#/components/schemas/FlakyTestHistory'
24041+
type: array
2402624042
last_flaked_branch:
2402724043
description: The branch name where the test exhibited flakiness for the
2402824044
last time.
@@ -24107,6 +24123,29 @@ components:
2410724123
- FIXED
2410824124
- QUARANTINED
2410924125
- DISABLED
24126+
FlakyTestHistory:
24127+
description: A single history entry representing a status change for a flaky
24128+
test.
24129+
properties:
24130+
commit_sha:
24131+
description: The commit SHA associated with this status change. Will be
24132+
an empty string if the commit SHA is not available.
24133+
example: abc123def456
24134+
type: string
24135+
status:
24136+
description: The test status at this point in history.
24137+
example: quarantined
24138+
type: string
24139+
timestamp:
24140+
description: Unix timestamp in milliseconds when this status change occurred.
24141+
example: 1704067200000
24142+
format: int64
24143+
type: integer
24144+
required:
24145+
- status
24146+
- commit_sha
24147+
- timestamp
24148+
type: object
2411024149
FlakyTestPipelineStats:
2411124150
description: CI pipeline related statistics for the flaky test. This information
2411224151
is only available if test runs are associated with CI pipeline events from
@@ -24253,6 +24292,17 @@ components:
2425324292
properties:
2425424293
filter:
2425524294
$ref: '#/components/schemas/FlakyTestsSearchFilter'
24295+
include_history:
24296+
default: false
24297+
description: 'Whether to include the status change history for each flaky
24298+
test in the response.
24299+
24300+
When set to true, each test will include a `history` array with chronological
24301+
status changes.
24302+
24303+
Defaults to false.'
24304+
example: true
24305+
type: boolean
2425624306
page:
2425724307
$ref: '#/components/schemas/FlakyTestsSearchPageOptions'
2425824308
sort:
@@ -101085,8 +101135,33 @@ paths:
101085101135

101086101136
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
101087101137
post:
101088-
description: List endpoint returning flaky tests from Flaky Test Management.
101138+
description: 'List endpoint returning flaky tests from Flaky Test Management.
101089101139
Results are paginated.
101140+
101141+
101142+
The response includes comprehensive test information including:
101143+
101144+
- Test identification and metadata (module, suite, name)
101145+
101146+
- Flaky state and categorization
101147+
101148+
- First and last flake occurrences (timestamp, branch, commit SHA)
101149+
101150+
- Test execution statistics from the last 7 days (failure rate)
101151+
101152+
- Pipeline impact metrics (failed pipelines count, total lost time)
101153+
101154+
- Complete status change history (optional, ordered from most recent to oldest)
101155+
101156+
101157+
Set `include_history` to `true` in the request to receive the status change
101158+
history for each test.
101159+
101160+
History is disabled by default for better performance.
101161+
101162+
101163+
Results support filtering by various facets including service, environment,
101164+
repository, branch, and test state.'
101090101165
operationId: SearchFlakyTests
101091101166
requestBody:
101092101167
content:

features/v2/test_optimization.feature

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Feature: Test Optimization
1313
Scenario: Search flaky tests returns "Bad Request" response
1414
Given operation "SearchFlakyTests" enabled
1515
And new "SearchFlakyTests" request
16-
And body with value {"data": {"attributes": {"filter": {"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"}}
16+
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"}}
1717
When the request is sent
1818
Then the response status is 400 Bad Request
1919

@@ -29,7 +29,7 @@ Feature: Test Optimization
2929
Scenario: Search flaky tests returns "OK" response
3030
Given operation "SearchFlakyTests" enabled
3131
And new "SearchFlakyTests" request
32-
And body with value {"data": {"attributes": {"filter": {"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"}}
32+
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"}}
3333
When the request is sent
3434
Then the response status is 200 OK
3535

@@ -41,11 +41,23 @@ Feature: Test Optimization
4141
When the request with pagination is sent
4242
Then the response status is 200 OK
4343

44+
@skip @team:DataDog/ci-app-backend
45+
Scenario: Search flaky tests returns "OK" response with history
46+
Given operation "SearchFlakyTests" enabled
47+
And new "SearchFlakyTests" request
48+
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"}}
49+
When the request is sent
50+
Then the response status is 200 OK
51+
And the response "data[0].attributes" has field "history"
52+
And the response "data[0].attributes.history[0]" has field "status"
53+
And the response "data[0].attributes.history[0]" has field "commit_sha"
54+
And the response "data[0].attributes.history[0]" has field "timestamp"
55+
4456
@generated @skip @team:DataDog/ci-app-backend @with-pagination
4557
Scenario: Search flaky tests returns "OK" response with pagination
4658
Given operation "SearchFlakyTests" enabled
4759
And new "SearchFlakyTests" request
48-
And body with value {"data": {"attributes": {"filter": {"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"}}
60+
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"}}
4961
When the request with pagination is sent
5062
Then the response status is 200 OK
5163

services/test_optimization/src/v2/TestOptimizationApi.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,19 @@ export class TestOptimizationApi {
314314

315315
/**
316316
* List endpoint returning flaky tests from Flaky Test Management. Results are paginated.
317+
*
318+
* The response includes comprehensive test information including:
319+
* - Test identification and metadata (module, suite, name)
320+
* - Flaky state and categorization
321+
* - First and last flake occurrences (timestamp, branch, commit SHA)
322+
* - Test execution statistics from the last 7 days (failure rate)
323+
* - Pipeline impact metrics (failed pipelines count, total lost time)
324+
* - Complete status change history (optional, ordered from most recent to oldest)
325+
*
326+
* Set `include_history` to `true` in the request to receive the status change history for each test.
327+
* History is disabled by default for better performance.
328+
*
329+
* Results support filtering by various facets including service, environment, repository, branch, and test state.
317330
* @param param The request object
318331
*/
319332
public searchFlakyTests(

services/test_optimization/src/v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export { APIErrorResponse } from "./models/APIErrorResponse";
88
export { FlakyTest } from "./models/FlakyTest";
99
export { FlakyTestAttributes } from "./models/FlakyTestAttributes";
1010
export { FlakyTestAttributesFlakyState } from "./models/FlakyTestAttributesFlakyState";
11+
export { FlakyTestHistory } from "./models/FlakyTestHistory";
1112
export { FlakyTestPipelineStats } from "./models/FlakyTestPipelineStats";
1213
export { FlakyTestRunMetadata } from "./models/FlakyTestRunMetadata";
1314
export { FlakyTestsPagination } from "./models/FlakyTestsPagination";

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

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

33
import { FlakyTestAttributesFlakyState } from "./FlakyTestAttributesFlakyState";
4+
import { FlakyTestHistory } from "./FlakyTestHistory";
45
import { FlakyTestPipelineStats } from "./FlakyTestPipelineStats";
56
import { FlakyTestRunMetadata } from "./FlakyTestRunMetadata";
67
import { FlakyTestStats } from "./FlakyTestStats";
@@ -44,6 +45,11 @@ export class FlakyTestAttributes {
4445
* The current state of the flaky test.
4546
*/
4647
"flakyState"?: FlakyTestAttributesFlakyState;
48+
/**
49+
* Chronological history of status changes for this flaky test, ordered from most recent to oldest.
50+
* Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
51+
*/
52+
"history"?: Array<FlakyTestHistory>;
4753
/**
4854
* The branch name where the test exhibited flakiness for the last time.
4955
*/
@@ -140,6 +146,10 @@ export class FlakyTestAttributes {
140146
baseName: "flaky_state",
141147
type: "FlakyTestAttributesFlakyState",
142148
},
149+
history: {
150+
baseName: "history",
151+
type: "Array<FlakyTestHistory>",
152+
},
143153
lastFlakedBranch: {
144154
baseName: "last_flaked_branch",
145155
type: "string",
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* A single history entry representing a status change for a flaky test.
5+
*/
6+
export class FlakyTestHistory {
7+
/**
8+
* The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
9+
*/
10+
"commitSha": string;
11+
/**
12+
* The test status at this point in history.
13+
*/
14+
"status": string;
15+
/**
16+
* Unix timestamp in milliseconds when this status change occurred.
17+
*/
18+
"timestamp": number;
19+
/**
20+
* A container for additional, undeclared properties.
21+
* This is a holder for any undeclared properties as specified with
22+
* the 'additionalProperties' keyword in the OAS document.
23+
*/
24+
"additionalProperties"?: { [key: string]: any };
25+
/**
26+
* @ignore
27+
*/
28+
"_unparsed"?: boolean;
29+
30+
/**
31+
* @ignore
32+
*/
33+
static readonly attributeTypeMap: AttributeTypeMap = {
34+
commitSha: {
35+
baseName: "commit_sha",
36+
type: "string",
37+
required: true,
38+
},
39+
status: {
40+
baseName: "status",
41+
type: "string",
42+
required: true,
43+
},
44+
timestamp: {
45+
baseName: "timestamp",
46+
type: "number",
47+
required: true,
48+
format: "int64",
49+
},
50+
additionalProperties: {
51+
baseName: "additionalProperties",
52+
type: "{ [key: string]: any; }",
53+
},
54+
};
55+
56+
/**
57+
* @ignore
58+
*/
59+
static getAttributeTypeMap(): AttributeTypeMap {
60+
return FlakyTestHistory.attributeTypeMap;
61+
}
62+
63+
public constructor() {}
64+
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ export class FlakyTestsSearchRequestAttributes {
1212
* Search filter settings.
1313
*/
1414
"filter"?: FlakyTestsSearchFilter;
15+
/**
16+
* Whether to include the status change history for each flaky test in the response.
17+
* When set to true, each test will include a `history` array with chronological status changes.
18+
* Defaults to false.
19+
*/
20+
"includeHistory"?: boolean;
1521
/**
1622
* Pagination attributes for listing flaky tests.
1723
*/
@@ -39,6 +45,10 @@ export class FlakyTestsSearchRequestAttributes {
3945
baseName: "filter",
4046
type: "FlakyTestsSearchFilter",
4147
},
48+
includeHistory: {
49+
baseName: "include_history",
50+
type: "boolean",
51+
},
4252
page: {
4353
baseName: "page",
4454
type: "FlakyTestsSearchPageOptions",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ModelTypingInfo } from "@datadog/datadog-api-client";
33
import { APIErrorResponse } from "./APIErrorResponse";
44
import { FlakyTest } from "./FlakyTest";
55
import { FlakyTestAttributes } from "./FlakyTestAttributes";
6+
import { FlakyTestHistory } from "./FlakyTestHistory";
67
import { FlakyTestPipelineStats } from "./FlakyTestPipelineStats";
78
import { FlakyTestRunMetadata } from "./FlakyTestRunMetadata";
89
import { FlakyTestStats } from "./FlakyTestStats";
@@ -61,6 +62,7 @@ export const TypingInfo: ModelTypingInfo = {
6162
APIErrorResponse: APIErrorResponse,
6263
FlakyTest: FlakyTest,
6364
FlakyTestAttributes: FlakyTestAttributes,
65+
FlakyTestHistory: FlakyTestHistory,
6466
FlakyTestPipelineStats: FlakyTestPipelineStats,
6567
FlakyTestRunMetadata: FlakyTestRunMetadata,
6668
FlakyTestStats: FlakyTestStats,

0 commit comments

Comments
 (0)