Skip to content
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
15 changes: 14 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5847,7 +5847,7 @@ components:
description: Request object.
properties:
data:
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestData'
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestDataSingleOrArray'
type: object
CIAppCreatePipelineEventRequestAttributes:
description: Attributes of the pipeline event to create.
Expand Down Expand Up @@ -5883,6 +5883,16 @@ components:
type:
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestDataType'
type: object
CIAppCreatePipelineEventRequestDataArray:
description: Array of pipeline events to create in batch.
items:
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestData'
type: array
CIAppCreatePipelineEventRequestDataSingleOrArray:
description: Data of the pipeline events to create.
oneOf:
- $ref: '#/components/schemas/CIAppCreatePipelineEventRequestData'
- $ref: '#/components/schemas/CIAppCreatePipelineEventRequestDataArray'
CIAppCreatePipelineEventRequestDataType:
default: cipipeline_resource_request
description: Type of the event.
Expand Down Expand Up @@ -49695,6 +49705,9 @@ paths:
we support, see [Pipeline Data Model And Execution Types](https://docs.datadoghq.com/continuous_integration/guides/pipeline_data_model/).


Multiple events can be sent in an array (up to 1000).


Pipeline events can be submitted with a timestamp that is up to 18 hours in
the past.'
operationId: CreateCIAppPipelineEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-09-02T15:10:26.479Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"log": {
"_recordingName": "CI Visibility Pipelines/Send several pipeline events returns \"Request accepted for processing\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "072988315f64383f647bdf106bca8593",
"_order": 0,
"cache": {},
"request": {
"bodySize": 1069,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 509,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"data\":[{\"attributes\":{\"provider_name\":\"example-provider\",\"resource\":{\"end\":\"2025-09-02T15:09:56.479Z\",\"git\":{\"author_email\":\"[email protected]\",\"repository_url\":\"https://github.com/DataDog/datadog-agent\",\"sha\":\"7f263865994b76066c4612fd1965215e7dcb4cd2\"},\"level\":\"pipeline\",\"name\":\"Deploy to AWS\",\"partial_retry\":false,\"start\":\"2025-09-02T15:08:26.479Z\",\"status\":\"success\",\"unique_id\":\"3eacb6f3-ff04-4e10-8a9c-46e6d054024a\",\"url\":\"https://my-ci-provider.example/pipelines/my-pipeline/run/1\"}},\"type\":\"cipipeline_resource_request\"},{\"attributes\":{\"provider_name\":\"example-provider\",\"resource\":{\"end\":\"2025-09-02T15:09:41.479Z\",\"git\":{\"author_email\":\"[email protected]\",\"repository_url\":\"https://github.com/DataDog/datadog-agent\",\"sha\":\"9a4f7c28b3e5d12f8e6c9b2a5d8f3e1c7b4a6d9e\"},\"level\":\"pipeline\",\"name\":\"Deploy to Production\",\"partial_retry\":false,\"start\":\"2025-09-02T15:07:26.479Z\",\"status\":\"success\",\"unique_id\":\"7b2c8f9e-aa15-4d22-9c7d-83f4e065138b\",\"url\":\"https://my-ci-provider.example/pipelines/prod-pipeline/run/2\"}},\"type\":\"cipipeline_resource_request\"}]}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/ci/pipeline"
},
"response": {
"bodySize": 13,
"content": {
"mimeType": "application/vnd.api+json",
"size": 13,
"text": "{\"data\":null}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/vnd.api+json"
}
],
"headersSize": 676,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 202,
"statusText": "Accepted"
},
"startedDateTime": "2025-09-02T15:10:26.749Z",
"time": 396
}
],
"pages": [],
"version": "1.2"
}
}
7 changes: 7 additions & 0 deletions features/v2/ci_visibility_pipelines.feature
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,10 @@ Feature: CI Visibility Pipelines
And body with value {"data": {"attributes": {"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') }}","status": "running","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

@team:DataDog/ci-app-backend
Scenario: Send several pipeline events 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"},{"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "7b2c8f9e-aa15-4d22-9c7d-83f4e065138b","name": "Deploy to Production","url": "https://my-ci-provider.example/pipelines/prod-pipeline/run/2","start": "{{ timeISO('now - 180s') }}","end": "{{ timeISO('now - 45s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "9a4f7c28b3e5d12f8e6c9b2a5d8f3e1c7b4a6d9e","author_email": "[email protected]"}}},"type": "cipipeline_resource_request"}]}
When the request is sent
Then the response status is 202 Request accepted for processing
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ export class CIVisibilityPipelinesApi {
/**
* Send your pipeline event to your Datadog platform over HTTP. For details about how pipeline executions are modeled and what execution types we support, see [Pipeline Data Model And Execution Types](https://docs.datadoghq.com/continuous_integration/guides/pipeline_data_model/).
*
* Multiple events can be sent in an array (up to 1000).
*
* Pipeline events can be submitted with a timestamp that is up to 18 hours in the past.
* @param param The request object
*/
Expand Down
1 change: 1 addition & 0 deletions services/ci_visibility_pipelines/src/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export { CIAppCreatePipelineEventRequest } from "./models/CIAppCreatePipelineEve
export { CIAppCreatePipelineEventRequestAttributes } from "./models/CIAppCreatePipelineEventRequestAttributes";
export { CIAppCreatePipelineEventRequestAttributesResource } from "./models/CIAppCreatePipelineEventRequestAttributesResource";
export { CIAppCreatePipelineEventRequestData } from "./models/CIAppCreatePipelineEventRequestData";
export { CIAppCreatePipelineEventRequestDataSingleOrArray } from "./models/CIAppCreatePipelineEventRequestDataSingleOrArray";
export { CIAppCreatePipelineEventRequestDataType } from "./models/CIAppCreatePipelineEventRequestDataType";
export { CIAppGitInfo } from "./models/CIAppGitInfo";
export { CIAppGroupByHistogram } from "./models/CIAppGroupByHistogram";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { AttributeTypeMap } from "@datadog/datadog-api-client";

import { CIAppCreatePipelineEventRequestData } from "./CIAppCreatePipelineEventRequestData";
import { CIAppCreatePipelineEventRequestDataSingleOrArray } from "./CIAppCreatePipelineEventRequestDataSingleOrArray";

/**
* Request object.
*/
export class CIAppCreatePipelineEventRequest {
/**
* Data of the pipeline event to create.
* Data of the pipeline events to create.
*/
"data"?: CIAppCreatePipelineEventRequestData;
"data"?: CIAppCreatePipelineEventRequestDataSingleOrArray;
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
Expand All @@ -27,7 +27,7 @@ export class CIAppCreatePipelineEventRequest {
static readonly attributeTypeMap: AttributeTypeMap = {
data: {
baseName: "data",
type: "CIAppCreatePipelineEventRequestData",
type: "CIAppCreatePipelineEventRequestDataSingleOrArray",
},
additionalProperties: {
baseName: "additionalProperties",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { UnparsedObject } from "@datadog/datadog-api-client";

import { CIAppCreatePipelineEventRequestData } from "./CIAppCreatePipelineEventRequestData";

/**
* Data of the pipeline events to create.
*/
export type CIAppCreatePipelineEventRequestDataSingleOrArray =
| CIAppCreatePipelineEventRequestData
| Array<CIAppCreatePipelineEventRequestData>
| UnparsedObject;
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export const TypingInfo: ModelTypingInfo = {
"CIAppPipelineEventJob",
"CIAppPipelineEventStep",
],
CIAppCreatePipelineEventRequestDataSingleOrArray: [
"CIAppCreatePipelineEventRequestData",
"Array<CIAppCreatePipelineEventRequestData>",
],
CIAppGroupByMissing: ["string", "number"],
CIAppGroupByTotal: ["boolean", "string", "number"],
CIAppPipelineEventPipeline: [
Expand Down
Loading