Skip to content

Commit b65a7b3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8b43fc8 of spec repo
1 parent 3b5cd5e commit b65a7b3

19 files changed

Lines changed: 1464 additions & 7 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61289,6 +61289,136 @@ components:
6128961289
- name
6129061290
- options
6129161291
type: object
61292+
UpdateFlakyTestsRequest:
61293+
description: Request to update the state of multiple flaky tests.
61294+
properties:
61295+
data:
61296+
$ref: '#/components/schemas/UpdateFlakyTestsRequestData'
61297+
required:
61298+
- data
61299+
type: object
61300+
UpdateFlakyTestsRequestAttributes:
61301+
description: Attributes for updating flaky test states.
61302+
properties:
61303+
tests:
61304+
description: List of flaky tests to update.
61305+
items:
61306+
$ref: '#/components/schemas/UpdateFlakyTestsRequestTest'
61307+
type: array
61308+
required:
61309+
- tests
61310+
type: object
61311+
UpdateFlakyTestsRequestData:
61312+
description: The JSON:API data for updating flaky test states.
61313+
properties:
61314+
attributes:
61315+
$ref: '#/components/schemas/UpdateFlakyTestsRequestAttributes'
61316+
type:
61317+
$ref: '#/components/schemas/UpdateFlakyTestsRequestDataType'
61318+
required:
61319+
- type
61320+
- attributes
61321+
type: object
61322+
UpdateFlakyTestsRequestDataType:
61323+
description: The definition of `UpdateFlakyTestsRequestDataType` object.
61324+
enum:
61325+
- update_flaky_test_state_request
61326+
example: update_flaky_test_state_request
61327+
type: string
61328+
x-enum-varnames:
61329+
- UPDATE_FLAKY_TEST_STATE_REQUEST
61330+
UpdateFlakyTestsRequestTest:
61331+
description: Details of what tests to update and their new attributes.
61332+
properties:
61333+
id:
61334+
description: The ID of the flaky test. This is the same ID returned by the
61335+
Search flaky tests endpoint and corresponds to the test_fingerprint_fqn
61336+
field in test run events.
61337+
example: 4eb1887a8adb1847
61338+
type: string
61339+
new_state:
61340+
$ref: '#/components/schemas/UpdateFlakyTestsRequestTestNewState'
61341+
required:
61342+
- id
61343+
- new_state
61344+
type: object
61345+
UpdateFlakyTestsRequestTestNewState:
61346+
description: The new state to set for the flaky test.
61347+
enum:
61348+
- active
61349+
- quarantined
61350+
- disabled
61351+
- fixed
61352+
example: active
61353+
type: string
61354+
x-enum-varnames:
61355+
- ACTIVE
61356+
- QUARANTINED
61357+
- DISABLED
61358+
- FIXED
61359+
UpdateFlakyTestsResponse:
61360+
description: Response object for updating flaky test states.
61361+
properties:
61362+
data:
61363+
$ref: '#/components/schemas/UpdateFlakyTestsResponseData'
61364+
type: object
61365+
UpdateFlakyTestsResponseAttributes:
61366+
description: Attributes for the update flaky test state response.
61367+
properties:
61368+
has_errors:
61369+
description: '`True` if any errors occurred during the update operations.
61370+
`False` if all tests succeeded to be updated.'
61371+
example: true
61372+
type: boolean
61373+
results:
61374+
description: Results of the update operation for each test.
61375+
items:
61376+
$ref: '#/components/schemas/UpdateFlakyTestsResponseResult'
61377+
type: array
61378+
required:
61379+
- has_errors
61380+
- results
61381+
type: object
61382+
UpdateFlakyTestsResponseData:
61383+
description: Summary of the update operations. Tells whether a test succeeded
61384+
or failed to be updated.
61385+
properties:
61386+
attributes:
61387+
$ref: '#/components/schemas/UpdateFlakyTestsResponseAttributes'
61388+
id:
61389+
description: The ID of the response.
61390+
type: string
61391+
type:
61392+
$ref: '#/components/schemas/UpdateFlakyTestsResponseDataType'
61393+
type: object
61394+
UpdateFlakyTestsResponseDataType:
61395+
description: The definition of `UpdateFlakyTestsResponseDataType` object.
61396+
enum:
61397+
- update_flaky_test_state_response
61398+
type: string
61399+
x-enum-varnames:
61400+
- UPDATE_FLAKY_TEST_STATE_RESPONSE
61401+
UpdateFlakyTestsResponseResult:
61402+
description: Result of updating a single flaky test state.
61403+
properties:
61404+
error:
61405+
description: Error message if the update failed.
61406+
type: string
61407+
id:
61408+
description: The ID of the flaky test from the request. This is the same
61409+
ID returned by the Search flaky tests endpoint and corresponds to the
61410+
test_fingerprint_fqn field in test run events.
61411+
example: 4eb1887a8adb1847
61412+
type: string
61413+
success:
61414+
description: '`True` if the update was successful, `False` if there were
61415+
any errors.'
61416+
example: false
61417+
type: boolean
61418+
required:
61419+
- id
61420+
- success
61421+
type: object
6129261422
UpdateOnCallNotificationRuleRequest:
6129361423
description: A top-level wrapper for updating a notification rule for a user
6129461424
example:
@@ -63638,6 +63768,8 @@ components:
6363863768
teams_read: Read Teams data. A User with this permission can view Team
6363963769
names, metadata, and which Users are on each Team.
6364063770
test_optimization_read: View Test Optimization.
63771+
test_optimization_write: Update flaky tests from Flaky Tests Management
63772+
of Test Optimization.
6364163773
timeseries_query: Query Timeseries data.
6364263774
usage_read: View your organization's usage and usage attribution.
6364363775
user_access_invite: Invite other users to your organization.
@@ -94850,6 +94982,44 @@ paths:
9485094982
- incident_settings_write
9485194983
x-unstable: '**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/).'
9485294984
/api/v2/test/flaky-test-management/tests:
94985+
patch:
94986+
description: Update the state of multiple flaky tests in Flaky Test Management.
94987+
operationId: UpdateFlakyTests
94988+
requestBody:
94989+
content:
94990+
application/json:
94991+
schema:
94992+
$ref: '#/components/schemas/UpdateFlakyTestsRequest'
94993+
required: true
94994+
responses:
94995+
'200':
94996+
content:
94997+
application/json:
94998+
schema:
94999+
$ref: '#/components/schemas/UpdateFlakyTestsResponse'
95000+
description: OK
95001+
'400':
95002+
$ref: '#/components/responses/BadRequestResponse'
95003+
'403':
95004+
$ref: '#/components/responses/NotAuthorizedResponse'
95005+
'429':
95006+
$ref: '#/components/responses/TooManyRequestsResponse'
95007+
security:
95008+
- apiKeyAuth: []
95009+
appKeyAuth: []
95010+
- AuthZ:
95011+
- test_optimization_write
95012+
summary: Update flaky test states
95013+
tags:
95014+
- Test Optimization
95015+
x-codegen-request-body-name: body
95016+
x-permission:
95017+
operator: OR
95018+
permissions:
95019+
- test_optimization_write
95020+
x-unstable: '**Note**: This endpoint is in preview and may be subject to change.
95021+
95022+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
9485395023
post:
9485495024
description: List endpoint returning flaky tests from Flaky Test Management.
9485595025
Results are paginated.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Update flaky test states returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.update_flaky_tests".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TestOptimizationAPI.new
8+
9+
body = DatadogAPIClient::V2::UpdateFlakyTestsRequest.new({
10+
data: DatadogAPIClient::V2::UpdateFlakyTestsRequestData.new({
11+
attributes: DatadogAPIClient::V2::UpdateFlakyTestsRequestAttributes.new({
12+
tests: [
13+
DatadogAPIClient::V2::UpdateFlakyTestsRequestTest.new({
14+
id: "4eb1887a8adb1847",
15+
new_state: DatadogAPIClient::V2::UpdateFlakyTestsRequestTestNewState::ACTIVE,
16+
}),
17+
],
18+
}),
19+
type: DatadogAPIClient::V2::UpdateFlakyTestsRequestDataType::UPDATE_FLAKY_TEST_STATE_REQUEST,
20+
}),
21+
})
22+
p api_instance.update_flaky_tests(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3568,6 +3568,9 @@
35683568
"team_id" => "String",
35693569
"body" => "IncidentTeamUpdateRequest",
35703570
},
3571+
"v2.UpdateFlakyTests" => {
3572+
"body" => "UpdateFlakyTestsRequest",
3573+
},
35713574
"v2.SearchFlakyTests" => {
35723575
"body" => "FlakyTestsSearchRequest",
35733576
},

