Skip to content

Commit c29ea01

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bdcc8b5 of spec repo
1 parent 7bbc37c commit c29ea01

12 files changed

+750
-47
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:

examples/v2_test-optimization_SearchFlakyTests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ async fn main() {
1919
.attributes(
2020
FlakyTestsSearchRequestAttributes::new()
2121
.filter(
22-
FlakyTestsSearchFilter
23-
::new().query(
24-
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
25-
),
22+
FlakyTestsSearchFilter::new()
23+
.include_history(true)
24+
.query(
25+
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
26+
),
2627
)
27-
.include_history(true)
2828
.page(
2929
FlakyTestsSearchPageOptions::new()
3030
.cursor(

examples/v2_test-optimization_SearchFlakyTests_1224086727.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ async fn main() {
2121
.attributes(
2222
FlakyTestsSearchRequestAttributes::new()
2323
.filter(
24-
FlakyTestsSearchFilter
25-
::new().query(
26-
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
27-
),
24+
FlakyTestsSearchFilter::new()
25+
.include_history(true)
26+
.query(
27+
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
28+
),
2829
)
29-
.include_history(true)
3030
.page(
3131
FlakyTestsSearchPageOptions::new()
3232
.cursor(

examples/v2_test-optimization_SearchFlakyTests_209064879.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ async fn main() {
1919
.attributes(
2020
FlakyTestsSearchRequestAttributes::new()
2121
.filter(
22-
FlakyTestsSearchFilter
23-
::new().query(
24-
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
25-
),
22+
FlakyTestsSearchFilter::new()
23+
.include_history(true)
24+
.query(
25+
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
26+
),
2627
)
27-
.include_history(true)
2828
.page(FlakyTestsSearchPageOptions::new().limit(10))
2929
.sort(FlakyTestsSearchSort::FQN_ASCENDING),
3030
)

src/datadogV2/model/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9238,6 +9238,12 @@ pub mod model_flaky_test_attributes_flaky_state;
92389238
pub use self::model_flaky_test_attributes_flaky_state::FlakyTestAttributesFlakyState;
92399239
pub mod model_flaky_test_history;
92409240
pub use self::model_flaky_test_history::FlakyTestHistory;
9241+
pub mod model_flaky_test_history_policy_id;
9242+
pub use self::model_flaky_test_history_policy_id::FlakyTestHistoryPolicyId;
9243+
pub mod model_flaky_test_history_policy_meta;
9244+
pub use self::model_flaky_test_history_policy_meta::FlakyTestHistoryPolicyMeta;
9245+
pub mod model_flaky_test_history_policy_meta_config;
9246+
pub use self::model_flaky_test_history_policy_meta_config::FlakyTestHistoryPolicyMetaConfig;
92419247
pub mod model_flaky_test_pipeline_stats;
92429248
pub use self::model_flaky_test_pipeline_stats::FlakyTestPipelineStats;
92439249
pub mod model_flaky_test_run_metadata;

src/datadogV2/model/model_flaky_test_history.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ pub struct FlakyTestHistory {
1414
/// The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
1515
#[serde(rename = "commit_sha")]
1616
pub commit_sha: String,
17+
/// The policy that triggered this status change.
18+
#[serde(rename = "policy_id")]
19+
pub policy_id: Option<crate::datadogV2::model::FlakyTestHistoryPolicyId>,
20+
/// Metadata about the policy that triggered this status change.
21+
#[serde(rename = "policy_meta")]
22+
pub policy_meta: Option<crate::datadogV2::model::FlakyTestHistoryPolicyMeta>,
1723
/// The test status at this point in history.
1824
#[serde(rename = "status")]
1925
pub status: String,
@@ -31,13 +37,28 @@ impl FlakyTestHistory {
3137
pub fn new(commit_sha: String, status: String, timestamp: i64) -> FlakyTestHistory {
3238
FlakyTestHistory {
3339
commit_sha,
40+
policy_id: None,
41+
policy_meta: None,
3442
status,
3543
timestamp,
3644
additional_properties: std::collections::BTreeMap::new(),
3745
_unparsed: false,
3846
}
3947
}
4048

49+
pub fn policy_id(mut self, value: crate::datadogV2::model::FlakyTestHistoryPolicyId) -> Self {
50+
self.policy_id = Some(value);
51+
self
52+
}
53+
54+
pub fn policy_meta(
55+
mut self,
56+
value: crate::datadogV2::model::FlakyTestHistoryPolicyMeta,
57+
) -> Self {
58+
self.policy_meta = Some(value);
59+
self
60+
}
61+
4162
pub fn additional_properties(
4263
mut self,
4364
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -65,6 +86,9 @@ impl<'de> Deserialize<'de> for FlakyTestHistory {
6586
M: MapAccess<'a>,
6687
{
6788
let mut commit_sha: Option<String> = None;
89+
let mut policy_id: Option<crate::datadogV2::model::FlakyTestHistoryPolicyId> = None;
90+
let mut policy_meta: Option<crate::datadogV2::model::FlakyTestHistoryPolicyMeta> =
91+
None;
6892
let mut status: Option<String> = None;
6993
let mut timestamp: Option<i64> = None;
7094
let mut additional_properties: std::collections::BTreeMap<
@@ -78,6 +102,27 @@ impl<'de> Deserialize<'de> for FlakyTestHistory {
78102
"commit_sha" => {
79103
commit_sha = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
80104
}
105+
"policy_id" => {
106+
if v.is_null() {
107+
continue;
108+
}
109+
policy_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
110+
if let Some(ref _policy_id) = policy_id {
111+
match _policy_id {
112+
crate::datadogV2::model::FlakyTestHistoryPolicyId::UnparsedObject(_policy_id) => {
113+
_unparsed = true;
114+
},
115+
_ => {}
116+
}
117+
}
118+
}
119+
"policy_meta" => {
120+
if v.is_null() {
121+
continue;
122+
}
123+
policy_meta =
124+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
125+
}
81126
"status" => {
82127
status = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
83128
}
@@ -97,6 +142,8 @@ impl<'de> Deserialize<'de> for FlakyTestHistory {
97142

98143
let content = FlakyTestHistory {
99144
commit_sha,
145+
policy_id,
146+
policy_meta,
100147
status,
101148
timestamp,
102149
additional_properties,

0 commit comments

Comments
 (0)