Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38276,6 +38276,17 @@ components:
items:
$ref: "#/components/schemas/FlakyTestHistory"
type: array
impact_level:
$ref: "#/components/schemas/FlakyTestImpactLevel"
nullable: true
impact_score:
description: A score from 0 to 1 indicating the impact of this flaky test, based on factors such as how often it fails and how many pipelines it affects.
example: 0.78
format: double
maximum: 1
minimum: 0
nullable: true
type: number
last_flaked_branch:
description: The branch name where the test exhibited flakiness for the last time.
example: main
Expand Down Expand Up @@ -38484,6 +38495,12 @@ components:
nullable: true
type: array
type: object
FlakyTestImpactLevel:
description: The impact level of the flaky test, derived from its impact score.
enum: [low, medium, high]
example: medium
type: string
x-enum-varnames: [LOW, MEDIUM, HIGH]
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 CI Visibility.
properties:
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3347,6 +3347,7 @@ def overrides
"v2.flaky_test_history_policy_id" => "FlakyTestHistoryPolicyId",
"v2.flaky_test_history_policy_meta" => "FlakyTestHistoryPolicyMeta",
"v2.flaky_test_history_policy_meta_config" => "FlakyTestHistoryPolicyMetaConfig",
"v2.flaky_test_impact_level" => "FlakyTestImpactLevel",
"v2.flaky_test_pipeline_stats" => "FlakyTestPipelineStats",
"v2.flaky_test_run_metadata" => "FlakyTestRunMetadata",
"v2.flaky_tests_pagination" => "FlakyTestsPagination",
Expand Down
45 changes: 44 additions & 1 deletion lib/datadog_api_client/v2/models/flaky_test_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class FlakyTestAttributes
# Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
attr_accessor :history

# The impact level of the flaky test, derived from its impact score.
attr_accessor :impact_level

# A score from 0 to 1 indicating the impact of this flaky test, based on factors such as how often it fails and how many pipelines it affects.
attr_reader :impact_score

# The branch name where the test exhibited flakiness for the last time.
attr_accessor :last_flaked_branch

Expand Down Expand Up @@ -105,6 +111,8 @@ def self.attribute_map
:'flaky_category' => :'flaky_category',
:'flaky_state' => :'flaky_state',
:'history' => :'history',
:'impact_level' => :'impact_level',
:'impact_score' => :'impact_score',
:'last_flaked_branch' => :'last_flaked_branch',
:'last_flaked_sha' => :'last_flaked_sha',
:'last_flaked_ts' => :'last_flaked_ts',
Expand All @@ -131,6 +139,8 @@ def self.openapi_types
:'flaky_category' => :'String',
:'flaky_state' => :'FlakyTestAttributesFlakyState',
:'history' => :'Array<FlakyTestHistory>',
:'impact_level' => :'FlakyTestImpactLevel',
:'impact_score' => :'Float',
:'last_flaked_branch' => :'String',
:'last_flaked_sha' => :'String',
:'last_flaked_ts' => :'Integer',
Expand All @@ -149,6 +159,7 @@ def self.openapi_types
def self.openapi_nullable
Set.new([
:'flaky_category',
:'impact_score',
:'_module',
])
end
Expand Down Expand Up @@ -213,6 +224,14 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'impact_level')
self.impact_level = attributes[:'impact_level']
end

if attributes.key?(:'impact_score')
self.impact_score = attributes[:'impact_score']
end

if attributes.key?(:'last_flaked_branch')
self.last_flaked_branch = attributes[:'last_flaked_branch']
end
Expand Down Expand Up @@ -256,6 +275,28 @@ def initialize(attributes = {})
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 !@impact_score.nil? && @impact_score > 1
return false if !@impact_score.nil? && @impact_score < 0
true
end

# Custom attribute writer method with validation
# @param impact_score [Object] Object to be assigned
# @!visibility private
def impact_score=(impact_score)
if !impact_score.nil? && impact_score > 1
fail ArgumentError, 'invalid value for "impact_score", must be smaller than or equal to 1.'
end
if !impact_score.nil? && impact_score < 0
fail ArgumentError, 'invalid value for "impact_score", must be greater than or equal to 0.'
end
@impact_score = impact_score
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
Expand Down Expand Up @@ -291,6 +332,8 @@ def ==(o)
flaky_category == o.flaky_category &&
flaky_state == o.flaky_state &&
history == o.history &&
impact_level == o.impact_level &&
impact_score == o.impact_score &&
last_flaked_branch == o.last_flaked_branch &&
last_flaked_sha == o.last_flaked_sha &&
last_flaked_ts == o.last_flaked_ts &&
Expand All @@ -308,7 +351,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, history, impact_level, impact_score, 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
28 changes: 28 additions & 0 deletions lib/datadog_api_client/v2/models/flaky_test_impact_level.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
=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
# The impact level of the flaky test, derived from its impact score.
class FlakyTestImpactLevel
include BaseEnumModel

LOW = "low".freeze
MEDIUM = "medium".freeze
HIGH = "high".freeze
end
end
Loading