Skip to content

Commit 72d9e49

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bdcc8b5 of spec repo
1 parent 0b3df26 commit 72d9e49

13 files changed

+501
-27
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 147 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26216,9 +26216,18 @@ components:
2621626216
Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
2621726217
example:
2621826218
- commit_sha: abc123def456
26219+
policy_id: ftm_policy.quarantine.failure_rate
26220+
policy_meta:
26221+
config:
26222+
failure_rate: 0.1
26223+
required_runs: 100
26224+
failure_rate: 0.25
26225+
total_runs: 200
2621926226
status: quarantined
2622026227
timestamp: 1704067200000
2622126228
- commit_sha: ""
26229+
policy_id: unknown
26230+
policy_meta:
2622226231
status: new
2622326232
timestamp: 1703980800000
2622426233
items:
@@ -26288,6 +26297,11 @@ components:
2628826297
description: The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
2628926298
example: abc123def456
2629026299
type: string
26300+
policy_id:
26301+
$ref: "#/components/schemas/FlakyTestHistoryPolicyId"
26302+
policy_meta:
26303+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMeta"
26304+
nullable: true
2629126305
status:
2629226306
description: The test status at this point in history.
2629326307
example: quarantined
@@ -26302,6 +26316,131 @@ components:
2630226316
- commit_sha
2630326317
- timestamp
2630426318
type: object
26319+
FlakyTestHistoryPolicyId:
26320+
description: The policy that triggered this status change.
26321+
enum:
26322+
- ftm_policy.manual
26323+
- ftm_policy.fixed
26324+
- ftm_policy.disable.failure_rate
26325+
- ftm_policy.disable.branch_flake
26326+
- ftm_policy.disable.days_active
26327+
- ftm_policy.quarantine.failure_rate
26328+
- ftm_policy.quarantine.branch_flake
26329+
- ftm_policy.quarantine.days_active
26330+
- unknown
26331+
example: ftm_policy.quarantine.failure_rate
26332+
nullable: false
26333+
type: string
26334+
x-enum-varnames:
26335+
- MANUAL
26336+
- FIXED
26337+
- DISABLE_FAILURE_RATE
26338+
- DISABLE_BRANCH_FLAKE
26339+
- DISABLE_DAYS_ACTIVE
26340+
- QUARANTINE_FAILURE_RATE
26341+
- QUARANTINE_BRANCH_FLAKE
26342+
- QUARANTINE_DAYS_ACTIVE
26343+
- UNKNOWN
26344+
FlakyTestHistoryPolicyMeta:
26345+
description: Metadata about the policy that triggered this status change.
26346+
properties:
26347+
branches:
26348+
description: Branches where the test was flaky at the time of the status change.
26349+
example: ["main", "develop"]
26350+
items:
26351+
type: string
26352+
nullable: true
26353+
type: array
26354+
config:
26355+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMetaConfig"
26356+
nullable: true
26357+
days_active:
26358+
description: The number of days the test has been active at the time of the status change.
26359+
example: 15
26360+
format: int32
26361+
maximum: 2147483647
26362+
nullable: true
26363+
type: integer
26364+
days_without_flake:
26365+
description: The number of days since the test last exhibited flakiness.
26366+
example: 30
26367+
format: int32
26368+
maximum: 2147483647
26369+
nullable: true
26370+
type: integer
26371+
failure_rate:
26372+
description: The failure rate of the test at the time of the status change.
26373+
example: 0.25
26374+
format: double
26375+
maximum: 1
26376+
minimum: 0
26377+
nullable: true
26378+
type: number
26379+
state:
26380+
description: The previous state of the test.
26381+
example: quarantined
26382+
nullable: true
26383+
type: string
26384+
total_runs:
26385+
description: The total number of test runs at the time of the status change.
26386+
example: 200
26387+
format: int32
26388+
maximum: 2147483647
26389+
nullable: true
26390+
type: integer
26391+
type: object
26392+
FlakyTestHistoryPolicyMetaConfig:
26393+
description: Configuration parameters of the policy that triggered this status change.
26394+
properties:
26395+
branches:
26396+
description: The branches considered by the policy.
26397+
example: ["main"]
26398+
items:
26399+
type: string
26400+
nullable: true
26401+
type: array
26402+
days_active:
26403+
description: The number of days a test must have been active for the policy to trigger.
26404+
example: 30
26405+
format: int32
26406+
maximum: 2147483647
26407+
nullable: true
26408+
type: integer
26409+
failure_rate:
26410+
description: The failure rate threshold for the policy to trigger.
26411+
example: 0.7
26412+
format: double
26413+
maximum: 1
26414+
minimum: 0
26415+
nullable: true
26416+
type: number
26417+
forget_branches:
26418+
description: Branches excluded from the policy evaluation.
26419+
example: ["release"]
26420+
items:
26421+
type: string
26422+
nullable: true
26423+
type: array
26424+
required_runs:
26425+
description: The minimum number of test runs required for the policy to trigger.
26426+
example: 100
26427+
format: int32
26428+
maximum: 2147483647
26429+
nullable: true
26430+
type: integer
26431+
state:
26432+
description: The target state the policy transitions the test from.
26433+
example: quarantined
26434+
nullable: true
26435+
type: string
26436+
test_services:
26437+
description: Test services excluded from the policy evaluation.
26438+
example: ["my-service"]
26439+
items:
26440+
type: string
26441+
nullable: true
26442+
type: array
26443+
type: object
2630526444
FlakyTestPipelineStats:
2630626445
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.
2630726446
properties:
@@ -26381,6 +26520,14 @@ components:
2638126520
FlakyTestsSearchFilter:
2638226521
description: Search filter settings.
2638326522
properties:
26523+
include_history:
26524+
default: false
26525+
description: |-
26526+
Whether to include the status change history for each flaky test in the response.
26527+
When set to true, each test will include a `history` array with chronological status changes.
26528+
Defaults to false.
26529+
example: true
26530+
type: boolean
2638426531
query:
2638526532
default: "*"
2638626533
description: |-
@@ -26426,14 +26573,6 @@ components:
2642626573
properties:
2642726574
filter:
2642826575
$ref: "#/components/schemas/FlakyTestsSearchFilter"
26429-
include_history:
26430-
default: false
26431-
description: |-
26432-
Whether to include the status change history for each flaky test in the response.
26433-
When set to true, each test will include a `history` array with chronological status changes.
26434-
Defaults to false.
26435-
example: true
26436-
type: boolean
2643726576
page:
2643826577
$ref: "#/components/schemas/FlakyTestsSearchPageOptions"
2643926578
sort:

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11169,6 +11169,27 @@ datadog\_api\_client.v2.model.flaky\_test\_history module
1116911169
:members:
1117011170
:show-inheritance:
1117111171

