Skip to content

Commit 26cf947

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4d6f860 of spec repo
1 parent 00b7d27 commit 26cf947

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
@@ -26392,9 +26392,18 @@ components:
2639226392
Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
2639326393
example:
2639426394
- commit_sha: abc123def456
26395+
policy_id: ftm_policy.quarantine.failure_rate
26396+
policy_meta:
26397+
config:
26398+
failure_rate: 0.1
26399+
required_runs: 100
26400+
failure_rate: 0.25
26401+
total_runs: 200
2639526402
status: quarantined
2639626403
timestamp: 1704067200000
2639726404
- commit_sha: ""
26405+
policy_id: unknown
26406+
policy_meta:
2639826407
status: new
2639926408
timestamp: 1703980800000
2640026409
items:
@@ -26464,6 +26473,11 @@ components:
2646426473
description: The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
2646526474
example: abc123def456
2646626475
type: string
26476+
policy_id:
26477+
$ref: "#/components/schemas/FlakyTestHistoryPolicyId"
26478+
policy_meta:
26479+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMeta"
26480+
nullable: true
2646726481
status:
2646826482
description: The test status at this point in history.
2646926483
example: quarantined
@@ -26478,6 +26492,131 @@ components:
2647826492
- commit_sha
2647926493
- timestamp
2648026494
type: object
26495+
FlakyTestHistoryPolicyId:
26496+
description: The policy that triggered this status change.
26497+
enum:
26498+
- ftm_policy.manual
26499+
- ftm_policy.fixed
26500+
- ftm_policy.disable.failure_rate
26501+
- ftm_policy.disable.branch_flake
26502+
- ftm_policy.disable.days_active
26503+
- ftm_policy.quarantine.failure_rate
26504+
- ftm_policy.quarantine.branch_flake
26505+
- ftm_policy.quarantine.days_active
26506+
- unknown
26507+
example: ftm_policy.quarantine.failure_rate
26508+
nullable: false
26509+
type: string
26510+
x-enum-varnames:
26511+
- MANUAL
26512+
- FIXED
26513+
- DISABLE_FAILURE_RATE
26514+
- DISABLE_BRANCH_FLAKE
26515+
- DISABLE_DAYS_ACTIVE
26516+
- QUARANTINE_FAILURE_RATE
26517+
- QUARANTINE_BRANCH_FLAKE
26518+
- QUARANTINE_DAYS_ACTIVE
26519+
- UNKNOWN
26520+
FlakyTestHistoryPolicyMeta:
26521+
description: Metadata about the policy that triggered this status change.
26522+
properties:
26523+
branches:
26524+
description: Branches where the test was flaky at the time of the status change.
26525+
example: ["main", "develop"]
26526+
items:
26527+
type: string
26528+
nullable: true
26529+
type: array
26530+
config:
26531+
$ref: "#/components/schemas/FlakyTestHistoryPolicyMetaConfig"
26532+
nullable: true
26533+
days_active:
26534+
description: The number of days the test has been active at the time of the status change.
26535+
example: 15
26536+
format: int32
26537+
maximum: 2147483647
26538+
nullable: true
26539+
type: integer
26540+
days_without_flake:
26541+
description: The number of days since the test last exhibited flakiness.
26542+
example: 30
26543+
format: int32
26544+
maximum: 2147483647
26545+
nullable: true
26546+
type: integer
26547+
failure_rate:
26548+
description: The failure rate of the test at the time of the status change.
26549+
example: 0.25
26550+
format: double
26551+
maximum: 1
26552+
minimum: 0
26553+
nullable: true
26554+
type: number
26555+
state:
26556+
description: The previous state of the test.
26557+
example: quarantined
26558+
nullable: true
26559+
type: string
26560+
total_runs:
26561+
description: The total number of test runs at the time of the status change.
26562+
example: 200
26563+
format: int32
26564+
maximum: 2147483647
26565+
nullable: true
26566+
type: integer
26567+
type: object
26568+
FlakyTestHistoryPolicyMetaConfig:
26569+
description: Configuration parameters of the policy that triggered this status change.
26570+
properties:
26571+
branches:
26572+
description: The branches considered by the policy.
26573+
example: ["main"]
26574+
items:
26575+
type: string
26576+
nullable: true
26577+
type: array
26578+
days_active:
26579+
description: The number of days a test must have been active for the policy to trigger.
26580+
example: 30
26581+
format: int32
26582+
maximum: 2147483647
26583+
nullable: true
26584+
type: integer
26585+
failure_rate:
26586+
description: The failure rate threshold for the policy to trigger.
26587+
example: 0.7
26588+
format: double
26589+
maximum: 1
26590+
minimum: 0
26591+
nullable: true
26592+
type: number
26593+
forget_branches:
26594+
description: Branches excluded from the policy evaluation.
26595+
example: ["release"]
26596+
items:
26597+
type: string
26598+
nullable: true
26599+
type: array
26600+
required_runs:
26601+
description: The minimum number of test runs required for the policy to trigger.
26602+
example: 100
26603+
format: int32
26604+
maximum: 2147483647
26605+
nullable: true
26606+
type: integer
26607+
state:
26608+
description: The target state the policy transitions the test from.
26609+
example: quarantined
26610+
nullable: true
26611+
type: string
26612+
test_services:
26613+
description: Test services excluded from the policy evaluation.
26614+
example: ["my-service"]
26615+
items:
26616+
type: string
26617+
nullable: true
26618+
type: array
26619+
type: object
2648126620
FlakyTestPipelineStats:
2648226621
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.
2648326622
properties:
@@ -26557,6 +26696,14 @@ components:
2655726696
FlakyTestsSearchFilter:
2655826697
description: Search filter settings.
2655926698
properties:
26699+
include_history:
26700+
default: false
26701+
description: |-
26702+
Whether to include the status change history for each flaky test in the response.
26703+
When set to true, each test will include a `history` array with chronological status changes.
26704+
Defaults to false.
26705+
example: true
26706+
type: boolean
2656026707
query:
2656126708
default: "*"
2656226709
description: |-
@@ -26602,14 +26749,6 @@ components:
2660226749
properties:
2660326750
filter:
2660426751
$ref: "#/components/schemas/FlakyTestsSearchFilter"
26605-
include_history:
26606-
default: false
26607-
description: |-
26608-
Whether to include the status change history for each flaky test in the response.
26609-
When set to true, each test will include a `history` array with chronological status changes.
26610-
Defaults to false.
26611-
example: true
26612-
type: boolean
2661326752
page:
2661426753
$ref: "#/components/schemas/FlakyTestsSearchPageOptions"
2661526754
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)