features/v2/test_optimization.feature

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,59 @@ Feature: Test Optimization
88
Given a valid "apiKeyAuth" key in the system
99
And a valid "appKeyAuth" key in the system
1010
And an instance of "TestOptimization" API
11-
And operation "SearchFlakyTests" enabled
12-
And new "SearchFlakyTests" request
1311

1412
@generated @skip @team:DataDog/ci-app-backend
1513
Scenario: Search flaky tests returns "Bad Request" response
16-
Given 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"}}
14+
Given operation "SearchFlakyTests" enabled
15+
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"}}
1717
When the request is sent
1818
Then the response status is 400 Bad Request
1919

2020
@skip @team:DataDog/ci-app-backend
2121
Scenario: Search flaky tests returns "Bad Request" response with invalid limit
22-
Given body with value {"data": {"attributes": {"filter": {"query": "*"}, "page": {"limit": 2000}, "sort": "fqn"}, "type": "search_flaky_tests_request"}}
22+
Given operation "SearchFlakyTests" enabled
23+
And new "SearchFlakyTests" request
24+
And body with value {"data": {"attributes": {"filter": {"query": "*"}, "page": {"limit": 2000}, "sort": "fqn"}, "type": "search_flaky_tests_request"}}
2325
When the request is sent
2426
Then the response status is 400 Bad Request
2527

