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

Remove the application key from CreateCIAppPipelineEvent endpoint #2197

Merged
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
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": "2023-09-22 16:26:36.734279",
"spec_repo_commit": "45270a3e"
"regenerated": "2023-09-25 12:12:21.126055",
"spec_repo_commit": "5d002e79"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-09-22 16:26:36.748303",
"spec_repo_commit": "45270a3e"
"regenerated": "2023-09-25 12:12:21.142450",
"spec_repo_commit": "5d002e79"
}
}
}
2 changes: 2 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18158,6 +18158,8 @@ paths:
schema:
$ref: '#/components/schemas/HTTPCIAppErrors'
description: Service Unavailable
security:
- apiKeyAuth: []
summary: Send pipeline event
tags:
- CI Visibility Pipelines
Expand Down
1 change: 0 additions & 1 deletion api/datadogV2/api_ci_visibility_pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func (a *CIVisibilityPipelinesApi) CreateCIAppPipelineEvent(ctx _context.Context
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
Expand Down
25 changes: 16 additions & 9 deletions tests/scenarios/features/v2/ci_visibility_pipelines.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,36 @@ Feature: CI Visibility Pipelines

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

@generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
Scenario: Aggregate pipelines events returns "Bad Request" response
Given new "AggregateCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "AggregateCIAppPipelineEvents" request
And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "group_by": [{"facet": "@ci.status", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}}
When the request is sent
Then the response status is 400 Bad Request

@team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
Scenario: Aggregate pipelines events returns "OK" response
Given new "AggregateCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "AggregateCIAppPipelineEvents" request
And body with value {"compute": [{"aggregation": "pc90", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:(gitlab OR github)", "to": "now"}, "group_by": [{ "facet": "@ci.status", "limit": 10, "total": false}], "options": {"timezone": "GMT"}}
When the request is sent
Then the response status is 200 OK
And the response "meta.status" is equal to "done"

@generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
Scenario: Get a list of pipelines events returns "Bad Request" response
Given new "ListCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "ListCIAppPipelineEvents" request
When the request is sent
Then the response status is 400 Bad Request

@team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
Scenario: Get a list of pipelines events returns "OK" response
Given new "ListCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "ListCIAppPipelineEvents" request
And request contains "filter[query]" parameter with value "@ci.provider.name:circleci"
And request contains "filter[from]" parameter with value "{{ timeISO('now - 30m') }}"
And request contains "filter[to]" parameter with value "{{ timeISO('now') }}"
Expand All @@ -41,7 +44,8 @@ Feature: CI Visibility Pipelines

@replay-only @skip-validation @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries @with-pagination
Scenario: Get a list of pipelines events returns "OK" response with pagination
Given new "ListCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "ListCIAppPipelineEvents" request
And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}"
And request contains "filter[to]" parameter with value "{{ timeISO('now') }}"
And request contains "page[limit]" parameter with value 2
Expand All @@ -51,21 +55,24 @@ Feature: CI Visibility Pipelines

@generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
Scenario: Search pipelines events returns "Bad Request" response
Given new "SearchCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "SearchCIAppPipelineEvents" request
And body with value {"filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 400 Bad Request

@team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
Scenario: Search pipelines events returns "OK" response
Given new "SearchCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "SearchCIAppPipelineEvents" request
And body with value {"filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 5}, "sort": "timestamp"}
When the request is sent
Then the response status is 200 OK

@replay-only @skip-validation @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries @with-pagination
Scenario: Search pipelines events returns "OK" response with pagination
Given new "SearchCIAppPipelineEvents" request
Given a valid "appKeyAuth" key in the system
And new "SearchCIAppPipelineEvents" request
And body with value {"filter": {"from": "now-30s", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"}
When the request with pagination is sent
Then the response status is 200 OK
Expand Down