Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 53 additions & 33 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25834,6 +25834,14 @@ components:
FlakyTestsSearchFilter:
description: Search filter settings.
properties:
include_history:
default: false
description: |-
Whether to include the status change history for each flaky test in the response.
When set to true, each test will include a 'history' array with chronological status changes.
Defaults to false.
example: true
type: boolean
query:
default: "*"
description: |-
Expand Down Expand Up @@ -25879,14 +25887,6 @@ components:
properties:
filter:
$ref: "#/components/schemas/FlakyTestsSearchFilter"
include_history:
default: false
description: |-
Whether to include the status change history for each flaky test in the response.
When set to true, each test will include a `history` array with chronological status changes.
Defaults to false.
example: true
type: boolean
page:
$ref: "#/components/schemas/FlakyTestsSearchPageOptions"
sort:
Expand Down Expand Up @@ -57944,7 +57944,6 @@ components:
- none
- false_positive
- testing_or_maintenance
- remediated
- investigated_case_opened
- true_positive_benign
- true_positive_malicious
Expand All @@ -57954,7 +57953,6 @@ components:
- NONE
- FALSE_POSITIVE
- TESTING_OR_MAINTENANCE
- REMEDIATED
- INVESTIGATED_CASE_OPENED
- TRUE_POSITIVE_BENIGN
- TRUE_POSITIVE_MALICIOUS
Expand Down Expand Up @@ -103307,8 +103305,6 @@ paths:
schema:
$ref: "#/components/schemas/SecurityMonitoringSignalResponse"
description: OK
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"429":
Expand Down Expand Up @@ -103346,17 +103342,25 @@ paths:
$ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Bad Request
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Forbidden
"404":
$ref: "#/components/responses/NotFoundResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Modify the triage assignee of a security signal
tags: ["Security Monitoring"]
x-codegen-request-body-name: body
Expand Down Expand Up @@ -103386,17 +103390,25 @@ paths:
$ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Bad Request
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Forbidden
"404":
$ref: "#/components/responses/NotFoundResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Change the related incidents of a security signal
tags: ["Security Monitoring"]
x-codegen-request-body-name: body
Expand Down Expand Up @@ -103426,17 +103438,25 @@ paths:
$ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Bad Request
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Forbidden
"404":
$ref: "#/components/responses/NotFoundResponse"
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Change the triage state of a security signal
tags: ["Security Monitoring"]
x-codegen-request-body-name: body
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/test-optimization/SearchFlakyTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const params: v2.TestOptimizationApiSearchFlakyTestsRequest = {
data: {
attributes: {
filter: {
includeHistory: true,
query: `flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"`,
},
includeHistory: true,
page: {
cursor:
"eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const params: v2.TestOptimizationApiSearchFlakyTestsRequest = {
data: {
attributes: {
filter: {
includeHistory: true,
query: `flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"`,
},
includeHistory: true,
page: {
cursor:
"eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const params: v2.TestOptimizationApiSearchFlakyTestsRequest = {
attributes: {
filter: {
query: `flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"`,
includeHistory: true,
},
page: {
limit: 10,
},
sort: "fqn",
includeHistory: true,
},
type: "search_flaky_tests_request",
},
Expand Down
8 changes: 4 additions & 4 deletions features/v2/test_optimization.feature
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Feature: Test Optimization
Scenario: Search flaky tests returns "Bad Request" response
Given operation "SearchFlakyTests" enabled
And new "SearchFlakyTests" request
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"}}
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"}}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -101,7 +101,7 @@ Feature: Test Optimization
Scenario: Search flaky tests returns "OK" response
Given operation "SearchFlakyTests" enabled
And new "SearchFlakyTests" request
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"}}
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"}}
When the request is sent
Then the response status is 200 OK

Expand All @@ -117,7 +117,7 @@ Feature: Test Optimization
Scenario: Search flaky tests returns "OK" response with history
Given operation "SearchFlakyTests" enabled
And new "SearchFlakyTests" request
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"}}
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"}}
When the request is sent
Then the response status is 200 OK
And the response "data[0].attributes" has field "history"
Expand All @@ -129,7 +129,7 @@ Feature: Test Optimization
Scenario: Search flaky tests returns "OK" response with pagination
Given operation "SearchFlakyTests" enabled
And new "SearchFlakyTests" request
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"}}
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"}}
When the request with pagination is sent
Then the response status is 200 OK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,6 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
applySecurityAuthentication(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);

return requestContext;
Expand Down Expand Up @@ -1364,7 +1363,6 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
applySecurityAuthentication(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);

return requestContext;
Expand Down Expand Up @@ -1420,7 +1418,6 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
applySecurityAuthentication(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
"AuthZ",
]);

return requestContext;
Expand Down Expand Up @@ -7372,11 +7369,7 @@ export class SecurityMonitoringApiResponseProcessor {
) as SecurityMonitoringSignalResponse;
return body;
}
if (
response.httpStatusCode === 403 ||
response.httpStatusCode === 404 ||
response.httpStatusCode === 429
) {
if (response.httpStatusCode === 404 || response.httpStatusCode === 429) {
const bodyText = ObjectSerializer.parse(
await response.body.text(),
contentType
Expand Down
10 changes: 10 additions & 0 deletions packages/datadog-api-client-v2/models/FlakyTestsSearchFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
* Search filter settings.
*/
export class FlakyTestsSearchFilter {
/**
* Whether to include the status change history for each flaky test in the response.
* When set to true, each test will include a 'history' array with chronological status changes.
* Defaults to false.
*/
"includeHistory"?: boolean;
/**
* Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:
* - `flaky_test_state`
Expand Down Expand Up @@ -41,6 +47,10 @@ export class FlakyTestsSearchFilter {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
includeHistory: {
baseName: "include_history",
type: "boolean",
},
query: {
baseName: "query",
type: "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ export class FlakyTestsSearchRequestAttributes {
* Search filter settings.
*/
"filter"?: FlakyTestsSearchFilter;
/**
* Whether to include the status change history for each flaky test in the response.
* When set to true, each test will include a `history` array with chronological status changes.
* Defaults to false.
*/
"includeHistory"?: boolean;
/**
* Pagination attributes for listing flaky tests.
*/
Expand Down Expand Up @@ -52,10 +46,6 @@ export class FlakyTestsSearchRequestAttributes {
baseName: "filter",
type: "FlakyTestsSearchFilter",
},
includeHistory: {
baseName: "include_history",
type: "boolean",
},
page: {
baseName: "page",
type: "FlakyTestsSearchPageOptions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5209,7 +5209,6 @@ const enumsMap: { [key: string]: any[] } = {
"none",
"false_positive",
"testing_or_maintenance",
"remediated",
"investigated_case_opened",
"true_positive_benign",
"true_positive_malicious",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type SecurityMonitoringSignalArchiveReason =
| typeof NONE
| typeof FALSE_POSITIVE
| typeof TESTING_OR_MAINTENANCE
| typeof REMEDIATED
| typeof INVESTIGATED_CASE_OPENED
| typeof TRUE_POSITIVE_BENIGN
| typeof TRUE_POSITIVE_MALICIOUS
Expand All @@ -23,7 +22,6 @@ export type SecurityMonitoringSignalArchiveReason =
export const NONE = "none";
export const FALSE_POSITIVE = "false_positive";
export const TESTING_OR_MAINTENANCE = "testing_or_maintenance";
export const REMEDIATED = "remediated";
export const INVESTIGATED_CASE_OPENED = "investigated_case_opened";
export const TRUE_POSITIVE_BENIGN = "true_positive_benign";
export const TRUE_POSITIVE_MALICIOUS = "true_positive_malicious";
Expand Down
Loading