Skip to content

Commit bf25796

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c8f4ae7 of spec repo
1 parent 3bf2b1e commit bf25796

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
@@ -26583,9 +26583,18 @@ components:
2658326583
Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
2658426584
example:
2658526585
- commit_sha: abc123def456
26586+
policy_id: ftm_policy.quarantine.failure_rate
26587+
policy_meta:
26588+
config:
26589+
failure_rate: 0.1
26590+
required_runs: 100
26591+
failure_rate: 0.25
26592+
total_runs: 200
2658626593
status: quarantined
2658726594
timestamp: 1704067200000
2658826595
- commit_sha: ""
26596+
policy_id: unknown
26597+
policy_meta:
2658926598
status: new
2659026599
timestamp: 1703980800000
2659126600
items:
@@ -26655,6 +26664,11 @@ components:
2665526664
description: The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
2665626665
example: abc123def456
2665726666
type: string
26667+
policy_id:
26668+
$ref: "#/components/schemas/FlakyTestHistoryPolicyId"
26669+
policy_meta:
26670+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMeta"
26671+
nullable: true
2665826672
status:
2665926673
description: The test status at this point in history.
2666026674
example: quarantined
@@ -26669,6 +26683,131 @@ components:
2666926683
- commit_sha
2667026684
- timestamp
2667126685
type: object
26686+
FlakyTestHistoryPolicyId:
26687+
description: The policy that triggered this status change.
26688+
enum:
26689+
- ftm_policy.manual
26690+
- ftm_policy.fixed
26691+
- ftm_policy.disable.failure_rate
26692+
- ftm_policy.disable.branch_flake
26693+
- ftm_policy.disable.days_active
26694+
- ftm_policy.quarantine.failure_rate
26695+
- ftm_policy.quarantine.branch_flake
26696+
- ftm_policy.quarantine.days_active
26697+
- unknown
26698+
example: ftm_policy.quarantine.failure_rate
26699+
nullable: false
26700+
type: string
26701+
x-enum-varnames:
26702+
- MANUAL
26703+
- FIXED
26704+
- DISABLE_FAILURE_RATE
26705+
- DISABLE_BRANCH_FLAKE
26706+
- DISABLE_DAYS_ACTIVE
26707+
- QUARANTINE_FAILURE_RATE
26708+
- QUARANTINE_BRANCH_FLAKE
26709+
- QUARANTINE_DAYS_ACTIVE
26710+
- UNKNOWN
26711+
FlakyTestHistoryPolicyMeta:
26712+
description: Metadata about the policy that triggered this status change.
26713+
properties:
26714+
branches:
26715+
description: Branches where the test was flaky at the time of the status change.
26716+
example: ["main", "develop"]
26717+
items:
26718+
type: string
26719+
nullable: true
26720+
type: array
26721+
config:
26722+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMetaConfig"
26723+
nullable: true
26724+
days_active:
26725+
description: The number of days the test has been active at the time of the status change.
26726+
example: 15
26727+
format: int32
26728+
maximum: 2147483647
26729+
nullable: true
26730+
type: integer
26731+
days_without_flake:
26732+
description: The number of days since the test last exhibited flakiness.
26733+
example: 30
26734+
format: int32
26735+
maximum: 2147483647
26736+
nullable: true
26737+
type: integer
26738+
failure_rate:
26739+
description: The failure rate of the test at the time of the status change.
26740+
example: 0.25
26741+
format: double
26742+
maximum: 1
26743+
minimum: 0
26744+
nullable: true
26745+
type: number
26746+
state:
26747+
description: The previous state of the test.
26748+
example: quarantined
26749+
nullable: true
26750+
type: string
26751+
total_runs:
26752+
description: The total number of test runs at the time of the status change.
26753+
example: 200
26754+
format: int32
26755+
maximum: 2147483647
26756+
nullable: true
26757+
type: integer
26758+
type: object
26759+
FlakyTestHistoryPolicyMetaConfig:
26760+
description: Configuration parameters of the policy that triggered this status change.
26761+
properties:
26762+
branches:
26763+
description: The branches considered by the policy.
26764+
example: ["main"]
26765+
items:
26766+
type: string
26767+
nullable: true
26768+
type: array
26769+
days_active:
26770+
description: The number of days a test must have been active for the policy to trigger.
26771+
example: 30
26772+
format: int32
26773+
maximum: 2147483647
26774+
nullable: true
26775+
type: integer
26776+
failure_rate:
26777+
description: The failure rate threshold for the policy to trigger.
26778+
example: 0.7
26779+
format: double
26780+
maximum: 1
26781+
minimum: 0
26782+
nullable: true
26783+
type: number
26784+
forget_branches:
26785+
description: Branches excluded from the policy evaluation.
26786+
example: ["release"]
26787+
items:
26788+
type: string
26789+
nullable: true
26790+
type: array
26791+
required_runs:
26792+
description: The minimum number of test runs required for the policy to trigger.
26793+
example: 100
26794+
format: int32
26795+
maximum: 2147483647
26796+
nullable: true
26797+
type: integer
26798+
state:
26799+
description: The target state the policy transitions the test from.
26800+
example: quarantined
26801+
nullable: true
26802+
type: string
26803+
test_services:
26804+
description: Test services excluded from the policy evaluation.
26805+
example: ["my-service"]
26806+
items:
26807+
type: string
26808+
nullable: true
26809+
type: array
26810+
type: object
2667226811
FlakyTestPipelineStats:
2667326812
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.
2667426813
properties:
@@ -26748,6 +26887,14 @@ components:
2674826887
FlakyTestsSearchFilter:
2674926888
description: Search filter settings.
2675026889
properties:
26890+
include_history:
26891+
default: false
26892+
description: |-
26893+
Whether to include the status change history for each flaky test in the response.
26894+
When set to true, each test will include a `history` array with chronological status changes.
26895+
Defaults to false.
26896+
example: true
26897+
type: boolean
2675126898
query:
2675226899
default: "*"
2675326900
description: |-
@@ -26793,14 +26940,6 @@ components:
2679326940
properties:
2679426941
filter:
2679526942
$ref: "#/components/schemas/FlakyTestsSearchFilter"
26796-
include_history:
26797-
default: false
26798-
description: |-
26799-
Whether to include the status change history for each flaky test in the response.
26800-
When set to true, each test will include a `history` array with chronological status changes.
26801-
Defaults to false.
26802-
example: true
26803-
type: boolean
2680426943
page:
2680526944
$ref: "#/components/schemas/FlakyTestsSearchPageOptions"
2680626945
sort:

docs/datadog_api_client.v2.model.rst

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

11228+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_id module
11229+
---------------------------------------------------------------------
11230+
11231+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_id
11232+
:members:
11233+
:show-inheritance:
11234+
11235+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_meta module
11236+
-----------------------------------------------------------------------
11237+
11238+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_meta
11239+
:members:
11240+
:show-inheritance:
11241+
11242+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_meta\_config module
11243+
-------------------------------------------------------------------------------
11244+
11245+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_meta_config
11246+
:members:
11247+
:show-inheritance:
11248+
1122811249
datadog\_api\_client.v2.model.flaky\_test\_pipeline\_stats module
1122911250
-----------------------------------------------------------------
1123011251

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)