Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS-10044] Fix outdated feature name in CI Visibility Tests API docs #2928

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-12 18:33:47.212408",
"spec_repo_commit": "6a4cfb82"
"regenerated": "2025-02-13 17:08:59.021556",
"spec_repo_commit": "393eda14"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-12 18:33:47.228609",
"spec_repo_commit": "6a4cfb82"
"regenerated": "2025-02-13 17:08:59.037647",
"spec_repo_commit": "393eda14"
}
}
}
25 changes: 11 additions & 14 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3741,7 +3741,7 @@ components:
properties:
attributes:
additionalProperties: {}
description: JSON object of attributes from CI Visibility test events.
description: JSON object of attributes from Test Optimization test events.
example:
customAttribute: 123
duration: 2345
Expand Down Expand Up @@ -35086,8 +35086,8 @@ paths:
- ci_visibility_read
/api/v2/ci/tests/analytics/aggregate:
post:
description: The API endpoint to aggregate CI Visibility test events into buckets
of computed metrics and timeseries.
description: The API endpoint to aggregate test events into buckets of computed
metrics and timeseries.
operationId: AggregateCIAppTestEvents
requestBody:
content:
Expand Down Expand Up @@ -35115,16 +35115,15 @@ paths:
- ci_visibility_read
summary: Aggregate tests events
tags:
- CI Visibility Tests
- Test Optimization
x-codegen-request-body-name: body
x-permission:
operator: OR
permissions:
- ci_visibility_read
/api/v2/ci/tests/events:
get:
description: 'List endpoint returns CI Visibility test events that match a [search
query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).
description: 'List endpoint returns test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).

[Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination).

Expand Down Expand Up @@ -35199,7 +35198,7 @@ paths:
- ci_visibility_read
summary: Get a list of tests events
tags:
- CI Visibility Tests
- Test Optimization
x-pagination:
cursorParam: page[cursor]
cursorPath: meta.page.after
Expand All @@ -35211,8 +35210,7 @@ paths:
- ci_visibility_read
/api/v2/ci/tests/events/search:
post:
description: 'List endpoint returns CI Visibility test events that match a [search
query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).
description: 'List endpoint returns test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).

[Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination).

