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
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-01-17 21:41:16.067400",
"spec_repo_commit": "27e609f7"
"regenerated": "2025-01-21 14:16:34.852439",
"spec_repo_commit": "0bbc13ae"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-17 21:41:16.082979",
"spec_repo_commit": "27e609f7"
"regenerated": "2025-01-21 14:16:34.867463",
"spec_repo_commit": "0bbc13ae"
}
}
}
3 changes: 3 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3552,6 +3552,9 @@ components:
env:
description: The Datadog environment.
type: string
provider_name:
description: The name of the CI provider. By default, this is "custom".
type: string
resource:
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestAttributesResource'
service:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-01-08T08:57:29.599Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Send pipeline event with custom provider returns "Request accepted for processing" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CIVisibilityPipelinesAPI.new

body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({
data: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestData.new({
attributes: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestAttributes.new({
provider_name: "example-provider",
resource: DatadogAPIClient::V2::CIAppPipelineEventFinishedPipeline.new({
level: DatadogAPIClient::V2::CIAppPipelineEventPipelineLevel::PIPELINE,
unique_id: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
name: "Deploy to AWS",
url: "https://my-ci-provider.example/pipelines/my-pipeline/run/1",
start: (Time.now + -120),
_end: (Time.now + -30),
status: DatadogAPIClient::V2::CIAppPipelineEventPipelineStatus::SUCCESS,
partial_retry: false,
git: DatadogAPIClient::V2::CIAppGitInfo.new({
repository_url: "https://github.com/DataDog/datadog-agent",
sha: "7f263865994b76066c4612fd1965215e7dcb4cd2",
author_email: "[email protected]",
}),
}),
}),
type: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST,
}),
})
p api_instance.create_ci_app_pipeline_event(body)
7 changes: 7 additions & 0 deletions features/v2/ci_visibility_pipelines.feature
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ Feature: CI Visibility Pipelines
When the request is sent
Then the response status is 202 Request accepted for processing

@team:Datadog/ci-app-backend
Scenario: Send pipeline event with custom provider returns "Request accepted for processing" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "[email protected]"}}},"type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 202 Request accepted for processing

@skip @team:Datadog/ci-app-backend
Scenario: Send pipeline job event returns "Request accepted for processing" response
Given new "CreateCIAppPipelineEvent" request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class CIAppCreatePipelineEventRequestAttributes
# The Datadog environment.
attr_accessor :env

# The name of the CI provider. By default, this is "custom".
attr_accessor :provider_name

# Details of the CI pipeline event.
attr_reader :resource

Expand All @@ -37,6 +40,7 @@ class CIAppCreatePipelineEventRequestAttributes
def self.attribute_map
{
:'env' => :'env',
:'provider_name' => :'provider_name',
:'resource' => :'resource',
:'service' => :'service'
}
Expand All @@ -47,6 +51,7 @@ def self.attribute_map
def self.openapi_types
{
:'env' => :'String',
:'provider_name' => :'String',
:'resource' => :'CIAppCreatePipelineEventRequestAttributesResource',
:'service' => :'String'
}
Expand Down Expand Up @@ -74,6 +79,10 @@ def initialize(attributes = {})
self.env = attributes[:'env']
end

if attributes.key?(:'provider_name')
self.provider_name = attributes[:'provider_name']
end

if attributes.key?(:'resource')
self.resource = attributes[:'resource']
end
Expand Down Expand Up @@ -128,6 +137,7 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
env == o.env &&
provider_name == o.provider_name &&
resource == o.resource &&
service == o.service &&
additional_properties == o.additional_properties
Expand All @@ -137,7 +147,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[env, resource, service, additional_properties].hash
[env, provider_name, resource, service, additional_properties].hash
end
end
end
Loading