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

Add running pipelines on custom pipelines API #2573

Open
wants to merge 1 commit 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": "2024-11-15 19:35:12.585262",
"spec_repo_commit": "ad80112e"
"regenerated": "2024-11-19 17:15:52.442722",
"spec_repo_commit": "04811622"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-11-15 19:35:12.605121",
"spec_repo_commit": "ad80112e"
"regenerated": "2024-11-19 17:15:52.462033",
"spec_repo_commit": "04811622"
}
}
}
279 changes: 188 additions & 91 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3265,6 +3265,183 @@ components:
tags:
$ref: '#/components/schemas/TagsEventAttribute'
type: object
CIAppPipelineEventFinishedPipeline:
description: Details of a finished pipeline.
properties:
end:
description: Time when the pipeline run finished. It cannot be older than
18 hours in the past from the current time. The time format must be RFC3339.
example: '2023-05-31T15:30:00Z'
format: date-time
type: string
error:
$ref: '#/components/schemas/CIAppCIError'
git:
$ref: '#/components/schemas/CIAppGitInfo'
is_manual:
description: Whether or not the pipeline was triggered manually by the user.
example: false
nullable: true
type: boolean
is_resumed:
description: Whether or not the pipeline was resumed after being blocked.
example: false
nullable: true
type: boolean
level:
$ref: '#/components/schemas/CIAppPipelineEventPipelineLevel'
metrics:
$ref: '#/components/schemas/CIAppPipelineEventMetrics'
name:
description: Name of the pipeline. All pipeline runs for the builds should
have the same name.
example: Deploy to AWS
type: string
node:
$ref: '#/components/schemas/CIAppHostInfo'
parameters:
$ref: '#/components/schemas/CIAppPipelineEventParameters'
parent_pipeline:
$ref: '#/components/schemas/CIAppPipelineEventParentPipeline'
partial_retry:
description: 'Whether or not the pipeline was a partial retry of a previous
attempt. A partial retry is one
which only runs a subset of the original jobs.'
example: false
type: boolean
pipeline_id:
description: 'Any ID used in the provider to identify the pipeline run even
if it is not unique across retries.
If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id`
can be set to the same value.'
example: '#023'
type: string
previous_attempt:
$ref: '#/components/schemas/CIAppPipelineEventPreviousPipeline'
queue_time:
description: The queue time in milliseconds, if applicable.
example: 1004
format: int64
minimum: 0
nullable: true
type: integer
start:
description: Time when the pipeline run started (it should not include any
queue time). The time format must be RFC3339.
example: '2023-05-31T15:30:00Z'
format: date-time
type: string
status:
$ref: '#/components/schemas/CIAppPipelineEventPipelineStatus'
tags:
$ref: '#/components/schemas/CIAppPipelineEventTags'
unique_id:
description: 'UUID of the pipeline run. The ID has to be unique across retries
and pipelines,
including partial retries.'
example: 3eacb6f3-ff04-4e10-8a9c-46e6d054024a
type: string
url:
description: The URL to look at the pipeline in the CI provider UI.
example: https://my-ci-provider.example/pipelines/my-pipeline/run/1
type: string
required:
- level
- unique_id
- name
- url
- start
- end
- status
- partial_retry
type: object
CIAppPipelineEventInProgressPipeline:
description: Details of a running pipeline.
properties:
error:
$ref: '#/components/schemas/CIAppCIError'
git:
$ref: '#/components/schemas/CIAppGitInfo'
is_manual:
description: Whether or not the pipeline was triggered manually by the user.
example: false
nullable: true
type: boolean
is_resumed:
description: Whether or not the pipeline was resumed after being blocked.
example: false
nullable: true
type: boolean
level:
$ref: '#/components/schemas/CIAppPipelineEventPipelineLevel'
metrics:
$ref: '#/components/schemas/CIAppPipelineEventMetrics'
name:
description: Name of the pipeline. All pipeline runs for the builds should
have the same name.
example: Deploy to AWS
type: string
node:
$ref: '#/components/schemas/CIAppHostInfo'
parameters:
$ref: '#/components/schemas/CIAppPipelineEventParameters'
parent_pipeline:
$ref: '#/components/schemas/CIAppPipelineEventParentPipeline'
partial_retry:
description: 'Whether or not the pipeline was a partial retry of a previous
attempt. A partial retry is one
which only runs a subset of the original jobs.'
example: false
type: boolean
pipeline_id:
description: 'Any ID used in the provider to identify the pipeline run even
if it is not unique across retries.
If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id`
can be set to the same value.'
example: '#023'
type: string
previous_attempt:
$ref: '#/components/schemas/CIAppPipelineEventPreviousPipeline'
queue_time:
description: The queue time in milliseconds, if applicable.
example: 1004
format: int64
minimum: 0
nullable: true
type: integer
start:
description: Time when the pipeline run started (it should not include any
queue time). The time format must be RFC3339.
example: '2023-05-31T15:30:00Z'
format: date-time
type: string
status:
$ref: '#/components/schemas/CIAppPipelineEventPipelineInProgressStatus'
tags:
$ref: '#/components/schemas/CIAppPipelineEventTags'
unique_id:
description: UUID of the pipeline run. The ID has to be the same as the
finished pipeline.
example: 3eacb6f3-ff04-4e10-8a9c-46e6d054024a
type: string
url:
description: The URL to look at the pipeline in the CI provider UI.
example: https://my-ci-provider.example/pipelines/my-pipeline/run/1
type: string
required:
- level
- unique_id
- name
- url
- start
- status
- partial_retry
type: object
CIAppPipelineEventJob:
description: Details of a CI job.
properties:
Expand Down Expand Up @@ -3413,97 +3590,17 @@ components:
type: object
CIAppPipelineEventPipeline:
description: Details of the top level pipeline, build, or workflow of your CI.
properties:
end:
description: Time when the pipeline run finished. It cannot be older than
18 hours in the past from the current time. The time format must be RFC3339.
example: '2023-05-31T15:30:00Z'
format: date-time
type: string
error:
$ref: '#/components/schemas/CIAppCIError'
git:
$ref: '#/components/schemas/CIAppGitInfo'
is_manual:
description: Whether or not the pipeline was triggered manually by the user.
example: false
nullable: true
type: boolean
is_resumed:
description: Whether or not the pipeline was resumed after being blocked.
example: false
nullable: true
type: boolean
level:
$ref: '#/components/schemas/CIAppPipelineEventPipelineLevel'
metrics:
$ref: '#/components/schemas/CIAppPipelineEventMetrics'
name:
description: Name of the pipeline. All pipeline runs for the builds should
have the same name.
example: Deploy to AWS
type: string
node:
$ref: '#/components/schemas/CIAppHostInfo'
parameters:
$ref: '#/components/schemas/CIAppPipelineEventParameters'
parent_pipeline:
$ref: '#/components/schemas/CIAppPipelineEventParentPipeline'
partial_retry:
description: 'Whether or not the pipeline was a partial retry of a previous
attempt. A partial retry is one

