From 11563c1cff4b09e084c57ab3c1b266c54c62e3e6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 6 Feb 2026 08:50:06 +0000 Subject: [PATCH] Regenerate client from commit c5b9ef4 of spec repo --- .generator/schemas/v2/openapi.yaml | 77 +------- .../v2/test-optimization/SearchFlakyTests.rb | 1 - .../SearchFlakyTests_1224086727.rb | 1 - .../SearchFlakyTests_209064879.rb | 27 --- features/v2/test_optimization.feature | 18 +- lib/datadog_api_client/inflector.rb | 1 - .../v2/api/test_optimization_api.rb | 13 -- .../v2/models/flaky_test_attributes.rb | 15 +- .../v2/models/flaky_test_history.rb | 165 ------------------ .../flaky_tests_search_request_attributes.rb | 14 +- 10 files changed, 6 insertions(+), 326 deletions(-) delete mode 100644 examples/v2/test-optimization/SearchFlakyTests_209064879.rb delete mode 100644 lib/datadog_api_client/v2/models/flaky_test_history.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e301432aca72..050808b8c45b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24023,22 +24023,6 @@ components: type: string flaky_state: $ref: '#/components/schemas/FlakyTestAttributesFlakyState' - history: - description: 'Chronological history of status changes for this flaky test, - ordered from most recent to oldest. - - Includes state transitions like new -> quarantined -> fixed, along with - the associated commit SHA when available.' - example: - - commit_sha: abc123def456 - status: quarantined - timestamp: 1704067200000 - - commit_sha: '' - status: new - timestamp: 1703980800000 - items: - $ref: '#/components/schemas/FlakyTestHistory' - type: array last_flaked_branch: description: The branch name where the test exhibited flakiness for the last time. @@ -24123,29 +24107,6 @@ components: - FIXED - QUARANTINED - DISABLED - FlakyTestHistory: - description: A single history entry representing a status change for a flaky - test. - properties: - commit_sha: - description: The commit SHA associated with this status change. Will be - an empty string if the commit SHA is not available. - example: abc123def456 - type: string - status: - description: The test status at this point in history. - example: quarantined - type: string - timestamp: - description: Unix timestamp in milliseconds when this status change occurred. - example: 1704067200000 - format: int64 - type: integer - required: - - status - - commit_sha - - timestamp - type: object FlakyTestPipelineStats: description: CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from @@ -24292,17 +24253,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: @@ -101135,33 +101085,8 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: - description: 'List endpoint returning flaky tests from Flaky Test Management. + description: List endpoint returning flaky tests from Flaky Test Management. Results are paginated. - - - The response includes comprehensive test information including: - - - Test identification and metadata (module, suite, name) - - - Flaky state and categorization - - - First and last flake occurrences (timestamp, branch, commit SHA) - - - Test execution statistics from the last 7 days (failure rate) - - - Pipeline impact metrics (failed pipelines count, total lost time) - - - Complete status change history (optional, ordered from most recent to oldest) - - - Set `include_history` to `true` in the request to receive the status change - history for each test. - - History is disabled by default for better performance. - - - Results support filtering by various facets including service, environment, - repository, branch, and test state.' operationId: SearchFlakyTests requestBody: content: diff --git a/examples/v2/test-optimization/SearchFlakyTests.rb b/examples/v2/test-optimization/SearchFlakyTests.rb index a1f4e85d854f..d0707c699308 100644 --- a/examples/v2/test-optimization/SearchFlakyTests.rb +++ b/examples/v2/test-optimization/SearchFlakyTests.rb @@ -12,7 +12,6 @@ filter: DatadogAPIClient::V2::FlakyTestsSearchFilter.new({ query: 'flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"', }), - include_history: true, page: DatadogAPIClient::V2::FlakyTestsSearchPageOptions.new({ cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", limit: 25, diff --git a/examples/v2/test-optimization/SearchFlakyTests_1224086727.rb b/examples/v2/test-optimization/SearchFlakyTests_1224086727.rb index 3a73c924473d..0fa528df442f 100644 --- a/examples/v2/test-optimization/SearchFlakyTests_1224086727.rb +++ b/examples/v2/test-optimization/SearchFlakyTests_1224086727.rb @@ -12,7 +12,6 @@ filter: DatadogAPIClient::V2::FlakyTestsSearchFilter.new({ query: 'flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"', }), - include_history: true, page: DatadogAPIClient::V2::FlakyTestsSearchPageOptions.new({ cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", limit: 25, diff --git a/examples/v2/test-optimization/SearchFlakyTests_209064879.rb b/examples/v2/test-optimization/SearchFlakyTests_209064879.rb deleted file mode 100644 index 7f3a97502a82..000000000000 --- a/examples/v2/test-optimization/SearchFlakyTests_209064879.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Search flaky tests returns "OK" response with history - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.search_flaky_tests".to_sym] = true -end -api_instance = DatadogAPIClient::V2::TestOptimizationAPI.new - -body = DatadogAPIClient::V2::FlakyTestsSearchRequest.new({ - data: DatadogAPIClient::V2::FlakyTestsSearchRequestData.new({ - attributes: DatadogAPIClient::V2::FlakyTestsSearchRequestAttributes.new({ - filter: DatadogAPIClient::V2::FlakyTestsSearchFilter.new({ - query: 'flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"', - }), - page: DatadogAPIClient::V2::FlakyTestsSearchPageOptions.new({ - limit: 10, - }), - sort: DatadogAPIClient::V2::FlakyTestsSearchSort::FQN_ASCENDING, - include_history: true, - }), - type: DatadogAPIClient::V2::FlakyTestsSearchRequestDataType::SEARCH_FLAKY_TESTS_REQUEST, - }), -}) -opts = { - body: body, -} -p api_instance.search_flaky_tests(opts) diff --git a/features/v2/test_optimization.feature b/features/v2/test_optimization.feature index bbf7d87075ed..d21278d7646e 100644 --- a/features/v2/test_optimization.feature +++ b/features/v2/test_optimization.feature @@ -13,7 +13,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": {"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 @@ -29,7 +29,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": {"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 @@ -41,23 +41,11 @@ Feature: Test Optimization When the request with pagination is sent Then the response status is 200 OK - @skip @team:DataDog/ci-app-backend - 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"}} - When the request is sent - Then the response status is 200 OK - And the response "data[0].attributes" has field "history" - And the response "data[0].attributes.history[0]" has field "status" - And the response "data[0].attributes.history[0]" has field "commit_sha" - And the response "data[0].attributes.history[0]" has field "timestamp" - @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 - 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": {"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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5e43080ff1dc..d2aeaff24d7b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2408,7 +2408,6 @@ def overrides "v2.flaky_test" => "FlakyTest", "v2.flaky_test_attributes" => "FlakyTestAttributes", "v2.flaky_test_attributes_flaky_state" => "FlakyTestAttributesFlakyState", - "v2.flaky_test_history" => "FlakyTestHistory", "v2.flaky_test_pipeline_stats" => "FlakyTestPipelineStats", "v2.flaky_test_run_metadata" => "FlakyTestRunMetadata", "v2.flaky_tests_pagination" => "FlakyTestsPagination", diff --git a/lib/datadog_api_client/v2/api/test_optimization_api.rb b/lib/datadog_api_client/v2/api/test_optimization_api.rb index 1432e5421449..9a9967c7dfa1 100644 --- a/lib/datadog_api_client/v2/api/test_optimization_api.rb +++ b/lib/datadog_api_client/v2/api/test_optimization_api.rb @@ -35,19 +35,6 @@ def search_flaky_tests(opts = {}) # # List endpoint returning flaky tests from Flaky Test Management. Results are paginated. # - # The response includes comprehensive test information including: - # - Test identification and metadata (module, suite, name) - # - Flaky state and categorization - # - First and last flake occurrences (timestamp, branch, commit SHA) - # - Test execution statistics from the last 7 days (failure rate) - # - Pipeline impact metrics (failed pipelines count, total lost time) - # - Complete status change history (optional, ordered from most recent to oldest) - # - # Set `include_history` to `true` in the request to receive the status change history for each test. - # History is disabled by default for better performance. - # - # Results support filtering by various facets including service, environment, repository, branch, and test state. - # # @param opts [Hash] the optional parameters # @option opts [FlakyTestsSearchRequest] :body # @return [Array<(FlakyTestsSearchResponse, Integer, Hash)>] FlakyTestsSearchResponse data, response status code and response headers diff --git a/lib/datadog_api_client/v2/models/flaky_test_attributes.rb b/lib/datadog_api_client/v2/models/flaky_test_attributes.rb index 9f534395109e..81256458ad27 100644 --- a/lib/datadog_api_client/v2/models/flaky_test_attributes.rb +++ b/lib/datadog_api_client/v2/models/flaky_test_attributes.rb @@ -48,10 +48,6 @@ class FlakyTestAttributes # The current state of the flaky test. attr_accessor :flaky_state - # Chronological history of status changes for this flaky test, ordered from most recent to oldest. - # Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available. - attr_accessor :history - # The branch name where the test exhibited flakiness for the last time. attr_accessor :last_flaked_branch @@ -104,7 +100,6 @@ def self.attribute_map :'first_flaked_ts' => :'first_flaked_ts', :'flaky_category' => :'flaky_category', :'flaky_state' => :'flaky_state', - :'history' => :'history', :'last_flaked_branch' => :'last_flaked_branch', :'last_flaked_sha' => :'last_flaked_sha', :'last_flaked_ts' => :'last_flaked_ts', @@ -130,7 +125,6 @@ def self.openapi_types :'first_flaked_ts' => :'Integer', :'flaky_category' => :'String', :'flaky_state' => :'FlakyTestAttributesFlakyState', - :'history' => :'Array', :'last_flaked_branch' => :'String', :'last_flaked_sha' => :'String', :'last_flaked_ts' => :'Integer', @@ -207,12 +201,6 @@ def initialize(attributes = {}) self.flaky_state = attributes[:'flaky_state'] end - if attributes.key?(:'history') - if (value = attributes[:'history']).is_a?(Array) - self.history = value - end - end - if attributes.key?(:'last_flaked_branch') self.last_flaked_branch = attributes[:'last_flaked_branch'] end @@ -290,7 +278,6 @@ def ==(o) first_flaked_ts == o.first_flaked_ts && flaky_category == o.flaky_category && flaky_state == o.flaky_state && - history == o.history && last_flaked_branch == o.last_flaked_branch && last_flaked_sha == o.last_flaked_sha && last_flaked_ts == o.last_flaked_ts && @@ -308,7 +295,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attempt_to_fix_id, codeowners, envs, first_flaked_branch, first_flaked_sha, first_flaked_ts, flaky_category, flaky_state, history, last_flaked_branch, last_flaked_sha, last_flaked_ts, _module, name, pipeline_stats, services, suite, test_run_metadata, test_stats, additional_properties].hash + [attempt_to_fix_id, codeowners, envs, first_flaked_branch, first_flaked_sha, first_flaked_ts, flaky_category, flaky_state, last_flaked_branch, last_flaked_sha, last_flaked_ts, _module, name, pipeline_stats, services, suite, test_run_metadata, test_stats, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/flaky_test_history.rb b/lib/datadog_api_client/v2/models/flaky_test_history.rb deleted file mode 100644 index 7b6316e067bb..000000000000 --- a/lib/datadog_api_client/v2/models/flaky_test_history.rb +++ /dev/null @@ -1,165 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # A single history entry representing a status change for a flaky test. - class FlakyTestHistory - include BaseGenericModel - - # The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available. - attr_reader :commit_sha - - # The test status at this point in history. - attr_reader :status - - # Unix timestamp in milliseconds when this status change occurred. - attr_reader :timestamp - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'commit_sha' => :'commit_sha', - :'status' => :'status', - :'timestamp' => :'timestamp' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'commit_sha' => :'String', - :'status' => :'String', - :'timestamp' => :'Integer' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FlakyTestHistory` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'commit_sha') - self.commit_sha = attributes[:'commit_sha'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @commit_sha.nil? - return false if @status.nil? - return false if @timestamp.nil? - true - end - - # Custom attribute writer method with validation - # @param commit_sha [Object] Object to be assigned - # @!visibility private - def commit_sha=(commit_sha) - if commit_sha.nil? - fail ArgumentError, 'invalid value for "commit_sha", commit_sha cannot be nil.' - end - @commit_sha = commit_sha - end - - # Custom attribute writer method with validation - # @param status [Object] Object to be assigned - # @!visibility private - def status=(status) - if status.nil? - fail ArgumentError, 'invalid value for "status", status cannot be nil.' - end - @status = status - end - - # Custom attribute writer method with validation - # @param timestamp [Object] Object to be assigned - # @!visibility private - def timestamp=(timestamp) - if timestamp.nil? - fail ArgumentError, 'invalid value for "timestamp", timestamp cannot be nil.' - end - @timestamp = timestamp - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - commit_sha == o.commit_sha && - status == o.status && - timestamp == o.timestamp && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [commit_sha, status, timestamp, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/flaky_tests_search_request_attributes.rb b/lib/datadog_api_client/v2/models/flaky_tests_search_request_attributes.rb index 6123d48bf891..8dfed991364a 100644 --- a/lib/datadog_api_client/v2/models/flaky_tests_search_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/flaky_tests_search_request_attributes.rb @@ -24,11 +24,6 @@ class FlakyTestsSearchRequestAttributes # Search filter settings. attr_accessor :filter - # 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. - attr_accessor :include_history - # Pagination attributes for listing flaky tests. attr_accessor :page @@ -42,7 +37,6 @@ class FlakyTestsSearchRequestAttributes def self.attribute_map { :'filter' => :'filter', - :'include_history' => :'include_history', :'page' => :'page', :'sort' => :'sort' } @@ -53,7 +47,6 @@ def self.attribute_map def self.openapi_types { :'filter' => :'FlakyTestsSearchFilter', - :'include_history' => :'Boolean', :'page' => :'FlakyTestsSearchPageOptions', :'sort' => :'FlakyTestsSearchSort' } @@ -81,10 +74,6 @@ def initialize(attributes = {}) self.filter = attributes[:'filter'] end - if attributes.key?(:'include_history') - self.include_history = attributes[:'include_history'] - end - if attributes.key?(:'page') self.page = attributes[:'page'] end @@ -121,7 +110,6 @@ def ==(o) return true if self.equal?(o) self.class == o.class && filter == o.filter && - include_history == o.include_history && page == o.page && sort == o.sort && additional_properties == o.additional_properties @@ -131,7 +119,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [filter, include_history, page, sort, additional_properties].hash + [filter, page, sort, additional_properties].hash end end end