Skip to content

Commit abc3bc1

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bdcc8b5 of spec repo
1 parent b481b06 commit abc3bc1

File tree

11 files changed

+1138
-51
lines changed

11 files changed

+1138
-51
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.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public static void main(String[] args) {
2727
new FlakyTestsSearchRequestAttributes()
2828
.filter(
2929
new FlakyTestsSearchFilter()
30+
.includeHistory(true)
3031
.query(
3132
"""
3233
flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"
3334
"""))
34-
.includeHistory(true)
3535
.page(
3636
new FlakyTestsSearchPageOptions()
3737
.cursor(

examples/v2/test-optimization/SearchFlakyTests_1224086727.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public static void main(String[] args) {
2727
new FlakyTestsSearchRequestAttributes()
2828
.filter(
2929
new FlakyTestsSearchFilter()
30+
.includeHistory(true)
3031
.query(
3132
"""
3233
flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"
3334
"""))
34-
.includeHistory(true)
3535
.page(
3636
new FlakyTestsSearchPageOptions()
3737
.cursor(

examples/v2/test-optimization/SearchFlakyTests_209064879.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public static void main(String[] args) {
3030
.query(
3131
"""
3232
flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"
33-
"""))
33+
""")
34+
.includeHistory(true))
3435
.page(new FlakyTestsSearchPageOptions().limit(10L))
35-
.sort(FlakyTestsSearchSort.FQN_ASCENDING)
36-
.includeHistory(true))
36+
.sort(FlakyTestsSearchSort.FQN_ASCENDING))
3737
.type(FlakyTestsSearchRequestDataType.SEARCH_FLAKY_TESTS_REQUEST));
3838

3939
try {

src/main/java/com/datadog/api/client/v2/model/FlakyTestHistory.java

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
/** A single history entry representing a status change for a flaky test. */
2121
@JsonPropertyOrder({
2222
FlakyTestHistory.JSON_PROPERTY_COMMIT_SHA,
23+
FlakyTestHistory.JSON_PROPERTY_POLICY_ID,
24+
FlakyTestHistory.JSON_PROPERTY_POLICY_META,
2325
FlakyTestHistory.JSON_PROPERTY_STATUS,
2426
FlakyTestHistory.JSON_PROPERTY_TIMESTAMP
2527
})
@@ -30,6 +32,12 @@ public class FlakyTestHistory {
3032
public static final String JSON_PROPERTY_COMMIT_SHA = "commit_sha";
3133
private String commitSha;
3234

35+
public static final String JSON_PROPERTY_POLICY_ID = "policy_id";
36+
private FlakyTestHistoryPolicyId policyId;
37+
38+
public static final String JSON_PROPERTY_POLICY_META = "policy_meta";
39+
private FlakyTestHistoryPolicyMeta policyMeta;
40+
3341
public static final String JSON_PROPERTY_STATUS = "status";
3442
private String status;
3543

@@ -69,6 +77,53 @@ public void setCommitSha(String commitSha) {
6977
this.commitSha = commitSha;
7078
}
7179

80+
public FlakyTestHistory policyId(FlakyTestHistoryPolicyId policyId) {
81+
this.policyId = policyId;
82+
this.unparsed |= !policyId.isValid();
83+
return this;
84+
}
85+
86+
/**
87+
* The policy that triggered this status change.
88+
*
89+
* @return policyId
90+
*/
91+
@jakarta.annotation.Nullable
92+
@JsonProperty(JSON_PROPERTY_POLICY_ID)
93+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
94+
public FlakyTestHistoryPolicyId getPolicyId() {
95+
return policyId;
96+
}
97+
98+
public void setPolicyId(FlakyTestHistoryPolicyId policyId) {
99+
if (!policyId.isValid()) {
100+
this.unparsed = true;
101+
}
102+
this.policyId = policyId;
103+
}
104+
105+
public FlakyTestHistory policyMeta(FlakyTestHistoryPolicyMeta policyMeta) {
106+
this.policyMeta = policyMeta;
107+
this.unparsed |= policyMeta.unparsed;
108+
return this;
109+
}
110+
111+
/**
112+
* Metadata about the policy that triggered this status change.
113+
*
114+
* @return policyMeta
115+
*/
116+
@jakarta.annotation.Nullable
117+
@JsonProperty(JSON_PROPERTY_POLICY_META)
118+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
119+
public FlakyTestHistoryPolicyMeta getPolicyMeta() {
120+
return policyMeta;
121+
}
122+
123+
public void setPolicyMeta(FlakyTestHistoryPolicyMeta policyMeta) {
124+
this.policyMeta = policyMeta;
125+
}
126+
72127
public FlakyTestHistory status(String status) {
73128
this.status = status;
74129
return this;
@@ -166,21 +221,25 @@ public boolean equals(Object o) {
166221
}
167222
FlakyTestHistory flakyTestHistory = (FlakyTestHistory) o;
168223
return Objects.equals(this.commitSha, flakyTestHistory.commitSha)
224+
&& Objects.equals(this.policyId, flakyTestHistory.policyId)
225+
&& Objects.equals(this.policyMeta, flakyTestHistory.policyMeta)
169226
&& Objects.equals(this.status, flakyTestHistory.status)
170227
&& Objects.equals(this.timestamp, flakyTestHistory.timestamp)
171228
&& Objects.equals(this.additionalProperties, flakyTestHistory.additionalProperties);
172229
}
173230

174231
@Override
175232
public int hashCode() {
176-
return Objects.hash(commitSha, status, timestamp, additionalProperties);
233+
return Objects.hash(commitSha, policyId, policyMeta, status, timestamp, additionalProperties);
177234
}
178235

179236
@Override
180237
public String toString() {
181238
StringBuilder sb = new StringBuilder();
182239
sb.append("class FlakyTestHistory {\n");
183240
sb.append(" commitSha: ").append(toIndentedString(commitSha)).append("\n");
241+
sb.append(" policyId: ").append(toIndentedString(policyId)).append("\n");
242+
sb.append(" policyMeta: ").append(toIndentedString(policyMeta)).append("\n");
184243
sb.append(" status: ").append(toIndentedString(status)).append("\n");
185244
sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n");
186245
sb.append(" additionalProperties: ")

0 commit comments

Comments
 (0)