Skip to content

Commit 47b8dc5

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit f79e0a0 of spec repo
1 parent 2565672 commit 47b8dc5

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
@@ -26664,9 +26664,18 @@ components:
2666426664
Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
2666526665
example:
2666626666
- commit_sha: abc123def456
26667+
policy_id: ftm_policy.quarantine.failure_rate
26668+
policy_meta:
26669+
config:
26670+
failure_rate: 0.1
26671+
required_runs: 100
26672+
failure_rate: 0.25
26673+
total_runs: 200
2666726674
status: quarantined
2666826675
timestamp: 1704067200000
2666926676
- commit_sha: ""
26677+
policy_id: unknown
26678+
policy_meta:
2667026679
status: new
2667126680
timestamp: 1703980800000
2667226681
items:
@@ -26736,6 +26745,11 @@ components:
2673626745
description: The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
2673726746
example: abc123def456
2673826747
type: string
26748+
policy_id:
26749+
$ref: "#/components/schemas/FlakyTestHistoryPolicyId"
26750+
policy_meta:
26751+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMeta"
26752+
nullable: true
2673926753
status:
2674026754
description: The test status at this point in history.
2674126755
example: quarantined
@@ -26750,6 +26764,131 @@ components:
2675026764
- commit_sha
2675126765
- timestamp
2675226766
type: object
26767+
FlakyTestHistoryPolicyId:
26768+
description: The policy that triggered this status change.
26769+
enum:
26770+
- ftm_policy.manual
26771+
- ftm_policy.fixed
26772+
- ftm_policy.disable.failure_rate
26773+
- ftm_policy.disable.branch_flake
26774+
- ftm_policy.disable.days_active
26775+
- ftm_policy.quarantine.failure_rate
26776+
- ftm_policy.quarantine.branch_flake
26777+
- ftm_policy.quarantine.days_active
26778+
- unknown
26779+
example: ftm_policy.quarantine.failure_rate
26780+
nullable: false
26781+
type: string
26782+
x-enum-varnames:
26783+
- MANUAL
26784+
- FIXED
26785+
- DISABLE_FAILURE_RATE
26786+
- DISABLE_BRANCH_FLAKE
26787+
- DISABLE_DAYS_ACTIVE
26788+
- QUARANTINE_FAILURE_RATE
26789+
- QUARANTINE_BRANCH_FLAKE
26790+
- QUARANTINE_DAYS_ACTIVE
26791+
- UNKNOWN
26792+
FlakyTestHistoryPolicyMeta:
26793+
description: Metadata about the policy that triggered this status change.
26794+
properties:
26795+
branches:
26796+
description: Branches where the test was flaky at the time of the status change.
26797+
example: ["main", "develop"]
26798+
items:
26799+
type: string
26800+
nullable: true
26801+
type: array
26802+
config:
26803+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMetaConfig"
26804+
nullable: true
26805+
days_active:
26806+
description: The number of days the test has been active at the time of the status change.
26807+
example: 15
26808+
format: int32
26809+
maximum: 2147483647
26810+
nullable: true
26811+
type: integer
26812+
days_without_flake:
26813+
description: The number of days since the test last exhibited flakiness.
26814+
example: 30
26815+
format: int32
26816+
maximum: 2147483647
26817+
nullable: true
26818+
type: integer
26819+
failure_rate:
26820+
description: The failure rate of the test at the time of the status change.
26821+
example: 0.25
26822+
format: double
26823+
maximum: 1
26824+
minimum: 0
26825+
nullable: true
26826+
type: number
26827+
state:
26828+
description: The previous state of the test.
26829+
example: quarantined
26830+
nullable: true
26831+
type: string
26832+
total_runs:
26833+
description: The total number of test runs at the time of the status change.
26834+
example: 200
26835+
format: int32
26836+
maximum: 2147483647
26837+
nullable: true
26838+
type: integer
26839+
type: object
26840+
FlakyTestHistoryPolicyMetaConfig:
26841+
description: Configuration parameters of the policy that triggered this status change.
26842+
properties:
26843+
branches:
26844+
description: The branches considered by the policy.
26845+
example: ["main"]
26846+
items:
26847+
type: string
26848+
nullable: true
26849+
type: array
26850+
days_active:
26851+
description: The number of days a test must have been active for the policy to trigger.
26852+
example: 30
26853+
format: int32
26854+
maximum: 2147483647
26855+
nullable: true
26856+
type: integer
26857+
failure_rate:
26858+
description: The failure rate threshold for the policy to trigger.
26859+
example: 0.7
26860+
format: double
26861+
maximum: 1
26862+
minimum: 0
26863+
nullable: true
26864+
type: number
26865+
forget_branches:
26866+
description: Branches excluded from the policy evaluation.
26867+
example: ["release"]
26868+
items:
26869+
type: string
26870+
nullable: true
26871+
type: array
26872+
required_runs:
26873+
description: The minimum number of test runs required for the policy to trigger.
26874+
example: 100
26875+
format: int32
26876+
maximum: 2147483647
26877+
nullable: true
26878+
type: integer
26879+
state:
26880+
description: The target state the policy transitions the test from.
26881+
example: quarantined
26882+
nullable: true
26883+
type: string
26884+
test_services:
26885+
description: Test services excluded from the policy evaluation.
26886+
example: ["my-service"]
26887+
items:
26888+
type: string
26889+
nullable: true
26890+
type: array
26891+
type: object
2675326892
FlakyTestPipelineStats:
2675426893
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.
2675526894
properties:
@@ -26829,6 +26968,14 @@ components:
2682926968
FlakyTestsSearchFilter:
2683026969
description: Search filter settings.
2683126970
properties:
26971+
include_history:
26972+
default: false
26973+
description: |-
26974+
Whether to include the status change history for each flaky test in the response.
26975+
When set to true, each test will include a `history` array with chronological status changes.
26976+
Defaults to false.
26977+
example: true
26978+
type: boolean
2683226979
query:
2683326980
default: "*"
2683426981
description: |-
@@ -26874,14 +27021,6 @@ components:
2687427021
properties:
2687527022
filter:
2687627023
$ref: "#/components/schemas/FlakyTestsSearchFilter"
26877-
include_history:
26878-
default: false
26879-
description: |-
26880-
Whether to include the status change history for each flaky test in the response.
26881-
When set to true, each test will include a `history` array with chronological status changes.
26882-
Defaults to false.
26883-
example: true
26884-
type: boolean
2688527024
page:
2688627025
$ref: "#/components/schemas/FlakyTestsSearchPageOptions"
2688727026
sort:

docs/datadog_api_client.v2.model.rst

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

11235+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_id module
11236+
---------------------------------------------------------------------
11237+
11238+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_id
11239+
:members:
11240+
:show-inheritance:
11241+
11242+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_meta module
11243+
-----------------------------------------------------------------------
11244+
11245+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_meta
11246+
:members:
11247+
:show-inheritance:
11248+
11249+
datadog\_api\_client.v2.model.flaky\_test\_history\_policy\_meta\_config module
11250+
-------------------------------------------------------------------------------
11251+
11252+
.. automodule:: datadog_api_client.v2.model.flaky_test_history_policy_meta_config
11253+
:members:
11254+
:show-inheritance:
11255+
1123511256
datadog\_api\_client.v2.model.flaky\_test\_pipeline\_stats module
1123611257
-----------------------------------------------------------------
1123711258

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)