which only runs a subset of the original jobs.'
example: false
type: boolean
pipeline_id:
description: 'Any ID used in the provider to identify the pipeline run even
if it is not unique across retries.

If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id`
can be set to the same value.'
example: '#023'
type: string
previous_attempt:
$ref: '#/components/schemas/CIAppPipelineEventPreviousPipeline'
queue_time:
description: The queue time in milliseconds, if applicable.
example: 1004
format: int64
minimum: 0
nullable: true
type: integer
start:
description: Time when the pipeline run started (it should not include any
queue time). The time format must be RFC3339.
example: '2023-05-31T15:30:00Z'
format: date-time
type: string
status:
$ref: '#/components/schemas/CIAppPipelineEventPipelineStatus'
tags:
$ref: '#/components/schemas/CIAppPipelineEventTags'
unique_id:
description: 'UUID of the pipeline run. The ID has to be unique across retries
and pipelines,

including partial retries.'
example: 3eacb6f3-ff04-4e10-8a9c-46e6d054024a
type: string
url:
description: The URL to look at the pipeline in the CI provider UI.
example: https://my-ci-provider.example/pipelines/my-pipeline/run/1
type: string
required:
- level
- unique_id
- name
- url
- start
- end
- status
- partial_retry
type: object
oneOf:
- $ref: '#/components/schemas/CIAppPipelineEventFinishedPipeline'
- $ref: '#/components/schemas/CIAppPipelineEventInProgressPipeline'
CIAppPipelineEventPipelineInProgressStatus:
description: The in progress status of the pipeline.
enum:
- running
example: running
type: string
x-enum-varnames:
- RUNNING
CIAppPipelineEventPipelineLevel:
default: pipeline
description: Used to distinguish between pipelines, stages, jobs, and steps.
Expand Down
34 changes: 18 additions & 16 deletions examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestData;
import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestDataType;
import com.datadog.api.client.v2.model.CIAppGitInfo;
import com.datadog.api.client.v2.model.CIAppPipelineEventFinishedPipeline;
import com.datadog.api.client.v2.model.CIAppPipelineEventPipeline;
import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineLevel;
import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineStatus;
Expand All @@ -26,22 +27,23 @@ public static void main(String[] args) {
new CIAppCreatePipelineEventRequestAttributes()
.resource(
new CIAppCreatePipelineEventRequestAttributesResource(
new CIAppPipelineEventPipeline()
.end(OffsetDateTime.now().plusSeconds(-30))
.level(CIAppPipelineEventPipelineLevel.PIPELINE)
.name("Deploy to AWS")
.partialRetry(false)
.start(OffsetDateTime.now().plusSeconds(-120))
.status(CIAppPipelineEventPipelineStatus.SUCCESS)
.uniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a")
.url(
"https://my-ci-provider.example/pipelines/my-pipeline/run/1")
.git(
new CIAppGitInfo()
.repositoryUrl(
"https://github.com/DataDog/datadog-agent")
.sha("7f263865994b76066c4612fd1965215e7dcb4cd2")
.authorEmail("[email protected]")))))
new CIAppPipelineEventPipeline(
new CIAppPipelineEventFinishedPipeline()
.end(OffsetDateTime.now().plusSeconds(-30))
.level(CIAppPipelineEventPipelineLevel.PIPELINE)
.name("Deploy to AWS")
.partialRetry(false)
.start(OffsetDateTime.now().plusSeconds(-120))
.status(CIAppPipelineEventPipelineStatus.SUCCESS)
.uniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a")
.url(
"https://my-ci-provider.example/pipelines/my-pipeline/run/1")
.git(
new CIAppGitInfo()
.repositoryUrl(
"https://github.com/DataDog/datadog-agent")
.sha("7f263865994b76066c4612fd1965215e7dcb4cd2")
.authorEmail("[email protected]"))))))
.type(CIAppCreatePipelineEventRequestDataType.CIPIPELINE_RESOURCE_REQUEST));

try {
Expand Down
Loading
Loading