From b2aca32c9038820b9eb5a85229d3a51de77b3394 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 10 Dec 2024 19:50:43 +0000 Subject: [PATCH] Regenerate client from commit 5da0cd35 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 279 ++++++++++++------ docs/datadog_api_client.v2.model.rst | 21 ++ .../CreateCIAppPipelineEvent.py | 12 +- .../CreateCIAppPipelineEvent_129899466.py | 8 +- .../CreateCIAppPipelineEvent_2341150096.py | 51 ++++ ...eline_event_request_attributes_resource.py | 62 ++-- ...ci_app_pipeline_event_finished_pipeline.py | 219 ++++++++++++++ ...app_pipeline_event_in_progress_pipeline.py | 215 ++++++++++++++ .../model/ci_app_pipeline_event_pipeline.py | 172 ++--------- ...eline_event_pipeline_in_progress_status.py | 35 +++ src/datadog_api_client/v2/models/__init__.py | 8 + ...ipelines_events_returns_ok_response.frozen | 2 +- ..._pipelines_events_returns_ok_response.yaml | 4 +- ...ipelines_events_returns_ok_response.frozen | 2 +- ..._pipelines_events_returns_ok_response.yaml | 21 +- ...ipelines_events_returns_ok_response.frozen | 2 +- ..._pipelines_events_returns_ok_response.yaml | 14 +- ...st_accepted_for_processing_response.frozen | 2 +- ...uest_accepted_for_processing_response.yaml | 4 +- ...st_accepted_for_processing_response.frozen | 2 +- ...uest_accepted_for_processing_response.yaml | 4 +- ...st_accepted_for_processing_response.frozen | 1 + ...uest_accepted_for_processing_response.yaml | 21 ++ .../features/ci_visibility_pipelines.feature | 13 +- 25 files changed, 848 insertions(+), 334 deletions(-) create mode 100644 examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.py create mode 100644 src/datadog_api_client/v2/model/ci_app_pipeline_event_finished_pipeline.py create mode 100644 src/datadog_api_client/v2/model/ci_app_pipeline_event_in_progress_pipeline.py create mode 100644 src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline_in_progress_status.py create mode 100644 tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.yaml diff --git a/.apigentools-info b/.apigentools-info index 85f7886891..8ddeea469a 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 17:29:08.319276", - "spec_repo_commit": "f35e3502" + "regenerated": "2024-12-10 19:50:09.732319", + "spec_repo_commit": "5da0cd35" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 17:29:08.337320", - "spec_repo_commit": "f35e3502" + "regenerated": "2024-12-10 19:50:09.751594", + "spec_repo_commit": "5da0cd35" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cb2fda6b01..a21342f7d1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3259,6 +3259,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: @@ -3407,97 +3584,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. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 28c27ebe2c..389700de5b 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1474,6 +1474,20 @@ datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_finished\_pipeline module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ci_app_pipeline_event_finished_pipeline + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_in\_progress\_pipeline module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ci_app_pipeline_event_in_progress_pipeline + :members: + :show-inheritance: + datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_job module ------------------------------------------------------------------ @@ -1516,6 +1530,13 @@ datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_pipeline module :members: :show-inheritance: +datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_pipeline\_in\_progress\_status module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_in_progress_status + :members: + :show-inheritance: + datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_pipeline\_level module ------------------------------------------------------------------------------ diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.py b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.py index 0bb695017c..565076f081 100644 --- a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.py +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.py @@ -15,22 +15,22 @@ CIAppCreatePipelineEventRequestDataType, ) from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo -from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline import CIAppPipelineEventPipeline +from datadog_api_client.v2.model.ci_app_pipeline_event_finished_pipeline import CIAppPipelineEventFinishedPipeline from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_status import CIAppPipelineEventPipelineStatus body = CIAppCreatePipelineEventRequest( data=CIAppCreatePipelineEventRequestData( attributes=CIAppCreatePipelineEventRequestAttributes( - resource=CIAppPipelineEventPipeline( - end=(datetime.now() + relativedelta(seconds=-30)), + resource=CIAppPipelineEventFinishedPipeline( level=CIAppPipelineEventPipelineLevel.PIPELINE, + unique_id="3eacb6f3-ff04-4e10-8a9c-46e6d054024a", name="Deploy to AWS", - partial_retry=False, + url="https://my-ci-provider.example/pipelines/my-pipeline/run/1", start=(datetime.now() + relativedelta(seconds=-120)), + end=(datetime.now() + relativedelta(seconds=-30)), status=CIAppPipelineEventPipelineStatus.SUCCESS, - unique_id="3eacb6f3-ff04-4e10-8a9c-46e6d054024a", - url="https://my-ci-provider.example/pipelines/my-pipeline/run/1", + partial_retry=False, git=CIAppGitInfo( repository_url="https://github.com/DataDog/datadog-agent", sha="7f263865994b76066c4612fd1965215e7dcb4cd2", diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.py b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.py index afe15c4784..2112bb9846 100644 --- a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.py +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.py @@ -22,14 +22,14 @@ data=CIAppCreatePipelineEventRequestData( attributes=CIAppCreatePipelineEventRequestAttributes( resource=CIAppPipelineEventJob( - end=(datetime.now() + relativedelta(seconds=-30)), level=CIAppPipelineEventJobLevel.JOB, - name="Build image", - start=(datetime.now() + relativedelta(seconds=-120)), - status=CIAppPipelineEventJobStatus.ERROR, id="cf9456de-8b9e-4c27-aa79-27b1e78c1a33", + name="Build image", pipeline_unique_id="3eacb6f3-ff04-4e10-8a9c-46e6d054024a", pipeline_name="Deploy to AWS", + start=(datetime.now() + relativedelta(seconds=-120)), + end=(datetime.now() + relativedelta(seconds=-30)), + status=CIAppPipelineEventJobStatus.ERROR, url="https://my-ci-provider.example/jobs/my-jobs/run/1", ), ), diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.py b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.py new file mode 100644 index 0000000000..3843da41f3 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.py @@ -0,0 +1,51 @@ +""" +Send running pipeline event returns "Request accepted for processing" response +""" + +from datetime import datetime +from dateutil.relativedelta import relativedelta +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.ci_visibility_pipelines_api import CIVisibilityPipelinesApi +from datadog_api_client.v2.model.ci_app_create_pipeline_event_request import CIAppCreatePipelineEventRequest +from datadog_api_client.v2.model.ci_app_create_pipeline_event_request_attributes import ( + CIAppCreatePipelineEventRequestAttributes, +) +from datadog_api_client.v2.model.ci_app_create_pipeline_event_request_data import CIAppCreatePipelineEventRequestData +from datadog_api_client.v2.model.ci_app_create_pipeline_event_request_data_type import ( + CIAppCreatePipelineEventRequestDataType, +) +from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo +from datadog_api_client.v2.model.ci_app_pipeline_event_in_progress_pipeline import CIAppPipelineEventInProgressPipeline +from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_in_progress_status import ( + CIAppPipelineEventPipelineInProgressStatus, +) +from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel + +body = CIAppCreatePipelineEventRequest( + data=CIAppCreatePipelineEventRequestData( + attributes=CIAppCreatePipelineEventRequestAttributes( + resource=CIAppPipelineEventInProgressPipeline( + level=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=(datetime.now() + relativedelta(seconds=-120)), + status=CIAppPipelineEventPipelineInProgressStatus.RUNNING, + partial_retry=False, + git=CIAppGitInfo( + repository_url="https://github.com/DataDog/datadog-agent", + sha="7f263865994b76066c4612fd1965215e7dcb4cd2", + author_email="john.doe@email.com", + ), + ), + ), + type=CIAppCreatePipelineEventRequestDataType.CIPIPELINE_RESOURCE_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CIVisibilityPipelinesApi(api_client) + response = api_instance.create_ci_app_pipeline_event(body=body) + + print(response) diff --git a/src/datadog_api_client/v2/model/ci_app_create_pipeline_event_request_attributes_resource.py b/src/datadog_api_client/v2/model/ci_app_create_pipeline_event_request_attributes_resource.py index 00a59c45de..41dfe5d2aa 100644 --- a/src/datadog_api_client/v2/model/ci_app_create_pipeline_event_request_attributes_resource.py +++ b/src/datadog_api_client/v2/model/ci_app_create_pipeline_event_request_attributes_resource.py @@ -15,7 +15,10 @@ def __init__(self, **kwargs): """ Details of the CI pipeline event. - :param end: 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. + :param dependencies: A list of stage IDs that this stage depends on. + :type dependencies: [str], none_type, optional + + :param end: Time when the stage run finished. The time format must be RFC3339. :type end: datetime :param error: Contains information of the CI error. @@ -25,19 +28,16 @@ def __init__(self, **kwargs): Note that either `tag` or `branch` has to be provided, but not both. :type git: CIAppGitInfo, none_type, optional - :param is_manual: Whether or not the pipeline was triggered manually by the user. - :type is_manual: bool, none_type, optional - - :param is_resumed: Whether or not the pipeline was resumed after being blocked. - :type is_resumed: bool, none_type, optional + :param id: UUID for the stage. It has to be unique at least in the pipeline scope. + :type id: str - :param level: Used to distinguish between pipelines, stages, jobs, and steps. - :type level: CIAppPipelineEventPipelineLevel + :param level: Used to distinguish between pipelines, stages, jobs and steps. + :type level: CIAppPipelineEventStageLevel :param metrics: A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. :type metrics: [str], none_type, optional - :param name: Name of the pipeline. All pipeline runs for the builds should have the same name. + :param name: The name for the stage. :type name: str :param node: Contains information of the host running the pipeline, stage, job, or step. @@ -46,57 +46,33 @@ def __init__(self, **kwargs): :param parameters: A map of key-value parameters or environment variables that were defined for the pipeline. :type parameters: CIAppPipelineEventParameters, none_type, optional - :param parent_pipeline: If the pipeline is triggered as child of another pipeline, this should contain the details of the parent pipeline. - :type parent_pipeline: CIAppPipelineEventParentPipeline, none_type, optional - - :param partial_retry: 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. - :type partial_retry: bool - - :param pipeline_id: 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. - :type pipeline_id: str, optional + :param pipeline_name: The parent pipeline name. + :type pipeline_name: str - :param previous_attempt: If the pipeline is a retry, this should contain the details of the previous attempt. - :type previous_attempt: CIAppPipelineEventPreviousPipeline, none_type, optional + :param pipeline_unique_id: The parent pipeline UUID. + :type pipeline_unique_id: str :param queue_time: The queue time in milliseconds, if applicable. :type queue_time: int, none_type, optional - :param start: Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. + :param start: Time when the stage run started (it should not include any queue time). The time format must be RFC3339. :type start: datetime - :param status: The final status of the pipeline. - :type status: CIAppPipelineEventPipelineStatus + :param status: The final status of the stage. + :type status: CIAppPipelineEventStageStatus :param tags: A list of user-defined tags. The tags must follow the `key:value` pattern. :type tags: [str], none_type, optional - :param unique_id: UUID of the pipeline run. The ID has to be unique across retries and pipelines, - including partial retries. - :type unique_id: str - - :param url: The URL to look at the pipeline in the CI provider UI. - :type url: str - - :param dependencies: A list of stage IDs that this stage depends on. - :type dependencies: [str], none_type, optional - - :param id: UUID for the stage. It has to be unique at least in the pipeline scope. - :type id: str - - :param pipeline_name: The parent pipeline name. - :type pipeline_name: str - - :param pipeline_unique_id: The parent pipeline UUID. - :type pipeline_unique_id: str - :param stage_id: The parent stage UUID (if applicable). :type stage_id: str, none_type, optional :param stage_name: The parent stage name (if applicable). :type stage_name: str, none_type, optional + :param url: The URL to look at the job in the CI provider UI. + :type url: str + :param job_id: The parent job UUID (if applicable). :type job_id: str, none_type, optional diff --git a/src/datadog_api_client/v2/model/ci_app_pipeline_event_finished_pipeline.py b/src/datadog_api_client/v2/model/ci_app_pipeline_event_finished_pipeline.py new file mode 100644 index 0000000000..18f064ab7d --- /dev/null +++ b/src/datadog_api_client/v2/model/ci_app_pipeline_event_finished_pipeline.py @@ -0,0 +1,219 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ci_app_ci_error import CIAppCIError + from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel + from datadog_api_client.v2.model.ci_app_host_info import CIAppHostInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_parameters import CIAppPipelineEventParameters + from datadog_api_client.v2.model.ci_app_pipeline_event_parent_pipeline import CIAppPipelineEventParentPipeline + from datadog_api_client.v2.model.ci_app_pipeline_event_previous_pipeline import CIAppPipelineEventPreviousPipeline + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_status import CIAppPipelineEventPipelineStatus + + +class CIAppPipelineEventFinishedPipeline(ModelNormal): + validations = { + "queue_time": { + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ci_app_ci_error import CIAppCIError + from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel + from datadog_api_client.v2.model.ci_app_host_info import CIAppHostInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_parameters import CIAppPipelineEventParameters + from datadog_api_client.v2.model.ci_app_pipeline_event_parent_pipeline import CIAppPipelineEventParentPipeline + from datadog_api_client.v2.model.ci_app_pipeline_event_previous_pipeline import ( + CIAppPipelineEventPreviousPipeline, + ) + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_status import CIAppPipelineEventPipelineStatus + + return { + "end": (datetime,), + "error": (CIAppCIError,), + "git": (CIAppGitInfo,), + "is_manual": (bool, none_type), + "is_resumed": (bool, none_type), + "level": (CIAppPipelineEventPipelineLevel,), + "metrics": ([str],), + "name": (str,), + "node": (CIAppHostInfo,), + "parameters": (CIAppPipelineEventParameters,), + "parent_pipeline": (CIAppPipelineEventParentPipeline,), + "partial_retry": (bool,), + "pipeline_id": (str,), + "previous_attempt": (CIAppPipelineEventPreviousPipeline,), + "queue_time": (int, none_type), + "start": (datetime,), + "status": (CIAppPipelineEventPipelineStatus,), + "tags": ([str],), + "unique_id": (str,), + "url": (str,), + } + + attribute_map = { + "end": "end", + "error": "error", + "git": "git", + "is_manual": "is_manual", + "is_resumed": "is_resumed", + "level": "level", + "metrics": "metrics", + "name": "name", + "node": "node", + "parameters": "parameters", + "parent_pipeline": "parent_pipeline", + "partial_retry": "partial_retry", + "pipeline_id": "pipeline_id", + "previous_attempt": "previous_attempt", + "queue_time": "queue_time", + "start": "start", + "status": "status", + "tags": "tags", + "unique_id": "unique_id", + "url": "url", + } + + def __init__( + self_, + end: datetime, + level: CIAppPipelineEventPipelineLevel, + name: str, + partial_retry: bool, + start: datetime, + status: CIAppPipelineEventPipelineStatus, + unique_id: str, + url: str, + error: Union[CIAppCIError, none_type, UnsetType] = unset, + git: Union[CIAppGitInfo, none_type, UnsetType] = unset, + is_manual: Union[bool, none_type, UnsetType] = unset, + is_resumed: Union[bool, none_type, UnsetType] = unset, + metrics: Union[List[str], none_type, UnsetType] = unset, + node: Union[CIAppHostInfo, none_type, UnsetType] = unset, + parameters: Union[CIAppPipelineEventParameters, none_type, UnsetType] = unset, + parent_pipeline: Union[CIAppPipelineEventParentPipeline, none_type, UnsetType] = unset, + pipeline_id: Union[str, UnsetType] = unset, + previous_attempt: Union[CIAppPipelineEventPreviousPipeline, none_type, UnsetType] = unset, + queue_time: Union[int, none_type, UnsetType] = unset, + tags: Union[List[str], none_type, UnsetType] = unset, + **kwargs, + ): + """ + Details of a finished pipeline. + + :param end: 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. + :type end: datetime + + :param error: Contains information of the CI error. + :type error: CIAppCIError, none_type, optional + + :param git: If pipelines are triggered due to actions to a Git repository, then all payloads must contain this. + Note that either ``tag`` or ``branch`` has to be provided, but not both. + :type git: CIAppGitInfo, none_type, optional + + :param is_manual: Whether or not the pipeline was triggered manually by the user. + :type is_manual: bool, none_type, optional + + :param is_resumed: Whether or not the pipeline was resumed after being blocked. + :type is_resumed: bool, none_type, optional + + :param level: Used to distinguish between pipelines, stages, jobs, and steps. + :type level: CIAppPipelineEventPipelineLevel + + :param metrics: A list of user-defined metrics. The metrics must follow the ``key:value`` pattern and the value must be numeric. + :type metrics: [str], none_type, optional + + :param name: Name of the pipeline. All pipeline runs for the builds should have the same name. + :type name: str + + :param node: Contains information of the host running the pipeline, stage, job, or step. + :type node: CIAppHostInfo, none_type, optional + + :param parameters: A map of key-value parameters or environment variables that were defined for the pipeline. + :type parameters: CIAppPipelineEventParameters, none_type, optional + + :param parent_pipeline: If the pipeline is triggered as child of another pipeline, this should contain the details of the parent pipeline. + :type parent_pipeline: CIAppPipelineEventParentPipeline, none_type, optional + + :param partial_retry: 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. + :type partial_retry: bool + + :param pipeline_id: 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. + :type pipeline_id: str, optional + + :param previous_attempt: If the pipeline is a retry, this should contain the details of the previous attempt. + :type previous_attempt: CIAppPipelineEventPreviousPipeline, none_type, optional + + :param queue_time: The queue time in milliseconds, if applicable. + :type queue_time: int, none_type, optional + + :param start: Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. + :type start: datetime + + :param status: The final status of the pipeline. + :type status: CIAppPipelineEventPipelineStatus + + :param tags: A list of user-defined tags. The tags must follow the ``key:value`` pattern. + :type tags: [str], none_type, optional + + :param unique_id: UUID of the pipeline run. The ID has to be unique across retries and pipelines, + including partial retries. + :type unique_id: str + + :param url: The URL to look at the pipeline in the CI provider UI. + :type url: str + """ + if error is not unset: + kwargs["error"] = error + if git is not unset: + kwargs["git"] = git + if is_manual is not unset: + kwargs["is_manual"] = is_manual + if is_resumed is not unset: + kwargs["is_resumed"] = is_resumed + if metrics is not unset: + kwargs["metrics"] = metrics + if node is not unset: + kwargs["node"] = node + if parameters is not unset: + kwargs["parameters"] = parameters + if parent_pipeline is not unset: + kwargs["parent_pipeline"] = parent_pipeline + if pipeline_id is not unset: + kwargs["pipeline_id"] = pipeline_id + if previous_attempt is not unset: + kwargs["previous_attempt"] = previous_attempt + if queue_time is not unset: + kwargs["queue_time"] = queue_time + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.end = end + self_.level = level + self_.name = name + self_.partial_retry = partial_retry + self_.start = start + self_.status = status + self_.unique_id = unique_id + self_.url = url diff --git a/src/datadog_api_client/v2/model/ci_app_pipeline_event_in_progress_pipeline.py b/src/datadog_api_client/v2/model/ci_app_pipeline_event_in_progress_pipeline.py new file mode 100644 index 0000000000..2b372d5a65 --- /dev/null +++ b/src/datadog_api_client/v2/model/ci_app_pipeline_event_in_progress_pipeline.py @@ -0,0 +1,215 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ci_app_ci_error import CIAppCIError + from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel + from datadog_api_client.v2.model.ci_app_host_info import CIAppHostInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_parameters import CIAppPipelineEventParameters + from datadog_api_client.v2.model.ci_app_pipeline_event_parent_pipeline import CIAppPipelineEventParentPipeline + from datadog_api_client.v2.model.ci_app_pipeline_event_previous_pipeline import CIAppPipelineEventPreviousPipeline + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_in_progress_status import ( + CIAppPipelineEventPipelineInProgressStatus, + ) + + +class CIAppPipelineEventInProgressPipeline(ModelNormal): + validations = { + "queue_time": { + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ci_app_ci_error import CIAppCIError + from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel + from datadog_api_client.v2.model.ci_app_host_info import CIAppHostInfo + from datadog_api_client.v2.model.ci_app_pipeline_event_parameters import CIAppPipelineEventParameters + from datadog_api_client.v2.model.ci_app_pipeline_event_parent_pipeline import CIAppPipelineEventParentPipeline + from datadog_api_client.v2.model.ci_app_pipeline_event_previous_pipeline import ( + CIAppPipelineEventPreviousPipeline, + ) + from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_in_progress_status import ( + CIAppPipelineEventPipelineInProgressStatus, + ) + + return { + "error": (CIAppCIError,), + "git": (CIAppGitInfo,), + "is_manual": (bool, none_type), + "is_resumed": (bool, none_type), + "level": (CIAppPipelineEventPipelineLevel,), + "metrics": ([str],), + "name": (str,), + "node": (CIAppHostInfo,), + "parameters": (CIAppPipelineEventParameters,), + "parent_pipeline": (CIAppPipelineEventParentPipeline,), + "partial_retry": (bool,), + "pipeline_id": (str,), + "previous_attempt": (CIAppPipelineEventPreviousPipeline,), + "queue_time": (int, none_type), + "start": (datetime,), + "status": (CIAppPipelineEventPipelineInProgressStatus,), + "tags": ([str],), + "unique_id": (str,), + "url": (str,), + } + + attribute_map = { + "error": "error", + "git": "git", + "is_manual": "is_manual", + "is_resumed": "is_resumed", + "level": "level", + "metrics": "metrics", + "name": "name", + "node": "node", + "parameters": "parameters", + "parent_pipeline": "parent_pipeline", + "partial_retry": "partial_retry", + "pipeline_id": "pipeline_id", + "previous_attempt": "previous_attempt", + "queue_time": "queue_time", + "start": "start", + "status": "status", + "tags": "tags", + "unique_id": "unique_id", + "url": "url", + } + + def __init__( + self_, + level: CIAppPipelineEventPipelineLevel, + name: str, + partial_retry: bool, + start: datetime, + status: CIAppPipelineEventPipelineInProgressStatus, + unique_id: str, + url: str, + error: Union[CIAppCIError, none_type, UnsetType] = unset, + git: Union[CIAppGitInfo, none_type, UnsetType] = unset, + is_manual: Union[bool, none_type, UnsetType] = unset, + is_resumed: Union[bool, none_type, UnsetType] = unset, + metrics: Union[List[str], none_type, UnsetType] = unset, + node: Union[CIAppHostInfo, none_type, UnsetType] = unset, + parameters: Union[CIAppPipelineEventParameters, none_type, UnsetType] = unset, + parent_pipeline: Union[CIAppPipelineEventParentPipeline, none_type, UnsetType] = unset, + pipeline_id: Union[str, UnsetType] = unset, + previous_attempt: Union[CIAppPipelineEventPreviousPipeline, none_type, UnsetType] = unset, + queue_time: Union[int, none_type, UnsetType] = unset, + tags: Union[List[str], none_type, UnsetType] = unset, + **kwargs, + ): + """ + Details of a running pipeline. + + :param error: Contains information of the CI error. + :type error: CIAppCIError, none_type, optional + + :param git: If pipelines are triggered due to actions to a Git repository, then all payloads must contain this. + Note that either ``tag`` or ``branch`` has to be provided, but not both. + :type git: CIAppGitInfo, none_type, optional + + :param is_manual: Whether or not the pipeline was triggered manually by the user. + :type is_manual: bool, none_type, optional + + :param is_resumed: Whether or not the pipeline was resumed after being blocked. + :type is_resumed: bool, none_type, optional + + :param level: Used to distinguish between pipelines, stages, jobs, and steps. + :type level: CIAppPipelineEventPipelineLevel + + :param metrics: A list of user-defined metrics. The metrics must follow the ``key:value`` pattern and the value must be numeric. + :type metrics: [str], none_type, optional + + :param name: Name of the pipeline. All pipeline runs for the builds should have the same name. + :type name: str + + :param node: Contains information of the host running the pipeline, stage, job, or step. + :type node: CIAppHostInfo, none_type, optional + + :param parameters: A map of key-value parameters or environment variables that were defined for the pipeline. + :type parameters: CIAppPipelineEventParameters, none_type, optional + + :param parent_pipeline: If the pipeline is triggered as child of another pipeline, this should contain the details of the parent pipeline. + :type parent_pipeline: CIAppPipelineEventParentPipeline, none_type, optional + + :param partial_retry: 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. + :type partial_retry: bool + + :param pipeline_id: 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. + :type pipeline_id: str, optional + + :param previous_attempt: If the pipeline is a retry, this should contain the details of the previous attempt. + :type previous_attempt: CIAppPipelineEventPreviousPipeline, none_type, optional + + :param queue_time: The queue time in milliseconds, if applicable. + :type queue_time: int, none_type, optional + + :param start: Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. + :type start: datetime + + :param status: The in progress status of the pipeline. + :type status: CIAppPipelineEventPipelineInProgressStatus + + :param tags: A list of user-defined tags. The tags must follow the ``key:value`` pattern. + :type tags: [str], none_type, optional + + :param unique_id: UUID of the pipeline run. The ID has to be the same as the finished pipeline. + :type unique_id: str + + :param url: The URL to look at the pipeline in the CI provider UI. + :type url: str + """ + if error is not unset: + kwargs["error"] = error + if git is not unset: + kwargs["git"] = git + if is_manual is not unset: + kwargs["is_manual"] = is_manual + if is_resumed is not unset: + kwargs["is_resumed"] = is_resumed + if metrics is not unset: + kwargs["metrics"] = metrics + if node is not unset: + kwargs["node"] = node + if parameters is not unset: + kwargs["parameters"] = parameters + if parent_pipeline is not unset: + kwargs["parent_pipeline"] = parent_pipeline + if pipeline_id is not unset: + kwargs["pipeline_id"] = pipeline_id + if previous_attempt is not unset: + kwargs["previous_attempt"] = previous_attempt + if queue_time is not unset: + kwargs["queue_time"] = queue_time + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.level = level + self_.name = name + self_.partial_retry = partial_retry + self_.start = start + self_.status = status + self_.unique_id = unique_id + self_.url = url diff --git a/src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline.py b/src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline.py index e049735a6d..cec8d8df31 100644 --- a/src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline.py +++ b/src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline.py @@ -3,119 +3,15 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( - ModelNormal, + ModelComposed, cached_property, - datetime, - none_type, - unset, - UnsetType, ) -if TYPE_CHECKING: - from datadog_api_client.v2.model.ci_app_ci_error import CIAppCIError - from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo - from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel - from datadog_api_client.v2.model.ci_app_host_info import CIAppHostInfo - from datadog_api_client.v2.model.ci_app_pipeline_event_parameters import CIAppPipelineEventParameters - from datadog_api_client.v2.model.ci_app_pipeline_event_parent_pipeline import CIAppPipelineEventParentPipeline - from datadog_api_client.v2.model.ci_app_pipeline_event_previous_pipeline import CIAppPipelineEventPreviousPipeline - from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_status import CIAppPipelineEventPipelineStatus - - -class CIAppPipelineEventPipeline(ModelNormal): - validations = { - "queue_time": { - "inclusive_minimum": 0, - }, - } - - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.ci_app_ci_error import CIAppCIError - from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo - from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel - from datadog_api_client.v2.model.ci_app_host_info import CIAppHostInfo - from datadog_api_client.v2.model.ci_app_pipeline_event_parameters import CIAppPipelineEventParameters - from datadog_api_client.v2.model.ci_app_pipeline_event_parent_pipeline import CIAppPipelineEventParentPipeline - from datadog_api_client.v2.model.ci_app_pipeline_event_previous_pipeline import ( - CIAppPipelineEventPreviousPipeline, - ) - from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_status import CIAppPipelineEventPipelineStatus - - return { - "end": (datetime,), - "error": (CIAppCIError,), - "git": (CIAppGitInfo,), - "is_manual": (bool, none_type), - "is_resumed": (bool, none_type), - "level": (CIAppPipelineEventPipelineLevel,), - "metrics": ([str],), - "name": (str,), - "node": (CIAppHostInfo,), - "parameters": (CIAppPipelineEventParameters,), - "parent_pipeline": (CIAppPipelineEventParentPipeline,), - "partial_retry": (bool,), - "pipeline_id": (str,), - "previous_attempt": (CIAppPipelineEventPreviousPipeline,), - "queue_time": (int, none_type), - "start": (datetime,), - "status": (CIAppPipelineEventPipelineStatus,), - "tags": ([str],), - "unique_id": (str,), - "url": (str,), - } - - attribute_map = { - "end": "end", - "error": "error", - "git": "git", - "is_manual": "is_manual", - "is_resumed": "is_resumed", - "level": "level", - "metrics": "metrics", - "name": "name", - "node": "node", - "parameters": "parameters", - "parent_pipeline": "parent_pipeline", - "partial_retry": "partial_retry", - "pipeline_id": "pipeline_id", - "previous_attempt": "previous_attempt", - "queue_time": "queue_time", - "start": "start", - "status": "status", - "tags": "tags", - "unique_id": "unique_id", - "url": "url", - } - - def __init__( - self_, - end: datetime, - level: CIAppPipelineEventPipelineLevel, - name: str, - partial_retry: bool, - start: datetime, - status: CIAppPipelineEventPipelineStatus, - unique_id: str, - url: str, - error: Union[CIAppCIError, none_type, UnsetType] = unset, - git: Union[CIAppGitInfo, none_type, UnsetType] = unset, - is_manual: Union[bool, none_type, UnsetType] = unset, - is_resumed: Union[bool, none_type, UnsetType] = unset, - metrics: Union[List[str], none_type, UnsetType] = unset, - node: Union[CIAppHostInfo, none_type, UnsetType] = unset, - parameters: Union[CIAppPipelineEventParameters, none_type, UnsetType] = unset, - parent_pipeline: Union[CIAppPipelineEventParentPipeline, none_type, UnsetType] = unset, - pipeline_id: Union[str, UnsetType] = unset, - previous_attempt: Union[CIAppPipelineEventPreviousPipeline, none_type, UnsetType] = unset, - queue_time: Union[int, none_type, UnsetType] = unset, - tags: Union[List[str], none_type, UnsetType] = unset, - **kwargs, - ): +class CIAppPipelineEventPipeline(ModelComposed): + def __init__(self, **kwargs): """ Details of the top level pipeline, build, or workflow of your CI. @@ -126,7 +22,7 @@ def __init__( :type error: CIAppCIError, none_type, optional :param git: If pipelines are triggered due to actions to a Git repository, then all payloads must contain this. - Note that either ``tag`` or ``branch`` has to be provided, but not both. + Note that either `tag` or `branch` has to be provided, but not both. :type git: CIAppGitInfo, none_type, optional :param is_manual: Whether or not the pipeline was triggered manually by the user. @@ -138,7 +34,7 @@ def __init__( :param level: Used to distinguish between pipelines, stages, jobs, and steps. :type level: CIAppPipelineEventPipelineLevel - :param metrics: A list of user-defined metrics. The metrics must follow the ``key:value`` pattern and the value must be numeric. + :param metrics: A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. :type metrics: [str], none_type, optional :param name: Name of the pipeline. All pipeline runs for the builds should have the same name. @@ -158,7 +54,7 @@ def __init__( :type partial_retry: bool :param pipeline_id: 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. + If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id` can be set to the same value. :type pipeline_id: str, optional :param previous_attempt: If the pipeline is a retry, this should contain the details of the previous attempt. @@ -173,7 +69,7 @@ def __init__( :param status: The final status of the pipeline. :type status: CIAppPipelineEventPipelineStatus - :param tags: A list of user-defined tags. The tags must follow the ``key:value`` pattern. + :param tags: A list of user-defined tags. The tags must follow the `key:value` pattern. :type tags: [str], none_type, optional :param unique_id: UUID of the pipeline run. The ID has to be unique across retries and pipelines, @@ -183,37 +79,27 @@ def __init__( :param url: The URL to look at the pipeline in the CI provider UI. :type url: str """ - if error is not unset: - kwargs["error"] = error - if git is not unset: - kwargs["git"] = git - if is_manual is not unset: - kwargs["is_manual"] = is_manual - if is_resumed is not unset: - kwargs["is_resumed"] = is_resumed - if metrics is not unset: - kwargs["metrics"] = metrics - if node is not unset: - kwargs["node"] = node - if parameters is not unset: - kwargs["parameters"] = parameters - if parent_pipeline is not unset: - kwargs["parent_pipeline"] = parent_pipeline - if pipeline_id is not unset: - kwargs["pipeline_id"] = pipeline_id - if previous_attempt is not unset: - kwargs["previous_attempt"] = previous_attempt - if queue_time is not unset: - kwargs["queue_time"] = queue_time - if tags is not unset: - kwargs["tags"] = tags super().__init__(kwargs) - self_.end = end - self_.level = level - self_.name = name - self_.partial_retry = partial_retry - self_.start = start - self_.status = status - self_.unique_id = unique_id - self_.url = url + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.ci_app_pipeline_event_finished_pipeline import ( + CIAppPipelineEventFinishedPipeline, + ) + from datadog_api_client.v2.model.ci_app_pipeline_event_in_progress_pipeline import ( + CIAppPipelineEventInProgressPipeline, + ) + + return { + "oneOf": [ + CIAppPipelineEventFinishedPipeline, + CIAppPipelineEventInProgressPipeline, + ], + } diff --git a/src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline_in_progress_status.py b/src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline_in_progress_status.py new file mode 100644 index 0000000000..db75117de9 --- /dev/null +++ b/src/datadog_api_client/v2/model/ci_app_pipeline_event_pipeline_in_progress_status.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CIAppPipelineEventPipelineInProgressStatus(ModelSimple): + """ + The in progress status of the pipeline. + + :param value: If omitted defaults to "running". Must be one of ["running"]. + :type value: str + """ + + allowed_values = { + "running", + } + RUNNING: ClassVar["CIAppPipelineEventPipelineInProgressStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CIAppPipelineEventPipelineInProgressStatus.RUNNING = CIAppPipelineEventPipelineInProgressStatus("running") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 617f6110dc..87a921a163 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -184,12 +184,17 @@ from datadog_api_client.v2.model.ci_app_host_info import CIAppHostInfo from datadog_api_client.v2.model.ci_app_pipeline_event import CIAppPipelineEvent from datadog_api_client.v2.model.ci_app_pipeline_event_attributes import CIAppPipelineEventAttributes +from datadog_api_client.v2.model.ci_app_pipeline_event_finished_pipeline import CIAppPipelineEventFinishedPipeline +from datadog_api_client.v2.model.ci_app_pipeline_event_in_progress_pipeline import CIAppPipelineEventInProgressPipeline from datadog_api_client.v2.model.ci_app_pipeline_event_job import CIAppPipelineEventJob from datadog_api_client.v2.model.ci_app_pipeline_event_job_level import CIAppPipelineEventJobLevel from datadog_api_client.v2.model.ci_app_pipeline_event_job_status import CIAppPipelineEventJobStatus from datadog_api_client.v2.model.ci_app_pipeline_event_parameters import CIAppPipelineEventParameters from datadog_api_client.v2.model.ci_app_pipeline_event_parent_pipeline import CIAppPipelineEventParentPipeline from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline import CIAppPipelineEventPipeline +from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_in_progress_status import ( + CIAppPipelineEventPipelineInProgressStatus, +) from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_status import CIAppPipelineEventPipelineStatus from datadog_api_client.v2.model.ci_app_pipeline_event_previous_pipeline import CIAppPipelineEventPreviousPipeline @@ -2328,12 +2333,15 @@ "CIAppHostInfo", "CIAppPipelineEvent", "CIAppPipelineEventAttributes", + "CIAppPipelineEventFinishedPipeline", + "CIAppPipelineEventInProgressPipeline", "CIAppPipelineEventJob", "CIAppPipelineEventJobLevel", "CIAppPipelineEventJobStatus", "CIAppPipelineEventParameters", "CIAppPipelineEventParentPipeline", "CIAppPipelineEventPipeline", + "CIAppPipelineEventPipelineInProgressStatus", "CIAppPipelineEventPipelineLevel", "CIAppPipelineEventPipelineStatus", "CIAppPipelineEventPreviousPipeline", diff --git a/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.frozen index de1ba14a55..2f1c06d3bf 100644 --- a/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.frozen @@ -1 +1 @@ -2022-11-28T11:57:44.730Z \ No newline at end of file +2024-11-25T20:08:40.375Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.yaml index 8ffd7708f0..91ea5d57be 100644 --- a/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.yaml @@ -11,7 +11,9 @@ interactions: uri: https://api.datadoghq.com/api/v2/ci/pipelines/analytics/aggregate response: body: - string: '{"meta":{"elapsed":170,"request_id":"pddv1ChYzYWhuN3VqLVR4ZTV4V0Q0LVFDYVB3IiwKHKG6G1xIn05fWwGRsD7MITrTmBASHDayL3wqgBcSDEOG5uEAxWRZVp8G4w","status":"done"},"data":{"buckets":[{"computes":{"c0":236880835985.0375},"by":{"@ci.status":"error"}},{"computes":{"c0":3026515237.0540113},"by":{"@ci.status":"skipped"}},{"computes":{"c0":146575581775.90088},"by":{"@ci.status":"success"}}]}}' + string: '{"meta":{"elapsed":90,"request_id":"pddv1ChZiVnBUVTltRVJocUlzSWlyYkdkRHFRIi0KHQLKXxzUXfzSm-D5KYypc61Y_NGGMKnRbrtODJpWEgwQ-7lds-czCpOBaB4","status":"done"},"data":{"buckets":[]}} + + ' headers: content-type: - application/json diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.frozen index db490a74c7..79cb47db83 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.frozen @@ -1 +1 @@ -2022-11-28T11:57:44.947Z \ No newline at end of file +2024-11-25T20:08:40.699Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.yaml index 991341b8e9..84b52400ff 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.yaml @@ -5,25 +5,12 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bquery%5D=%40ci.provider.name%3Acircleci&filter%5Bfrom%5D=2022-11-28T11%3A27%3A44.947Z&filter%5Bto%5D=2022-11-28T11%3A57%3A44.947Z&page%5Blimit%5D=5 + uri: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bquery%5D=%40ci.provider.name%3Acircleci&filter%5Bfrom%5D=2024-11-25T19%3A38%3A40.699Z&filter%5Bto%5D=2024-11-25T20%3A08%3A40.699Z&page%5Blimit%5D=5 response: body: - string: '{"data":[{"id":"AgAAAYS-GYtIKjvAWQAAAAAAAAAYAAAAAEFZUy1HWXRJQUFDVGxWdU5hQ2MyOW5kYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz","type":"cipipeline","attributes":{"attributes":{"duration":176127000000,"git":{"commit":{"committer":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"author":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"message":"Directly - send SIGPROF signals to thread holding Global VM Lock","sha":"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"johndoe/directly-signal-gvl-thread"},"ci":{"pipeline":{"name":"build-and-test","id":"e67854de-34d7-4782-a62a-2231977026a6","url":"https://app.circleci.com/pipelines/workflows/e67804de-0000-4782-a62a-2231977026a6"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"test-3.0","id":"b2fd7e9c-be84-4ad7-9cc5-3796b0cdbede","url":"https://app.circleci.com/jobs/gh/DataDog/repo/301777"},"status":"success"},"circleci":{"result":"success"},"start":1669636479817000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYS-GWnbVbAEgQAAAAAAAAAYAAAAAEFZUy1HV25iQUFDWG5zSTV2dWM3dzNkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz","type":"cipipeline","attributes":{"attributes":{"duration":226593000000,"git":{"commit":{"committer":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"author":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"message":"Directly - send SIGPROF signals to thread holding Global VM Lock","sha":"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/drepo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"johndoe/directly-signal-gvl-thread"},"ci":{"pipeline":{"name":"build-and-test","id":"e67854de-0000-4782-a62a-2231977026a6","url":"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"build-jruby-9.3-latest-1","id":"55c12323-bb52-48ad-8f66-42a65d50bad5","url":"https://app.circleci.com/jobs/gh/DataDog/repo/301773"},"status":"success"},"circleci":{"result":"success"},"start":1669636420794000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYS-GUIqP9PNOgAAAAAAAAAYAAAAAEFZUy1HVUlxQUFDekFXOHlOUHZTVVhkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz","type":"cipipeline","attributes":{"attributes":{"duration":217224000000,"git":{"commit":{"committer":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"author":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"message":"Directly - send SIGPROF signals to thread holding Global VM Lock","sha":"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"johndoe/directly-signal-gvl-thread"},"ci":{"pipeline":{"name":"build-and-test","id":"e67854de-34d7-4782-a62a-2231977026a6","url":"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"build_and_test_integration-2.4","id":"dfb0036b-f9b7-414b-a147-1991e4bf7611","url":"https://app.circleci.com/jobs/gh/DataDog/repo/301772"},"status":"success"},"circleci":{"result":"success"},"start":1669636420002000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYS-GPpigabGUAAAAAAAAAAYAAAAAEFZUy1HUHBpQUFBTEMyS0MwclNtTjNkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz","type":"cipipeline","attributes":{"attributes":{"duration":200658000000,"git":{"commit":{"committer":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"author":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"message":"Directly - send SIGPROF signals to thread holding Global VM Lock","sha":"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"johndoe/directly-signal-gvl-thread"},"ci":{"pipeline":{"name":"build-and-test","id":"e67854de-34d7-4782-a62a-2231977026a6","url":"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"build-jruby-9.2-latest-1","id":"09df7769-9b36-40cd-af1c-e97a00e233a5","url":"https://app.circleci.com/jobs/gh/DataDog/repo/301760"},"status":"success"},"circleci":{"result":"success"},"start":1669636418192000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYS-GOd-VzPNOgAAAAAAAAAYAAAAAEFZUy1HT2QtQUFEUzFMbWdMNW4wTFhkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz","type":"cipipeline","attributes":{"attributes":{"duration":195791000000,"git":{"commit":{"committer":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"author":{"date":"2022-11-28T11:53:10Z","name":"John - Doe","email":"john.doe@email.com","date_timestamp":1669636390000},"message":"Directly - send SIGPROF signals to thread holding Global VM Lock","sha":"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a"},"repository_url":"https://github.com/DataDog/dd-trace-rb","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"johndoe/directly-signal-gvl-thread"},"ci":{"pipeline":{"name":"build-and-test","id":"e67854de-34d7-4782-a62a-2231977026a6","url":"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"build_and_test_integration-2.3","id":"64006f66-267a-47b7-8823-94833268546a","url":"https://app.circleci.com/jobs/gh/DataDog/repo/301761"},"status":"success"},"circleci":{"result":"success"},"start":1669636418223000000},"ci_level":"job","tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVMtR09kLVZ6UE5PZ0FBQUFBQUFBQVlBQUFBQUVGWlV5MUhUMlF0UVVGRVV6Rk1iV2RNTlc0d1RGaGtZUUFBQUNRQUFBQUFNREU0TkdKbE1XSXRPRE0yT0MwMFlXTmtMVGcwWkdNdFpUWXpNRE16TWprNU1qZ3oifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-11-28T11%3A27%3A44.947Z&filter%5Bquery%5D=%40ci.provider.name%3Acircleci&filter%5Bto%5D=2022-11-28T11%3A57%3A44.947Z&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVMtR09kLVZ6UE5PZ0FBQUFBQUFBQVlBQUFBQUVGWlV5MUhUMlF0UVVGRVV6Rk1iV2RNTlc0d1RGaGtZUUFBQUNRQUFBQUFNREU0TkdKbE1XSXRPRE0yT0MwMFlXTmtMVGcwWkdNdFpUWXpNRE16TWprNU1qZ3oifQ&page%5Blimit%5D=5"}}' + string: '{"data":[],"meta":{"elapsed":24,"request_id":"pddv1ChZWQVB6eTZTZlNqbUZVNm52YmpoX3ZnIi0KHc-jI3NiRHtRq6GL8JBczM6emoOFupT0-5U_puB2EgwHRoVgx7kIsJDWMYA","status":"done"}} + + ' headers: content-type: - application/json diff --git a/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.frozen index 7fa7586961..934c9992ff 100644 --- a/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.frozen @@ -1 +1 @@ -2022-10-21T09:09:41.747Z \ No newline at end of file +2024-11-25T20:08:40.877Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.yaml index a1de6ff91e..750617b4ae 100644 --- a/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_search_pipelines_events_returns_ok_response.yaml @@ -10,19 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/ci/pipelines/events/search response: body: - string: '{"data":[{"id":"AgAAAYP5wIfA7N1YyAAAAAAAAAAYAAAAAEFZUDV3SWZBQUFBZGs5R2kyd25pbjdNMQAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":0,"github":{"conclusion":"failure","node_group":"","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"95094daa15b4281c41780073ab8b77bc7c8d63d6"},"default_branch":"prod","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"erkang.zhang/SYM-390/cache-test-spec"},"ci":{"pipeline":{"name":"Request - Schema diff","id":"3296065344-1"},"node":{"labels":[]},"provider":{"instance":"github-actions","name":"github"},"job":{"name":"Annotate - PR","id":"9025881221","url":"https://github.com/DataDog/repo/runs/9025881221"},"status":"error"},"start":1666342488000000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wZVIw5--1wAAAAAAAAAYAAAAAEFZUDV3WlZJQUFCakl1V1FZUE1TdHlxYgAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":247000000000,"github":{"conclusion":"failure","node_group":"GitHub - Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"51aec3962c7b3be87b2d656b22042ee5e2c89a3f"},"repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"master"},"ci":{"pipeline":{"name":"Staging - Build Deploy and Test","id":"3296065853-1"},"provider":{"instance":"github-actions","name":"github"},"step":{"name":"Run - Datadog Synthetic test"},"job":{"name":"test-checkouts","id":"9025825907"},"status":"error"},"start":1666342310000000000},"ci_level":"step","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wZkww5--2gAAAAAAAAAYAAAAAEFZUDV3Wmt3QUFBN1R2bTVRRkxzaENxYgAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":251000000000,"github":{"conclusion":"failure","node_group":"GitHub - Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"51aec3962c7b3be87b2d656b22042ee5e2c89a3f"},"default_branch":"master","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"master"},"ci":{"pipeline":{"name":"Staging - Build Deploy and Test","id":"3296065853-1"},"node":{"labels":["ubuntu-latest"]},"provider":{"instance":"github-actions","name":"github"},"job":{"name":"test-checkouts","id":"9025825907","url":"https://github.com/DataDog/repo/actions/runs/3296065853/jobs/5435334930"},"status":"error"},"start":1666342307000000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wmg4dbfjZwAAAAAAAAAYAAAAAEFZUDV3bWc0QUFBX0RBNlJkS1RqWkNLSAAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":29000000000,"github":{"conclusion":"failure","node_group":"GitHub - Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"62bd7b957a4db5b6926ca570b087b3cfdb9f05a7"},"repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"juanjux/APPSEC-6399-only-report-actorip-on-attack-part2"},"ci":{"pipeline":{"name":"Framework - tests","id":"3296098174-1"},"provider":{"instance":"github-actions","name":"github"},"step":{"name":"Run - tests"},"job":{"name":"starlette-testsuite-0_17_1","id":"9025869107"},"status":"error"},"start":1666342582000000000},"ci_level":"step","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wnAIdbfjbAAAAAAAAAAYAAAAAEFZUDV3bkFJQUFENkpheXhlTXJfS3lLSAAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":164000000000,"github":{"conclusion":"failure","node_group":"GitHub - Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"62bd7b957a4db5b6926ca570b087b3cfdb9f05a7"},"default_branch":"1.x","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"juanjux/APPSEC-6399-only-report-actorip-on-attack-part2"},"ci":{"pipeline":{"name":"Framework - tests","id":"3296098174-1"},"node":{"labels":["ubuntu-latest"]},"provider":{"instance":"github-actions","name":"github"},"job":{"name":"starlette-testsuite-0_17_1","id":"9025869107","url":"https://github.com/DataDog/repo/actions/runs/3296098174/jobs/5435368427"},"status":"error"},"start":1666342449000000000},"ci_level":"job","tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1d25BSWRiZmpiQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjNia0ZKUVVGRU5rcGhlWGhsVFhKZlMzbExTQUFBQUNRQUFBQUFNREU0TTJZNVl6VXRZV1V3WmkwME16RmhMV0kwTVdJdE9HVTJNRGcxTkRNM016QXgifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=now-15m&filter%5Bquery%5D=%40ci.provider.name%3Agithub+AND+%40ci.status%3Aerror&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1d25BSWRiZmpiQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjNia0ZKUVVGRU5rcGhlWGhsVFhKZlMzbExTQUFBQUNRQUFBQUFNREU0TTJZNVl6VXRZV1V3WmkwME16RmhMV0kwTVdJdE9HVTJNRGcxTkRNM016QXgifQ&page%5Blimit%5D=5&sort=timestamp"}} + string: '{"data":[],"meta":{"elapsed":20,"request_id":"pddv1ChZSTVpjd2Q0MlI2LVVBNjVTYlhFUThBIi0KHQuJgBOuQyr2rULJokHKzwf2zKDYmaOmEm5TrJuvEgyvH4LB-7WWiTQznlw","status":"done"}} ' headers: diff --git a/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.frozen b/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.frozen index f80fdc73b8..9ea3b8ed04 100644 --- a/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.frozen @@ -1 +1 @@ -2023-06-22T08:08:28.046Z \ No newline at end of file +2024-11-25T20:08:41.018Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.yaml b/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.yaml index ffe6ba1b0f..b32ece6928 100644 --- a/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_send_pipeline_event_returns_request_accepted_for_processing_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"data":{"attributes":{"resource":{"end":"2023-06-22T08:07:58.046Z","git":{"author_email":"john.doe@email.com","repository_url":"https://github.com/DataDog/datadog-agent","sha":"7f263865994b76066c4612fd1965215e7dcb4cd2"},"level":"pipeline","name":"Deploy - to AWS","partial_retry":false,"start":"2023-06-22T08:06:28.046Z","status":"success","unique_id":"3eacb6f3-ff04-4e10-8a9c-46e6d054024a","url":"https://my-ci-provider.example/pipelines/my-pipeline/run/1"}},"type":"cipipeline_resource_request"}}' + body: '{"data":{"attributes":{"resource":{"end":"2024-11-25T20:08:11.018Z","git":{"author_email":"john.doe@email.com","repository_url":"https://github.com/DataDog/datadog-agent","sha":"7f263865994b76066c4612fd1965215e7dcb4cd2"},"level":"pipeline","name":"Deploy + to AWS","partial_retry":false,"start":"2024-11-25T20:06:41.018Z","status":"success","unique_id":"3eacb6f3-ff04-4e10-8a9c-46e6d054024a","url":"https://my-ci-provider.example/pipelines/my-pipeline/run/1"}},"type":"cipipeline_resource_request"}}' headers: accept: - application/json diff --git a/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.frozen b/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.frozen index bdbb925c5b..ad34df9881 100644 --- a/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.frozen @@ -1 +1 @@ -2023-09-27T09:29:38.798Z \ No newline at end of file +2024-11-25T20:08:41.167Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.yaml b/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.yaml index 508dfd0d7b..9e2600e47c 100644 --- a/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_send_pipeline_job_event_returns_request_accepted_for_processing_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"data":{"attributes":{"resource":{"end":"2023-09-27T09:29:08.798Z","id":"cf9456de-8b9e-4c27-aa79-27b1e78c1a33","level":"job","name":"Build - image","pipeline_name":"Deploy to AWS","pipeline_unique_id":"3eacb6f3-ff04-4e10-8a9c-46e6d054024a","start":"2023-09-27T09:27:38.798Z","status":"error","url":"https://my-ci-provider.example/jobs/my-jobs/run/1"}},"type":"cipipeline_resource_request"}}' + body: '{"data":{"attributes":{"resource":{"end":"2024-11-25T20:08:11.167Z","id":"cf9456de-8b9e-4c27-aa79-27b1e78c1a33","level":"job","name":"Build + image","pipeline_name":"Deploy to AWS","pipeline_unique_id":"3eacb6f3-ff04-4e10-8a9c-46e6d054024a","start":"2024-11-25T20:06:41.167Z","status":"error","url":"https://my-ci-provider.example/jobs/my-jobs/run/1"}},"type":"cipipeline_resource_request"}}' headers: accept: - application/json diff --git a/tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.frozen b/tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.frozen new file mode 100644 index 0000000000..229caddd7a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.frozen @@ -0,0 +1 @@ +2024-11-25T20:08:41.317Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.yaml b/tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.yaml new file mode 100644 index 0000000000..51b5de66ea --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_send_running_pipeline_event_returns_request_accepted_for_processing_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"resource":{"git":{"author_email":"john.doe@email.com","repository_url":"https://github.com/DataDog/datadog-agent","sha":"7f263865994b76066c4612fd1965215e7dcb4cd2"},"level":"pipeline","name":"Deploy + to AWS","partial_retry":false,"start":"2024-11-25T20:06:41.317Z","status":"running","unique_id":"3eacb6f3-ff04-4e10-8a9c-46e6d054024a","url":"https://my-ci-provider.example/pipelines/my-pipeline/run/1"}},"type":"cipipeline_resource_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/ci/pipeline + response: + body: + string: '{"data":null}' + headers: + content-type: + - application/vnd.api+json + status: + code: 202 + message: Accepted +version: 1 diff --git a/tests/v2/features/ci_visibility_pipelines.feature b/tests/v2/features/ci_visibility_pipelines.feature index 71dcea8c15..7f70795072 100644 --- a/tests/v2/features/ci_visibility_pipelines.feature +++ b/tests/v2/features/ci_visibility_pipelines.feature @@ -104,13 +104,20 @@ Feature: CI Visibility Pipelines @team:Datadog/ci-app-backend Scenario: Send pipeline event returns "Request accepted for processing" response Given new "CreateCIAppPipelineEvent" request - And body with value {"data": {"attributes": {"resource": {"end": "{{ timeISO('now - 30s') }}", "level": "pipeline", "name": "Deploy to AWS", "partial_retry": false, "start": "{{ timeISO('now - 120s') }}", "status": "success", "unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","git":{"repository_url":"https://github.com/DataDog/datadog-agent","sha":"7f263865994b76066c4612fd1965215e7dcb4cd2","author_email":"john.doe@email.com"}}}, "type": "cipipeline_resource_request"}} + 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') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "john.doe@email.com"}}},"type": "cipipeline_resource_request"}} When the request is sent Then the response status is 202 Request accepted for processing - @team:Datadog/ci-app-backend + @skip @team:Datadog/ci-app-backend Scenario: Send pipeline job event returns "Request accepted for processing" response Given new "CreateCIAppPipelineEvent" request - And body with value {"data": {"attributes": {"resource": {"end": "{{ timeISO('now - 30s') }}", "level": "job", "name": "Build image", "start": "{{ timeISO('now - 120s') }}", "status": "error", "id": "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", "pipeline_unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "pipeline_name": "Deploy to AWS", "url": "https://my-ci-provider.example/jobs/my-jobs/run/1"}}, "type": "cipipeline_resource_request"}} + And body with value {"data": {"attributes": {"resource": {"level": "job", "id": "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", "name": "Build image", "pipeline_unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "pipeline_name": "Deploy to AWS", "start": "{{ timeISO('now - 120s') }}", "end": "{{ timeISO('now - 30s') }}", "status": "error", "url": "https://my-ci-provider.example/jobs/my-jobs/run/1"}}, "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 running pipeline event returns "Request accepted for processing" response + Given new "CreateCIAppPipelineEvent" request + 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": "john.doe@email.com"}}},"type": "cipipeline_resource_request"}} When the request is sent Then the response status is 202 Request accepted for processing