diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 0f86b61062..80e4a62146 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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 @@ -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: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 7f7953b085..fd5310ce20 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -15327,6 +15327,13 @@ datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_meta\_config module :members: :show-inheritance: +datadog\_api\_client.v2.model.flaky\_test\_impact\_level module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.flaky_test_impact_level + :members: + :show-inheritance: + datadog\_api\_client.v2.model.flaky\_test\_pipeline\_stats module ----------------------------------------------------------------- diff --git a/src/datadog_api_client/v2/model/flaky_test_attributes.py b/src/datadog_api_client/v2/model/flaky_test_attributes.py index 3a6bc23f67..205f67779a 100644 --- a/src/datadog_api_client/v2/model/flaky_test_attributes.py +++ b/src/datadog_api_client/v2/model/flaky_test_attributes.py @@ -17,16 +17,25 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.flaky_test_attributes_flaky_state import FlakyTestAttributesFlakyState from datadog_api_client.v2.model.flaky_test_history import FlakyTestHistory + from datadog_api_client.v2.model.flaky_test_impact_level import FlakyTestImpactLevel from datadog_api_client.v2.model.flaky_test_pipeline_stats import FlakyTestPipelineStats from datadog_api_client.v2.model.flaky_test_run_metadata import FlakyTestRunMetadata from datadog_api_client.v2.model.flaky_test_stats import FlakyTestStats class FlakyTestAttributes(ModelNormal): + validations = { + "impact_score": { + "inclusive_maximum": 1, + "inclusive_minimum": 0, + }, + } + @cached_property def openapi_types(_): from datadog_api_client.v2.model.flaky_test_attributes_flaky_state import FlakyTestAttributesFlakyState from datadog_api_client.v2.model.flaky_test_history import FlakyTestHistory + from datadog_api_client.v2.model.flaky_test_impact_level import FlakyTestImpactLevel from datadog_api_client.v2.model.flaky_test_pipeline_stats import FlakyTestPipelineStats from datadog_api_client.v2.model.flaky_test_run_metadata import FlakyTestRunMetadata from datadog_api_client.v2.model.flaky_test_stats import FlakyTestStats @@ -41,6 +50,8 @@ def openapi_types(_): "flaky_category": (str, none_type), "flaky_state": (FlakyTestAttributesFlakyState,), "history": ([FlakyTestHistory],), + "impact_level": (FlakyTestImpactLevel,), + "impact_score": (float, none_type), "last_flaked_branch": (str,), "last_flaked_sha": (str,), "last_flaked_ts": (int,), @@ -63,6 +74,8 @@ def openapi_types(_): "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", @@ -86,6 +99,8 @@ def __init__( flaky_category: Union[str, none_type, UnsetType] = unset, flaky_state: Union[FlakyTestAttributesFlakyState, UnsetType] = unset, history: Union[List[FlakyTestHistory], UnsetType] = unset, + impact_level: Union[FlakyTestImpactLevel, UnsetType] = unset, + impact_score: Union[float, none_type, UnsetType] = unset, last_flaked_branch: Union[str, UnsetType] = unset, last_flaked_sha: Union[str, UnsetType] = unset, last_flaked_ts: Union[int, UnsetType] = unset, @@ -132,6 +147,12 @@ def __init__( Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available. :type history: [FlakyTestHistory], optional + :param impact_level: The impact level of the flaky test, derived from its impact score. + :type impact_level: FlakyTestImpactLevel, optional + + :param impact_score: 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. + :type impact_score: float, none_type, optional + :param last_flaked_branch: The branch name where the test exhibited flakiness for the last time. :type last_flaked_branch: str, optional @@ -189,6 +210,10 @@ def __init__( kwargs["flaky_state"] = flaky_state if history is not unset: kwargs["history"] = history + if impact_level is not unset: + kwargs["impact_level"] = impact_level + if impact_score is not unset: + kwargs["impact_score"] = impact_score if last_flaked_branch is not unset: kwargs["last_flaked_branch"] = last_flaked_branch if last_flaked_sha is not unset: diff --git a/src/datadog_api_client/v2/model/flaky_test_impact_level.py b/src/datadog_api_client/v2/model/flaky_test_impact_level.py new file mode 100644 index 0000000000..abe855ab3f --- /dev/null +++ b/src/datadog_api_client/v2/model/flaky_test_impact_level.py @@ -0,0 +1,41 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FlakyTestImpactLevel(ModelSimple): + """ + The impact level of the flaky test, derived from its impact score. + + :param value: Must be one of ["low", "medium", "high"]. + :type value: str + """ + + allowed_values = { + "low", + "medium", + "high", + } + LOW: ClassVar["FlakyTestImpactLevel"] + MEDIUM: ClassVar["FlakyTestImpactLevel"] + HIGH: ClassVar["FlakyTestImpactLevel"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FlakyTestImpactLevel.LOW = FlakyTestImpactLevel("low") +FlakyTestImpactLevel.MEDIUM = FlakyTestImpactLevel("medium") +FlakyTestImpactLevel.HIGH = FlakyTestImpactLevel("high") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 067deb0dd5..968eeb4892 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2890,6 +2890,7 @@ from datadog_api_client.v2.model.flaky_test_history_policy_id import FlakyTestHistoryPolicyId from datadog_api_client.v2.model.flaky_test_history_policy_meta import FlakyTestHistoryPolicyMeta from datadog_api_client.v2.model.flaky_test_history_policy_meta_config import FlakyTestHistoryPolicyMetaConfig +from datadog_api_client.v2.model.flaky_test_impact_level import FlakyTestImpactLevel from datadog_api_client.v2.model.flaky_test_pipeline_stats import FlakyTestPipelineStats from datadog_api_client.v2.model.flaky_test_run_metadata import FlakyTestRunMetadata from datadog_api_client.v2.model.flaky_test_stats import FlakyTestStats @@ -12489,6 +12490,7 @@ "FlakyTestHistoryPolicyId", "FlakyTestHistoryPolicyMeta", "FlakyTestHistoryPolicyMetaConfig", + "FlakyTestImpactLevel", "FlakyTestPipelineStats", "FlakyTestRunMetadata", "FlakyTestStats",