Expand Down Expand Up @@ -35245,7 +35243,7 @@ paths:
- ci_visibility_read
summary: Search tests events
tags:
- CI Visibility Tests
- Test Optimization
x-codegen-request-body-name: body
x-pagination:
cursorParam: body.page.cursor
Expand Down Expand Up @@ -51224,10 +51222,6 @@ tags:
to your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog page](https://docs.datadoghq.com/continuous_integration/pipelines/)
for more information.
name: CI Visibility Pipelines
- description: Search or aggregate your CI Visibility test events over HTTP. See the
[Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more
information.
name: CI Visibility Tests
- description: 'Datadog Cloud Security Management (CSM) delivers real-time threat
detection

Expand Down Expand Up @@ -51574,6 +51568,9 @@ tags:
- description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/)
for more information.
name: Teams
- description: Search or aggregate your test events over HTTP. See the [Test Optimization
in Datadog](https://docs.datadoghq.com/tests/) page for more information.
name: Test Optimization
- description: 'The usage metering API allows you to get hourly, daily, and

monthly usage across multiple facets of Datadog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// CIVisibilityTestsApi service type
type CIVisibilityTestsApi datadog.Service
// TestOptimizationApi service type
type TestOptimizationApi datadog.Service

// AggregateCIAppTestEvents Aggregate tests events.
// The API endpoint to aggregate CI Visibility test events into buckets of computed metrics and timeseries.
func (a *CIVisibilityTestsApi) AggregateCIAppTestEvents(ctx _context.Context, body CIAppTestsAggregateRequest) (CIAppTestsAnalyticsAggregateResponse, *_nethttp.Response, error) {
// The API endpoint to aggregate test events into buckets of computed metrics and timeseries.
func (a *TestOptimizationApi) AggregateCIAppTestEvents(ctx _context.Context, body CIAppTestsAggregateRequest) (CIAppTestsAnalyticsAggregateResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
localVarReturnValue CIAppTestsAnalyticsAggregateResponse
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CIVisibilityTestsApi.AggregateCIAppTestEvents")
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.TestOptimizationApi.AggregateCIAppTestEvents")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}
Expand Down Expand Up @@ -142,11 +142,11 @@ func (r *ListCIAppTestEventsOptionalParameters) WithPageLimit(pageLimit int32) *
}

// ListCIAppTestEvents Get a list of tests events.
// List endpoint returns CI Visibility test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).
// List endpoint returns test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).
// [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination).
//
// Use this endpoint to see your latest test events.
func (a *CIVisibilityTestsApi) ListCIAppTestEvents(ctx _context.Context, o ...ListCIAppTestEventsOptionalParameters) (CIAppTestEventsResponse, *_nethttp.Response, error) {
func (a *TestOptimizationApi) ListCIAppTestEvents(ctx _context.Context, o ...ListCIAppTestEventsOptionalParameters) (CIAppTestEventsResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
Expand All @@ -161,7 +161,7 @@ func (a *CIVisibilityTestsApi) ListCIAppTestEvents(ctx _context.Context, o ...Li
optionalParams = o[0]
}

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CIVisibilityTestsApi.ListCIAppTestEvents")
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.TestOptimizationApi.ListCIAppTestEvents")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}
Expand Down Expand Up @@ -241,7 +241,7 @@ func (a *CIVisibilityTestsApi) ListCIAppTestEvents(ctx _context.Context, o ...Li
}

// ListCIAppTestEventsWithPagination provides a paginated version of ListCIAppTestEvents returning a channel with all items.
func (a *CIVisibilityTestsApi) ListCIAppTestEventsWithPagination(ctx _context.Context, o ...ListCIAppTestEventsOptionalParameters) (<-chan datadog.PaginationResult[CIAppTestEvent], func()) {
func (a *TestOptimizationApi) ListCIAppTestEventsWithPagination(ctx _context.Context, o ...ListCIAppTestEventsOptionalParameters) (<-chan datadog.PaginationResult[CIAppTestEvent], func()) {
ctx, cancel := _context.WithCancel(ctx)
pageSize_ := int32(10)
if len(o) == 0 {
Expand Down Expand Up @@ -316,11 +316,11 @@ func (r *SearchCIAppTestEventsOptionalParameters) WithBody(body CIAppTestEventsR
}

// SearchCIAppTestEvents Search tests events.
// List endpoint returns CI Visibility test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).
// List endpoint returns test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).
// [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination).
//
// Use this endpoint to build complex events filtering and search.
func (a *CIVisibilityTestsApi) SearchCIAppTestEvents(ctx _context.Context, o ...SearchCIAppTestEventsOptionalParameters) (CIAppTestEventsResponse, *_nethttp.Response, error) {
func (a *TestOptimizationApi) SearchCIAppTestEvents(ctx _context.Context, o ...SearchCIAppTestEventsOptionalParameters) (CIAppTestEventsResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
Expand All @@ -335,7 +335,7 @@ func (a *CIVisibilityTestsApi) SearchCIAppTestEvents(ctx _context.Context, o ...
optionalParams = o[0]
}

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CIVisibilityTestsApi.SearchCIAppTestEvents")
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.TestOptimizationApi.SearchCIAppTestEvents")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}
Expand Down Expand Up @@ -402,7 +402,7 @@ func (a *CIVisibilityTestsApi) SearchCIAppTestEvents(ctx _context.Context, o ...
}

// SearchCIAppTestEventsWithPagination provides a paginated version of SearchCIAppTestEvents returning a channel with all items.
func (a *CIVisibilityTestsApi) SearchCIAppTestEventsWithPagination(ctx _context.Context, o ...SearchCIAppTestEventsOptionalParameters) (<-chan datadog.PaginationResult[CIAppTestEvent], func()) {
func (a *TestOptimizationApi) SearchCIAppTestEventsWithPagination(ctx _context.Context, o ...SearchCIAppTestEventsOptionalParameters) (<-chan datadog.PaginationResult[CIAppTestEvent], func()) {
ctx, cancel := _context.WithCancel(ctx)
pageSize_ := int32(10)
if len(o) == 0 {
Expand Down Expand Up @@ -465,9 +465,9 @@ func (a *CIVisibilityTestsApi) SearchCIAppTestEventsWithPagination(ctx _context.
return items, cancel
}

// NewCIVisibilityTestsApi Returns NewCIVisibilityTestsApi.
func NewCIVisibilityTestsApi(client *datadog.APIClient) *CIVisibilityTestsApi {
return &CIVisibilityTestsApi{
// NewTestOptimizationApi Returns NewTestOptimizationApi.
func NewTestOptimizationApi(client *datadog.APIClient) *TestOptimizationApi {
return &TestOptimizationApi{
Client: client,
}
}
6 changes: 3 additions & 3 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
// - [CIVisibilityPipelinesApi.CreateCIAppPipelineEvent]
// - [CIVisibilityPipelinesApi.ListCIAppPipelineEvents]
// - [CIVisibilityPipelinesApi.SearchCIAppPipelineEvents]
// - [CIVisibilityTestsApi.AggregateCIAppTestEvents]
// - [CIVisibilityTestsApi.ListCIAppTestEvents]
// - [CIVisibilityTestsApi.SearchCIAppTestEvents]
// - [CSMAgentsApi.ListAllCSMAgents]
// - [CSMAgentsApi.ListAllCSMServerlessAgents]
// - [CSMCoverageAnalysisApi.GetCSMCloudAccountsCoverageAnalysis]
Expand Down Expand Up @@ -408,6 +405,9 @@
// - [TeamsApi.UpdateTeamLink]
// - [TeamsApi.UpdateTeamMembership]
// - [TeamsApi.UpdateTeamPermissionSetting]
// - [TestOptimizationApi.AggregateCIAppTestEvents]
// - [TestOptimizationApi.ListCIAppTestEvents]
// - [TestOptimizationApi.SearchCIAppTestEvents]
// - [UsageMeteringApi.GetActiveBillingDimensions]
// - [UsageMeteringApi.GetBillingDimensionMapping]
// - [UsageMeteringApi.GetCostByOrg]
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/model_ci_app_event_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// CIAppEventAttributes JSON object containing all event attributes and their associated values.
type CIAppEventAttributes struct {
// JSON object of attributes from CI Visibility test events.
// JSON object of attributes from Test Optimization test events.
Attributes map[string]interface{} `json:"attributes,omitempty"`
// Array of tags associated with your event.
Tags []string `json:"tags,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCIVisibilityTestsApi(apiClient)
api := datadogV2.NewTestOptimizationApi(apiClient)
resp, r, err := api.AggregateCIAppTestEvents(ctx, body)

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.AggregateCIAppTestEvents`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `TestOptimizationApi.AggregateCIAppTestEvents`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CIVisibilityTestsApi.AggregateCIAppTestEvents`:\n%s\n", responseContent)
fmt.Fprintf(os.Stdout, "Response from `TestOptimizationApi.AggregateCIAppTestEvents`:\n%s\n", responseContent)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCIVisibilityTestsApi(apiClient)
api := datadogV2.NewTestOptimizationApi(apiClient)
resp, r, err := api.ListCIAppTestEvents(ctx, *datadogV2.NewListCIAppTestEventsOptionalParameters().WithFilterQuery("@test.service:web-ui-tests").WithFilterFrom(time.Now().Add(time.Second * -30)).WithFilterTo(time.Now()).WithPageLimit(5))

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.ListCIAppTestEvents`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `TestOptimizationApi.ListCIAppTestEvents`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CIVisibilityTestsApi.ListCIAppTestEvents`:\n%s\n", responseContent)
fmt.Fprintf(os.Stdout, "Response from `TestOptimizationApi.ListCIAppTestEvents`:\n%s\n", responseContent)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCIVisibilityTestsApi(apiClient)
api := datadogV2.NewTestOptimizationApi(apiClient)
resp, _ := api.ListCIAppTestEventsWithPagination(ctx, *datadogV2.NewListCIAppTestEventsOptionalParameters().WithFilterFrom(time.Now().Add(time.Second * -30)).WithFilterTo(time.Now()).WithPageLimit(2))

for paginationResult := range resp {
if paginationResult.Error != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.ListCIAppTestEvents`: %v\n", paginationResult.Error)
fmt.Fprintf(os.Stderr, "Error when calling `TestOptimizationApi.ListCIAppTestEvents`: %v\n", paginationResult.Error)
}
responseContent, _ := json.MarshalIndent(paginationResult.Item, "", " ")
fmt.Fprintf(os.Stdout, "%s\n", responseContent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCIVisibilityTestsApi(apiClient)
api := datadogV2.NewTestOptimizationApi(apiClient)
resp, r, err := api.SearchCIAppTestEvents(ctx, *datadogV2.NewSearchCIAppTestEventsOptionalParameters().WithBody(body))

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.SearchCIAppTestEvents`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `TestOptimizationApi.SearchCIAppTestEvents`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CIVisibilityTestsApi.SearchCIAppTestEvents`:\n%s\n", responseContent)
fmt.Fprintf(os.Stdout, "Response from `TestOptimizationApi.SearchCIAppTestEvents`:\n%s\n", responseContent)
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCIVisibilityTestsApi(apiClient)
api := datadogV2.NewTestOptimizationApi(apiClient)
resp, _ := api.SearchCIAppTestEventsWithPagination(ctx, *datadogV2.NewSearchCIAppTestEventsOptionalParameters().WithBody(body))

for paginationResult := range resp {
if paginationResult.Error != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.SearchCIAppTestEvents`: %v\n", paginationResult.Error)
fmt.Fprintf(os.Stderr, "Error when calling `TestOptimizationApi.SearchCIAppTestEvents`: %v\n", paginationResult.Error)
}
responseContent, _ := json.MarshalIndent(paginationResult.Item, "", " ")
fmt.Fprintf(os.Stdout, "%s\n", responseContent)
Expand Down
2 changes: 1 addition & 1 deletion tests/scenarios/api_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var apiMappings = map[string]map[string]reflect.Value{
"CaseManagementApi": reflect.ValueOf(datadogV2.NewCaseManagementApi),
"SoftwareCatalogApi": reflect.ValueOf(datadogV2.NewSoftwareCatalogApi),
"CIVisibilityPipelinesApi": reflect.ValueOf(datadogV2.NewCIVisibilityPipelinesApi),
"CIVisibilityTestsApi": reflect.ValueOf(datadogV2.NewCIVisibilityTestsApi),
"TestOptimizationApi": reflect.ValueOf(datadogV2.NewTestOptimizationApi),
"ContainerImagesApi": reflect.ValueOf(datadogV2.NewContainerImagesApi),
"ContainersApi": reflect.ValueOf(datadogV2.NewContainersApi),
"CloudCostManagementApi": reflect.ValueOf(datadogV2.NewCloudCostManagementApi),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
@endpoint(ci-visibility-tests) @endpoint(ci-visibility-tests-v2)
Feature: CI Visibility Tests
Search or aggregate your CI Visibility test events over HTTP. See the
[Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for
more information.
@endpoint(test-optimization) @endpoint(test-optimization-v2)
Feature: Test Optimization
Search or aggregate your test events over HTTP. See the [Test Optimization
in Datadog](https://docs.datadoghq.com/tests/) page for more information.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "CIVisibilityTests" API
And an instance of "TestOptimization" API

@generated @skip @team:Datadog/ci-app-backend
Scenario: Aggregate tests events returns "Bad Request" response
Expand Down
6 changes: 3 additions & 3 deletions tests/scenarios/features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,19 +453,19 @@
}
},
"AggregateCIAppTestEvents": {
"tag": "CI Visibility Tests",
"tag": "Test Optimization",
"undo": {
"type": "safe"
}
},
"ListCIAppTestEvents": {
"tag": "CI Visibility Tests",
"tag": "Test Optimization",
"undo": {
"type": "safe"
}
},
"SearchCIAppTestEvents": {
"tag": "CI Visibility Tests",
"tag": "Test Optimization",
"undo": {
"type": "safe"
}
Expand Down