2628
@generated @skip @team:DataDog/ci-app-backend
2729
Scenario: Search flaky tests returns "OK" response
28-
Given 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"}}
30+
Given operation "SearchFlakyTests" enabled
31+
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"}}
2933
When the request is sent
3034
Then the response status is 200 OK
3135

3236
@replay-only @skip @skip-validation @team:DataDog/ci-app-backend @with-pagination
3337
Scenario: Search flaky tests returns "OK" response with filtered query
34-
Given body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/cart-tracking\""}, "page": {"limit": 10}, "sort": "-last_flaked"}, "type": "search_flaky_tests_request"}}
38+
Given operation "SearchFlakyTests" enabled
39+
And new "SearchFlakyTests" request
40+
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/cart-tracking\""}, "page": {"limit": 10}, "sort": "-last_flaked"}, "type": "search_flaky_tests_request"}}
3541
When the request with pagination is sent
3642
Then the response status is 200 OK
3743

3844
@generated @skip @team:DataDog/ci-app-backend @with-pagination
3945
Scenario: Search flaky tests returns "OK" response with pagination
40-
Given 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"}}
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": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
4149
When the request with pagination is sent
4250
Then the response status is 200 OK
51+
52+
@generated @skip @team:DataDog/ci-app-backend
53+
Scenario: Update flaky test states returns "Bad Request" response
54+
Given operation "UpdateFlakyTests" enabled
55+
And new "UpdateFlakyTests" request
56+
And body with value {"data": {"attributes": {"tests": [{"id": "4eb1887a8adb1847", "new_state": "active"}]}, "type": "update_flaky_test_state_request"}}
57+
When the request is sent
58+
Then the response status is 400 Bad Request
59+
60+
@generated @skip @team:DataDog/ci-app-backend
61+
Scenario: Update flaky test states returns "OK" response
62+
Given operation "UpdateFlakyTests" enabled
63+
And new "UpdateFlakyTests" request
64+
And body with value {"data": {"attributes": {"tests": [{"id": "4eb1887a8adb1847", "new_state": "active"}]}, "type": "update_flaky_test_state_request"}}
65+
When the request is sent
66+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5149,6 +5149,12 @@
51495149
"type": "idempotent"
51505150
}
51515151
},
5152+
"UpdateFlakyTests": {
5153+
"tag": "Test Optimization",
5154+
"undo": {
5155+
"type": "unsafe"
5156+
}
5157+
},
51525158
"SearchFlakyTests": {
51535159
"tag": "Test Optimization",
51545160
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ def initialize
357357
"v2.list_incident_teams": false,
358358
"v2.update_incident_team": false,
359359
"v2.search_flaky_tests": false,
360+
"v2.update_flaky_tests": false,
360361
}
361362
@server_variables[:site] = ENV['DD_SITE'] if ENV.key? 'DD_SITE'
362363
@api_key['apiKeyAuth'] = ENV['DD_API_KEY'] if ENV.key? 'DD_API_KEY'

lib/datadog_api_client/inflector.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4809,6 +4809,17 @@ def overrides
48094809
"v2.update_deployment_rule_params" => "UpdateDeploymentRuleParams",
48104810
"v2.update_deployment_rule_params_data" => "UpdateDeploymentRuleParamsData",
48114811
"v2.update_deployment_rule_params_data_attributes" => "UpdateDeploymentRuleParamsDataAttributes",
4812+
"v2.update_flaky_tests_request" => "UpdateFlakyTestsRequest",
4813+
"v2.update_flaky_tests_request_attributes" => "UpdateFlakyTestsRequestAttributes",
4814+
"v2.update_flaky_tests_request_data" => "UpdateFlakyTestsRequestData",
4815+
"v2.update_flaky_tests_request_data_type" => "UpdateFlakyTestsRequestDataType",
4816+
"v2.update_flaky_tests_request_test" => "UpdateFlakyTestsRequestTest",
4817+
"v2.update_flaky_tests_request_test_new_state" => "UpdateFlakyTestsRequestTestNewState",
4818+
"v2.update_flaky_tests_response" => "UpdateFlakyTestsResponse",
4819+
"v2.update_flaky_tests_response_attributes" => "UpdateFlakyTestsResponseAttributes",
4820+
"v2.update_flaky_tests_response_data" => "UpdateFlakyTestsResponseData",
4821+
"v2.update_flaky_tests_response_data_type" => "UpdateFlakyTestsResponseDataType",
4822+
"v2.update_flaky_tests_response_result" => "UpdateFlakyTestsResponseResult",
48124823
"v2.update_on_call_notification_rule_request" => "UpdateOnCallNotificationRuleRequest",
48134824
"v2.update_on_call_notification_rule_request_attributes" => "UpdateOnCallNotificationRuleRequestAttributes",
48144825
"v2.update_on_call_notification_rule_request_data" => "UpdateOnCallNotificationRuleRequestData",

0 commit comments

Comments
 (0)