Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 222 additions & 3 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions api/datadogV2/api_test_optimization.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ func (r *SearchFlakyTestsOptionalParameters) WithBody(body FlakyTestsSearchReque

// SearchFlakyTests Search flaky tests.
// List endpoint returning flaky tests from Flaky Test Management. Results are paginated.
//
// The response includes comprehensive test information including:
// - Test identification and metadata (module, suite, name)
// - Flaky state and categorization
// - First and last flake occurrences (timestamp, branch, commit SHA)
// - Test execution statistics from the last 7 days (failure rate)
// - Pipeline impact metrics (failed pipelines count, total lost time)
// - Complete status change history (optional, ordered from most recent to oldest)
//
// Set `include_history` to `true` in the request to receive the status change history for each test.
// History is disabled by default for better performance.
//
// Results support filtering by various facets including service, environment, repository, branch, and test state.
func (a *TestOptimizationApi) SearchFlakyTests(ctx _context.Context, o ...SearchFlakyTestsOptionalParameters) (FlakyTestsSearchResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
Expand Down
47 changes: 41 additions & 6 deletions api/datadogV2/model_azure_storage_destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
type AzureStorageDestination struct {
// Optional prefix for blobs written to the container.
BlobPrefix *string `json:"blob_prefix,omitempty"`
// Configuration for buffer settings on destination components.
Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"`
// The name of the Azure Blob Storage container to store logs in.
ContainerName string `json:"container_name"`
// The unique identifier for this component.
Expand Down Expand Up @@ -80,6 +82,34 @@ func (o *AzureStorageDestination) SetBlobPrefix(v string) {
o.BlobPrefix = &v
}

// GetBuffer returns the Buffer field value if set, zero value otherwise.
func (o *AzureStorageDestination) GetBuffer() ObservabilityPipelineBufferOptions {
if o == nil || o.Buffer == nil {
var ret ObservabilityPipelineBufferOptions
return ret
}
return *o.Buffer
}

// GetBufferOk returns a tuple with the Buffer field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AzureStorageDestination) GetBufferOk() (*ObservabilityPipelineBufferOptions, bool) {
if o == nil || o.Buffer == nil {
return nil, false
}
return o.Buffer, true
}

// HasBuffer returns a boolean if a field has been set.
func (o *AzureStorageDestination) HasBuffer() bool {
return o != nil && o.Buffer != nil
}

// SetBuffer gets a reference to the given ObservabilityPipelineBufferOptions and assigns it to the Buffer field.
func (o *AzureStorageDestination) SetBuffer(v ObservabilityPipelineBufferOptions) {
o.Buffer = &v
}

// GetContainerName returns the ContainerName field value.
func (o *AzureStorageDestination) GetContainerName() string {
if o == nil {
Expand Down Expand Up @@ -181,6 +211,9 @@ func (o AzureStorageDestination) MarshalJSON() ([]byte, error) {
if o.BlobPrefix != nil {
toSerialize["blob_prefix"] = o.BlobPrefix
}
if o.Buffer != nil {
toSerialize["buffer"] = o.Buffer
}
toSerialize["container_name"] = o.ContainerName
toSerialize["id"] = o.Id
toSerialize["inputs"] = o.Inputs
Expand All @@ -195,11 +228,12 @@ func (o AzureStorageDestination) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *AzureStorageDestination) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
BlobPrefix *string `json:"blob_prefix,omitempty"`
ContainerName *string `json:"container_name"`
Id *string `json:"id"`
Inputs *[]string `json:"inputs"`
Type *AzureStorageDestinationType `json:"type"`
BlobPrefix *string `json:"blob_prefix,omitempty"`
Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"`
ContainerName *string `json:"container_name"`
Id *string `json:"id"`
Inputs *[]string `json:"inputs"`
Type *AzureStorageDestinationType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -218,13 +252,14 @@ func (o *AzureStorageDestination) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"blob_prefix", "container_name", "id", "inputs", "type"})
datadog.DeleteKeys(additionalProperties, &[]string{"blob_prefix", "buffer", "container_name", "id", "inputs", "type"})
} else {
return err
}

hasInvalidField := false
o.BlobPrefix = all.BlobPrefix
o.Buffer = all.Buffer
o.ContainerName = *all.ContainerName
o.Id = *all.Id
o.Inputs = *all.Inputs
Expand Down
38 changes: 37 additions & 1 deletion api/datadogV2/model_flaky_test_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ type FlakyTestAttributes struct {
FlakyCategory datadog.NullableString `json:"flaky_category,omitempty"`
// The current state of the flaky test.
FlakyState *FlakyTestAttributesFlakyState `json:"flaky_state,omitempty"`
// Chronological history of status changes for this flaky test, ordered from most recent to oldest.
// Includes state transitions like new -> quarantined -> fixed, along with the associated commit SHA when available.
History []FlakyTestHistory `json:"history,omitempty"`
// The branch name where the test exhibited flakiness for the last time.
LastFlakedBranch *string `json:"last_flaked_branch,omitempty"`
// The commit SHA where the test exhibited flakiness for the last time.
Expand Down Expand Up @@ -314,6 +317,34 @@ func (o *FlakyTestAttributes) SetFlakyState(v FlakyTestAttributesFlakyState) {
o.FlakyState = &v
}

// GetHistory returns the History field value if set, zero value otherwise.
func (o *FlakyTestAttributes) GetHistory() []FlakyTestHistory {
if o == nil || o.History == nil {
var ret []FlakyTestHistory
return ret
}
return o.History
}

// GetHistoryOk returns a tuple with the History field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlakyTestAttributes) GetHistoryOk() (*[]FlakyTestHistory, bool) {
if o == nil || o.History == nil {
return nil, false
}
return &o.History, true
}

// HasHistory returns a boolean if a field has been set.
func (o *FlakyTestAttributes) HasHistory() bool {
return o != nil && o.History != nil
}

// SetHistory gets a reference to the given []FlakyTestHistory and assigns it to the History field.
func (o *FlakyTestAttributes) SetHistory(v []FlakyTestHistory) {
o.History = v
}

// GetLastFlakedBranch returns the LastFlakedBranch field value if set, zero value otherwise.
func (o *FlakyTestAttributes) GetLastFlakedBranch() string {
if o == nil || o.LastFlakedBranch == nil {
Expand Down Expand Up @@ -635,6 +666,9 @@ func (o FlakyTestAttributes) MarshalJSON() ([]byte, error) {
if o.FlakyState != nil {
toSerialize["flaky_state"] = o.FlakyState
}
if o.History != nil {
toSerialize["history"] = o.History
}
if o.LastFlakedBranch != nil {
toSerialize["last_flaked_branch"] = o.LastFlakedBranch
}
Expand Down Expand Up @@ -683,6 +717,7 @@ func (o *FlakyTestAttributes) UnmarshalJSON(bytes []byte) (err error) {
FirstFlakedTs *int64 `json:"first_flaked_ts,omitempty"`
FlakyCategory datadog.NullableString `json:"flaky_category,omitempty"`
FlakyState *FlakyTestAttributesFlakyState `json:"flaky_state,omitempty"`
History []FlakyTestHistory `json:"history,omitempty"`
LastFlakedBranch *string `json:"last_flaked_branch,omitempty"`
LastFlakedSha *string `json:"last_flaked_sha,omitempty"`
LastFlakedTs *int64 `json:"last_flaked_ts,omitempty"`
Expand All @@ -699,7 +734,7 @@ func (o *FlakyTestAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"attempt_to_fix_id", "codeowners", "envs", "first_flaked_branch", "first_flaked_sha", "first_flaked_ts", "flaky_category", "flaky_state", "last_flaked_branch", "last_flaked_sha", "last_flaked_ts", "module", "name", "pipeline_stats", "services", "suite", "test_run_metadata", "test_stats"})
datadog.DeleteKeys(additionalProperties, &[]string{"attempt_to_fix_id", "codeowners", "envs", "first_flaked_branch", "first_flaked_sha", "first_flaked_ts", "flaky_category", "flaky_state", "history", "last_flaked_branch", "last_flaked_sha", "last_flaked_ts", "module", "name", "pipeline_stats", "services", "suite", "test_run_metadata", "test_stats"})
} else {
return err
}
Expand All @@ -717,6 +752,7 @@ func (o *FlakyTestAttributes) UnmarshalJSON(bytes []byte) (err error) {
} else {
o.FlakyState = all.FlakyState
}
o.History = all.History
o.LastFlakedBranch = all.LastFlakedBranch
o.LastFlakedSha = all.LastFlakedSha
o.LastFlakedTs = all.LastFlakedTs
Expand Down
165 changes: 165 additions & 0 deletions api/datadogV2/model_flaky_test_history.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

package datadogV2

import (
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// FlakyTestHistory A single history entry representing a status change for a flaky test.
type FlakyTestHistory struct {
// The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
CommitSha string `json:"commit_sha"`
// The test status at this point in history.
Status string `json:"status"`
// Unix timestamp in milliseconds when this status change occurred.
Timestamp int64 `json:"timestamp"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
}

// NewFlakyTestHistory instantiates a new FlakyTestHistory object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewFlakyTestHistory(commitSha string, status string, timestamp int64) *FlakyTestHistory {
this := FlakyTestHistory{}
this.CommitSha = commitSha
this.Status = status
this.Timestamp = timestamp
return &this
}

// NewFlakyTestHistoryWithDefaults instantiates a new FlakyTestHistory object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewFlakyTestHistoryWithDefaults() *FlakyTestHistory {
this := FlakyTestHistory{}
return &this
}

// GetCommitSha returns the CommitSha field value.
func (o *FlakyTestHistory) GetCommitSha() string {
if o == nil {
var ret string
return ret
}
return o.CommitSha
}

// GetCommitShaOk returns a tuple with the CommitSha field value
// and a boolean to check if the value has been set.
func (o *FlakyTestHistory) GetCommitShaOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CommitSha, true
}

// SetCommitSha sets field value.
func (o *FlakyTestHistory) SetCommitSha(v string) {
o.CommitSha = v
}

// GetStatus returns the Status field value.
func (o *FlakyTestHistory) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}

// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *FlakyTestHistory) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}

// SetStatus sets field value.
func (o *FlakyTestHistory) SetStatus(v string) {
o.Status = v
}

// GetTimestamp returns the Timestamp field value.
func (o *FlakyTestHistory) GetTimestamp() int64 {
if o == nil {
var ret int64
return ret
}
return o.Timestamp
}

// GetTimestampOk returns a tuple with the Timestamp field value
// and a boolean to check if the value has been set.
func (o *FlakyTestHistory) GetTimestampOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.Timestamp, true
}

// SetTimestamp sets field value.
func (o *FlakyTestHistory) SetTimestamp(v int64) {
o.Timestamp = v
}

// MarshalJSON serializes the struct using spec logic.
func (o FlakyTestHistory) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
toSerialize["commit_sha"] = o.CommitSha
toSerialize["status"] = o.Status
toSerialize["timestamp"] = o.Timestamp

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *FlakyTestHistory) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CommitSha *string `json:"commit_sha"`
Status *string `json:"status"`
Timestamp *int64 `json:"timestamp"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.CommitSha == nil {
return fmt.Errorf("required field commit_sha missing")
}
if all.Status == nil {
return fmt.Errorf("required field status missing")
}
if all.Timestamp == nil {
return fmt.Errorf("required field timestamp missing")
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"commit_sha", "status", "timestamp"})
} else {
return err
}
o.CommitSha = *all.CommitSha
o.Status = *all.Status
o.Timestamp = *all.Timestamp

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
Loading
Loading