11172+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_id module
11173+
---------------------------------------------------------------------
11174+
11175+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_id
11176+
:members:
11177+
:show-inheritance:
11178+
11179+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_meta module
11180+
-----------------------------------------------------------------------
11181+
11182+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_meta
11183+
:members:
11184+
:show-inheritance:
11185+
11186+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_meta\_config module
11187+
-------------------------------------------------------------------------------
11188+
11189+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_meta_config
11190+
:members:
11191+
:show-inheritance:
11192+
1117211193
datadog\_api\_client.v2.model.flaky\_test\_pipeline\_stats module
1117311194
-----------------------------------------------------------------
1117411195

examples/v2/test-optimization/SearchFlakyTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
data=FlakyTestsSearchRequestData(
1717
attributes=FlakyTestsSearchRequestAttributes(
1818
filter=FlakyTestsSearchFilter(
19+
include_history=True,
1920
query='flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"',
2021
),
21-
include_history=True,
2222
page=FlakyTestsSearchPageOptions(
2323
cursor="eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
2424
limit=25,

examples/v2/test-optimization/SearchFlakyTests_1224086727.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
data=FlakyTestsSearchRequestData(
1717
attributes=FlakyTestsSearchRequestAttributes(
1818
filter=FlakyTestsSearchFilter(
19+
include_history=True,
1920
query='flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"',
2021
),
21-
include_history=True,
2222
page=FlakyTestsSearchPageOptions(
2323
cursor="eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
2424
limit=25,

examples/v2/test-optimization/SearchFlakyTests_209064879.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
attributes=FlakyTestsSearchRequestAttributes(
1818
filter=FlakyTestsSearchFilter(
1919
query='flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"',
20+
include_history=True,
2021
),
2122
page=FlakyTestsSearchPageOptions(
2223
limit=10,
2324
),
2425
sort=FlakyTestsSearchSort.FQN_ASCENDING,
25-
include_history=True,
2626
),
2727
type=FlakyTestsSearchRequestDataType.SEARCH_FLAKY_TESTS_REQUEST,
2828
),

src/datadog_api_client/v2/model/flaky_test_history.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,74 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6+
from typing import Union, TYPE_CHECKING
67

78
from datadog_api_client.model_utils import (
89
ModelNormal,
910
cached_property,
11+
unset,
12+
UnsetType,
1013
)
1114

1215

16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.flaky_test_history_policy_id import FlakyTestHistoryPolicyId
18+
from datadog_api_client.v2.model.flaky_test_history_policy_meta import FlakyTestHistoryPolicyMeta
19+
20+
1321
class FlakyTestHistory(ModelNormal):
1422
@cached_property
1523
def openapi_types(_):
24+
from datadog_api_client.v2.model.flaky_test_history_policy_id import FlakyTestHistoryPolicyId
25+
from datadog_api_client.v2.model.flaky_test_history_policy_meta import FlakyTestHistoryPolicyMeta
26+
1627
return {
1728
"commit_sha": (str,),
29+
"policy_id": (FlakyTestHistoryPolicyId,),
30+
"policy_meta": (FlakyTestHistoryPolicyMeta,),
1831
"status": (str,),
1932
"timestamp": (int,),
2033
}
2134

2235
attribute_map = {
2336
"commit_sha": "commit_sha",
37+
"policy_id": "policy_id",
38+
"policy_meta": "policy_meta",
2439
"status": "status",
2540
"timestamp": "timestamp",
2641
}
2742

28-
def __init__(self_, commit_sha: str, status: str, timestamp: int, **kwargs):
43+
def __init__(
44+
self_,
45+
commit_sha: str,
46+
status: str,
47+
timestamp: int,
48+
policy_id: Union[FlakyTestHistoryPolicyId, UnsetType] = unset,
49+
policy_meta: Union[FlakyTestHistoryPolicyMeta, UnsetType] = unset,
50+
**kwargs,
51+
):
2952
"""
3053
A single history entry representing a status change for a flaky test.
3154
3255
:param commit_sha: The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
3356
:type commit_sha: str
3457
58+
:param policy_id: The policy that triggered this status change.
59+
:type policy_id: FlakyTestHistoryPolicyId, optional
60+
61+
:param policy_meta: Metadata about the policy that triggered this status change.
62+
:type policy_meta: FlakyTestHistoryPolicyMeta, optional
63+
3564
:param status: The test status at this point in history.
3665
:type status: str
3766
3867
:param timestamp: Unix timestamp in milliseconds when this status change occurred.
3968
:type timestamp: int
4069
"""
70+
if policy_id is not unset:
71+
kwargs["policy_id"] = policy_id
72+
if policy_meta is not unset:
73+
kwargs["policy_meta"] = policy_meta
4174
super().__init__(kwargs)
4275

4376
self_.commit_sha = commit_sha
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class FlakyTestHistoryPolicyId(ModelSimple):
16+
"""
17+
The policy that triggered this status change.
18+
19+
:param value: Must be one of ["ftm_policy.manual", "ftm_policy.fixed", "ftm_policy.disable.failure_rate", "ftm_policy.disable.branch_flake", "ftm_policy.disable.days_active", "ftm_policy.quarantine.failure_rate", "ftm_policy.quarantine.branch_flake", "ftm_policy.quarantine.days_active", "unknown"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"ftm_policy.manual",
25+
"ftm_policy.fixed",
26+
"ftm_policy.disable.failure_rate",
27+
"ftm_policy.disable.branch_flake",
28+
"ftm_policy.disable.days_active",
29+
"ftm_policy.quarantine.failure_rate",
30+
"ftm_policy.quarantine.branch_flake",
31+
"ftm_policy.quarantine.days_active",
32+
"unknown",
33+
}
34+
MANUAL: ClassVar["FlakyTestHistoryPolicyId"]
35+
FIXED: ClassVar["FlakyTestHistoryPolicyId"]
36+
DISABLE_FAILURE_RATE: ClassVar["FlakyTestHistoryPolicyId"]
37+
DISABLE_BRANCH_FLAKE: ClassVar["FlakyTestHistoryPolicyId"]
38+
DISABLE_DAYS_ACTIVE: ClassVar["FlakyTestHistoryPolicyId"]
39+
QUARANTINE_FAILURE_RATE: ClassVar["FlakyTestHistoryPolicyId"]
40+
QUARANTINE_BRANCH_FLAKE: ClassVar["FlakyTestHistoryPolicyId"]
41+
QUARANTINE_DAYS_ACTIVE: ClassVar["FlakyTestHistoryPolicyId"]
42+
UNKNOWN: ClassVar["FlakyTestHistoryPolicyId"]
43+
44+
@cached_property
45+
def openapi_types(_):
46+
return {
47+
"value": (str,),
48+
}
49+
50+
51+
FlakyTestHistoryPolicyId.MANUAL = FlakyTestHistoryPolicyId("ftm_policy.manual")
52+
FlakyTestHistoryPolicyId.FIXED = FlakyTestHistoryPolicyId("ftm_policy.fixed")
53+
FlakyTestHistoryPolicyId.DISABLE_FAILURE_RATE = FlakyTestHistoryPolicyId("ftm_policy.disable.failure_rate")
54+
FlakyTestHistoryPolicyId.DISABLE_BRANCH_FLAKE = FlakyTestHistoryPolicyId("ftm_policy.disable.branch_flake")
55+
FlakyTestHistoryPolicyId.DISABLE_DAYS_ACTIVE = FlakyTestHistoryPolicyId("ftm_policy.disable.days_active")
56+
FlakyTestHistoryPolicyId.QUARANTINE_FAILURE_RATE = FlakyTestHistoryPolicyId("ftm_policy.quarantine.failure_rate")
57+
FlakyTestHistoryPolicyId.QUARANTINE_BRANCH_FLAKE = FlakyTestHistoryPolicyId("ftm_policy.quarantine.branch_flake")
58+
FlakyTestHistoryPolicyId.QUARANTINE_DAYS_ACTIVE = FlakyTestHistoryPolicyId("ftm_policy.quarantine.days_active")
59+
FlakyTestHistoryPolicyId.UNKNOWN = FlakyTestHistoryPolicyId("unknown")

0 commit comments

Comments
 (0)