diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9041f8a00394..ba55aa7a1b3e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -90580,9 +90580,6 @@ paths: operator: OR permissions: - test_optimization_settings_write - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- Retrieve Flaky Tests Management repository-level policies for the given repository. @@ -90627,9 +90624,6 @@ paths: operator: OR permissions: - test_optimization_read - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/ci/test-optimization/settings/service: delete: description: |- @@ -90673,9 +90667,6 @@ paths: operator: OR permissions: - test_optimization_settings_write - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: description: |- Partially update Test Optimization settings for a specific service identified by repository, service name, and environment. @@ -90729,9 +90720,6 @@ paths: operator: OR permissions: - test_optimization_settings_write - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- Retrieve Test Optimization settings for a specific service identified by repository, service name, and environment. @@ -90778,9 +90766,6 @@ paths: operator: OR permissions: - test_optimization_read - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/ci/tests/analytics/aggregate: post: description: |- @@ -132177,9 +132162,6 @@ paths: operator: OR permissions: - test_optimization_write - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- List endpoint returning flaky tests from Flaky Test Management. Results are paginated. @@ -132246,9 +132228,6 @@ paths: operator: OR permissions: - test_optimization_read - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/usage/application_security: get: deprecated: true diff --git a/features/v2/test_optimization.feature b/features/v2/test_optimization.feature index 8838a4998ee1..c363d29f04c7 100644 --- a/features/v2/test_optimization.feature +++ b/features/v2/test_optimization.feature @@ -11,48 +11,42 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend Scenario: Delete Test Optimization service settings returns "Bad Request" response - Given operation "DeleteTestOptimizationServiceSettings" enabled - And new "DeleteTestOptimizationServiceSettings" request + Given new "DeleteTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_delete_service_settings_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Delete Test Optimization service settings returns "No Content" response - Given operation "DeleteTestOptimizationServiceSettings" enabled - And new "DeleteTestOptimizationServiceSettings" request + Given new "DeleteTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_delete_service_settings_request"}} When the request is sent Then the response status is 204 No Content @generated @skip @team:DataDog/ci-app-backend Scenario: Delete Test Optimization service settings returns "Not Found" response - Given operation "DeleteTestOptimizationServiceSettings" enabled - And new "DeleteTestOptimizationServiceSettings" request + Given new "DeleteTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_delete_service_settings_request"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/ci-app-backend Scenario: Get Flaky Tests Management policies returns "Bad Request" response - Given operation "GetFlakyTestsManagementPolicies" enabled - And new "GetFlakyTestsManagementPolicies" request + Given new "GetFlakyTestsManagementPolicies" request And body with value {"data": {"attributes": {"repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_get_flaky_tests_management_policies_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Get Flaky Tests Management policies returns "Not Found" response - Given operation "GetFlakyTestsManagementPolicies" enabled - And new "GetFlakyTestsManagementPolicies" request + Given new "GetFlakyTestsManagementPolicies" request And body with value {"data": {"attributes": {"repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_get_flaky_tests_management_policies_request"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/ci-app-backend Scenario: Get Flaky Tests Management policies returns "OK" response - Given operation "GetFlakyTestsManagementPolicies" enabled - And new "GetFlakyTestsManagementPolicies" request + Given new "GetFlakyTestsManagementPolicies" request And body with value {"data": {"attributes": {"repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_get_flaky_tests_management_policies_request"}} When the request is sent Then the response status is 200 OK @@ -67,24 +61,21 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend Scenario: Get Test Optimization service settings returns "Bad Request" response - Given operation "GetTestOptimizationServiceSettings" enabled - And new "GetTestOptimizationServiceSettings" request + Given new "GetTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Get Test Optimization service settings returns "Not Found" response - Given operation "GetTestOptimizationServiceSettings" enabled - And new "GetTestOptimizationServiceSettings" request + Given new "GetTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/ci-app-backend Scenario: Get Test Optimization service settings returns "OK" response - Given operation "GetTestOptimizationServiceSettings" enabled - And new "GetTestOptimizationServiceSettings" request + Given new "GetTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} When the request is sent Then the response status is 200 OK @@ -115,8 +106,7 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend Scenario: Search flaky tests returns "Bad Request" response - Given operation "SearchFlakyTests" enabled - And new "SearchFlakyTests" request + Given new "SearchFlakyTests" 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 @@ -131,8 +121,7 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend Scenario: Search flaky tests returns "OK" response - Given operation "SearchFlakyTests" enabled - And new "SearchFlakyTests" request + Given new "SearchFlakyTests" 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 @@ -161,32 +150,28 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend @with-pagination Scenario: Search flaky tests returns "OK" response with pagination - Given operation "SearchFlakyTests" enabled - And new "SearchFlakyTests" request + Given new "SearchFlakyTests" 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 @generated @skip @team:DataDog/ci-app-backend Scenario: Update Flaky Tests Management policies returns "Bad Request" response - Given operation "UpdateFlakyTestsManagementPolicies" enabled - And new "UpdateFlakyTestsManagementPolicies" request + Given new "UpdateFlakyTestsManagementPolicies" request And body with value {"data": {"attributes": {"attempt_to_fix": {"retries": 3}, "disabled": {"auto_disable_rule": {"enabled": false, "status": "active", "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": false, "failure_rate_rule": {"branches": [], "enabled": false, "min_runs": 10, "status": "active", "threshold": 0.5}}, "quarantined": {"auto_quarantine_rule": {"enabled": true, "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": true, "failure_rate_rule": {"branches": ["main"], "enabled": true, "min_runs": 10, "threshold": 0.5}}, "repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_update_flaky_tests_management_policies_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Update Flaky Tests Management policies returns "Not Found" response - Given operation "UpdateFlakyTestsManagementPolicies" enabled - And new "UpdateFlakyTestsManagementPolicies" request + Given new "UpdateFlakyTestsManagementPolicies" request And body with value {"data": {"attributes": {"attempt_to_fix": {"retries": 3}, "disabled": {"auto_disable_rule": {"enabled": false, "status": "active", "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": false, "failure_rate_rule": {"branches": [], "enabled": false, "min_runs": 10, "status": "active", "threshold": 0.5}}, "quarantined": {"auto_quarantine_rule": {"enabled": true, "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": true, "failure_rate_rule": {"branches": ["main"], "enabled": true, "min_runs": 10, "threshold": 0.5}}, "repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_update_flaky_tests_management_policies_request"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/ci-app-backend Scenario: Update Flaky Tests Management policies returns "OK" response - Given operation "UpdateFlakyTestsManagementPolicies" enabled - And new "UpdateFlakyTestsManagementPolicies" request + Given new "UpdateFlakyTestsManagementPolicies" request And body with value {"data": {"attributes": {"attempt_to_fix": {"retries": 3}, "disabled": {"auto_disable_rule": {"enabled": false, "status": "active", "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": false, "failure_rate_rule": {"branches": [], "enabled": false, "min_runs": 10, "status": "active", "threshold": 0.5}}, "quarantined": {"auto_quarantine_rule": {"enabled": true, "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": true, "failure_rate_rule": {"branches": ["main"], "enabled": true, "min_runs": 10, "threshold": 0.5}}, "repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_update_flaky_tests_management_policies_request"}} When the request is sent Then the response status is 200 OK @@ -201,24 +186,21 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend Scenario: Update Test Optimization service settings returns "Bad Request" response - Given operation "UpdateTestOptimizationServiceSettings" enabled - And new "UpdateTestOptimizationServiceSettings" request + Given new "UpdateTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Update Test Optimization service settings returns "Not Found" response - Given operation "UpdateTestOptimizationServiceSettings" enabled - And new "UpdateTestOptimizationServiceSettings" request + Given new "UpdateTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/ci-app-backend Scenario: Update Test Optimization service settings returns "OK" response - Given operation "UpdateTestOptimizationServiceSettings" enabled - And new "UpdateTestOptimizationServiceSettings" request + Given new "UpdateTestOptimizationServiceSettings" request And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} When the request is sent Then the response status is 200 OK @@ -233,16 +215,14 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend Scenario: Update flaky test states returns "Bad Request" response - Given operation "UpdateFlakyTests" enabled - And new "UpdateFlakyTests" request + Given new "UpdateFlakyTests" request And body with value {"data": {"attributes": {"tests": [{"id": "4eb1887a8adb1847", "new_state": "active"}]}, "type": "update_flaky_test_state_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Update flaky test states returns "OK" response - Given operation "UpdateFlakyTests" enabled - And new "UpdateFlakyTests" request + Given new "UpdateFlakyTests" request And body with value {"data": {"attributes": {"tests": [{"id": "4eb1887a8adb1847", "new_state": "active"}]}, "type": "update_flaky_test_state_request"}} When the request is sent Then the response status is 200 OK diff --git a/services/test_optimization/README.md b/services/test_optimization/README.md index a00cfe6690ee..619f984ec123 100644 --- a/services/test_optimization/README.md +++ b/services/test_optimization/README.md @@ -25,14 +25,6 @@ import { TestOptimizationApiV2 } from "@datadog/datadog-api-client-test-optimiza import { v2 } from "@datadog/datadog-api-client-test-optimization"; const configuration = createConfiguration(); -// Enable unstable operations -const configurationOpts = { - unstableOperations: { - "TestOptimizationApi.v2.getFlakyTestsManagementPolicies": true - } -} - -const configuration = createConfiguration(configurationOpts); const apiInstance = new TestOptimizationApiV2(configuration); const params = {/* parameters */}; diff --git a/services/test_optimization/src/v2/TestOptimizationApi.ts b/services/test_optimization/src/v2/TestOptimizationApi.ts index 1194abd22b4d..9476d0ba723e 100644 --- a/services/test_optimization/src/v2/TestOptimizationApi.ts +++ b/services/test_optimization/src/v2/TestOptimizationApi.ts @@ -55,16 +55,6 @@ export class TestOptimizationApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "TestOptimizationApi.v2.deleteTestOptimizationServiceSettings" - ] - ) { - throw new Error( - "Unstable operation 'deleteTestOptimizationServiceSettings' is disabled. Enable it by setting `configuration.unstableOperations['TestOptimizationApi.v2.deleteTestOptimizationServiceSettings'] = true`", - ); - } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("body", "deleteTestOptimizationServiceSettings"); @@ -121,16 +111,6 @@ export class TestOptimizationApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "TestOptimizationApi.v2.getFlakyTestsManagementPolicies" - ] - ) { - throw new Error( - "Unstable operation 'getFlakyTestsManagementPolicies' is disabled. Enable it by setting `configuration.unstableOperations['TestOptimizationApi.v2.getFlakyTestsManagementPolicies'] = true`", - ); - } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("body", "getFlakyTestsManagementPolicies"); @@ -187,16 +167,6 @@ export class TestOptimizationApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "TestOptimizationApi.v2.getTestOptimizationServiceSettings" - ] - ) { - throw new Error( - "Unstable operation 'getTestOptimizationServiceSettings' is disabled. Enable it by setting `configuration.unstableOperations['TestOptimizationApi.v2.getTestOptimizationServiceSettings'] = true`", - ); - } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("body", "getTestOptimizationServiceSettings"); @@ -253,14 +223,6 @@ export class TestOptimizationApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations["TestOptimizationApi.v2.searchFlakyTests"] - ) { - throw new Error( - "Unstable operation 'searchFlakyTests' is disabled. Enable it by setting `configuration.unstableOperations['TestOptimizationApi.v2.searchFlakyTests'] = true`", - ); - } - // Path Params const localVarPath = "/api/v2/test/flaky-test-management/tests"; @@ -307,14 +269,6 @@ export class TestOptimizationApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations["TestOptimizationApi.v2.updateFlakyTests"] - ) { - throw new Error( - "Unstable operation 'updateFlakyTests' is disabled. Enable it by setting `configuration.unstableOperations['TestOptimizationApi.v2.updateFlakyTests'] = true`", - ); - } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("body", "updateFlakyTests"); @@ -366,16 +320,6 @@ export class TestOptimizationApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "TestOptimizationApi.v2.updateFlakyTestsManagementPolicies" - ] - ) { - throw new Error( - "Unstable operation 'updateFlakyTestsManagementPolicies' is disabled. Enable it by setting `configuration.unstableOperations['TestOptimizationApi.v2.updateFlakyTestsManagementPolicies'] = true`", - ); - } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("body", "updateFlakyTestsManagementPolicies"); @@ -432,16 +376,6 @@ export class TestOptimizationApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "TestOptimizationApi.v2.updateTestOptimizationServiceSettings" - ] - ) { - throw new Error( - "Unstable operation 'updateTestOptimizationServiceSettings' is disabled. Enable it by setting `configuration.unstableOperations['TestOptimizationApi.v2.updateTestOptimizationServiceSettings'] = true`", - ); - } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("body", "updateTestOptimizationServiceSettings");