diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 12e9531700..3bc4a350cb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20960,6 +20960,29 @@ components: type: string type: array type: object + DeploymentRuleOptionsFaultyDeploymentDetectionResponse: + additionalProperties: false + description: Faulty deployment detection options returned in deployment rule + responses. The `excluded_resources` field is always present, which allows + disambiguating this type from monitor options when both share a `duration` + field. + properties: + duration: + description: The duration for faulty deployment detection. + example: 3600 + format: int64 + type: integer + excluded_resources: + description: Resources to exclude from faulty deployment detection. + example: + - resource1 + - resource2 + items: + type: string + type: array + required: + - excluded_resources + type: object DeploymentRuleOptionsMonitor: additionalProperties: false description: Monitor options for deployment rules. @@ -21022,7 +21045,7 @@ components: example: My deployment rule type: string options: - $ref: '#/components/schemas/DeploymentRulesOptions' + $ref: '#/components/schemas/DeploymentRulesOptionsResponse' type: $ref: '#/components/schemas/DeploymentRuleResponseDataAttributesType' updated_at: @@ -21087,11 +21110,18 @@ components: - id type: object DeploymentRulesOptions: - description: Options for deployment rule response representing either faulty + description: Options for deployment rule requests representing either faulty deployment detection or monitor options. oneOf: - $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection' - $ref: '#/components/schemas/DeploymentRuleOptionsMonitor' + DeploymentRulesOptionsResponse: + description: Options returned in deployment rule responses representing either + faulty deployment detection or monitor options. Faulty deployment detection + responses always include `excluded_resources`, making the two variants unambiguous. + oneOf: + - $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetectionResponse' + - $ref: '#/components/schemas/DeploymentRuleOptionsMonitor' DetachCaseRequest: description: Request for detaching security findings from their case. properties: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index c312689ac6..0dc7a2d38d 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -8376,6 +8376,13 @@ datadog\_api\_client.v2.model.deployment\_rule\_options\_faulty\_deployment\_det :members: :show-inheritance: +datadog\_api\_client.v2.model.deployment\_rule\_options\_faulty\_deployment\_detection\_response module +------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.deployment\_rule\_options\_monitor module ----------------------------------------------------------------------- @@ -8432,6 +8439,13 @@ datadog\_api\_client.v2.model.deployment\_rules\_options module :members: :show-inheritance: +datadog\_api\_client.v2.model.deployment\_rules\_options\_response module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deployment_rules_options_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.detach\_case\_request module ---------------------------------------------------------- diff --git a/src/datadog_api_client/v2/model/create_deployment_rule_params_data_attributes.py b/src/datadog_api_client/v2/model/create_deployment_rule_params_data_attributes.py index 504e7e7c96..360ec10722 100644 --- a/src/datadog_api_client/v2/model/create_deployment_rule_params_data_attributes.py +++ b/src/datadog_api_client/v2/model/create_deployment_rule_params_data_attributes.py @@ -59,7 +59,7 @@ def __init__( :param name: The name of the deployment rule. :type name: str - :param options: Options for deployment rule response representing either faulty deployment detection or monitor options. + :param options: Options for deployment rule requests representing either faulty deployment detection or monitor options. :type options: DeploymentRulesOptions :param type: The type of the deployment rule (faulty_deployment_detection or monitor). diff --git a/src/datadog_api_client/v2/model/deployment_rule_options_faulty_deployment_detection_response.py b/src/datadog_api_client/v2/model/deployment_rule_options_faulty_deployment_detection_response.py new file mode 100644 index 0000000000..66aafce6c4 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_rule_options_faulty_deployment_detection_response.py @@ -0,0 +1,47 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DeploymentRuleOptionsFaultyDeploymentDetectionResponse(ModelNormal): + @cached_property + def additional_properties_type(_): + return None + + @cached_property + def openapi_types(_): + return { + "duration": (int,), + "excluded_resources": ([str],), + } + + attribute_map = { + "duration": "duration", + "excluded_resources": "excluded_resources", + } + + def __init__(self_, excluded_resources: List[str], duration: Union[int, UnsetType] = unset, **kwargs): + """ + Faulty deployment detection options returned in deployment rule responses. The ``excluded_resources`` field is always present, which allows disambiguating this type from monitor options when both share a ``duration`` field. + + :param duration: The duration for faulty deployment detection. + :type duration: int, optional + + :param excluded_resources: Resources to exclude from faulty deployment detection. + :type excluded_resources: [str] + """ + if duration is not unset: + kwargs["duration"] = duration + super().__init__(kwargs) + + self_.excluded_resources = excluded_resources diff --git a/src/datadog_api_client/v2/model/deployment_rule_response_data_attributes.py b/src/datadog_api_client/v2/model/deployment_rule_response_data_attributes.py index 874e36f6bf..6791ef213d 100644 --- a/src/datadog_api_client/v2/model/deployment_rule_response_data_attributes.py +++ b/src/datadog_api_client/v2/model/deployment_rule_response_data_attributes.py @@ -18,15 +18,15 @@ from datadog_api_client.v2.model.deployment_rule_response_data_attributes_created_by import ( DeploymentRuleResponseDataAttributesCreatedBy, ) - from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions + from datadog_api_client.v2.model.deployment_rules_options_response import DeploymentRulesOptionsResponse from datadog_api_client.v2.model.deployment_rule_response_data_attributes_type import ( DeploymentRuleResponseDataAttributesType, ) from datadog_api_client.v2.model.deployment_rule_response_data_attributes_updated_by import ( DeploymentRuleResponseDataAttributesUpdatedBy, ) - from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import ( - DeploymentRuleOptionsFaultyDeploymentDetection, + from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection_response import ( + DeploymentRuleOptionsFaultyDeploymentDetectionResponse, ) from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor @@ -37,7 +37,7 @@ def openapi_types(_): from datadog_api_client.v2.model.deployment_rule_response_data_attributes_created_by import ( DeploymentRuleResponseDataAttributesCreatedBy, ) - from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions + from datadog_api_client.v2.model.deployment_rules_options_response import DeploymentRulesOptionsResponse from datadog_api_client.v2.model.deployment_rule_response_data_attributes_type import ( DeploymentRuleResponseDataAttributesType, ) @@ -51,7 +51,7 @@ def openapi_types(_): "dry_run": (bool,), "gate_id": (str,), "name": (str,), - "options": (DeploymentRulesOptions,), + "options": (DeploymentRulesOptionsResponse,), "type": (DeploymentRuleResponseDataAttributesType,), "updated_at": (datetime,), "updated_by": (DeploymentRuleResponseDataAttributesUpdatedBy,), @@ -77,7 +77,9 @@ def __init__( gate_id: str, name: str, options: Union[ - DeploymentRulesOptions, DeploymentRuleOptionsFaultyDeploymentDetection, DeploymentRuleOptionsMonitor + DeploymentRulesOptionsResponse, + DeploymentRuleOptionsFaultyDeploymentDetectionResponse, + DeploymentRuleOptionsMonitor, ], type: DeploymentRuleResponseDataAttributesType, updated_at: Union[datetime, UnsetType] = unset, @@ -102,8 +104,8 @@ def __init__( :param name: The name of the deployment rule. :type name: str - :param options: Options for deployment rule response representing either faulty deployment detection or monitor options. - :type options: DeploymentRulesOptions + :param options: Options returned in deployment rule responses representing either faulty deployment detection or monitor options. Faulty deployment detection responses always include ``excluded_resources`` , making the two variants unambiguous. + :type options: DeploymentRulesOptionsResponse :param type: The type of the deployment rule. :type type: DeploymentRuleResponseDataAttributesType diff --git a/src/datadog_api_client/v2/model/deployment_rules_options.py b/src/datadog_api_client/v2/model/deployment_rules_options.py index 5aaa95dd0a..7fd585eb36 100644 --- a/src/datadog_api_client/v2/model/deployment_rules_options.py +++ b/src/datadog_api_client/v2/model/deployment_rules_options.py @@ -13,7 +13,7 @@ class DeploymentRulesOptions(ModelComposed): def __init__(self, **kwargs): """ - Options for deployment rule response representing either faulty deployment detection or monitor options. + Options for deployment rule requests representing either faulty deployment detection or monitor options. :param duration: The duration for faulty deployment detection. :type duration: int, optional diff --git a/src/datadog_api_client/v2/model/deployment_rules_options_response.py b/src/datadog_api_client/v2/model/deployment_rules_options_response.py new file mode 100644 index 0000000000..4c1c9b0240 --- /dev/null +++ b/src/datadog_api_client/v2/model/deployment_rules_options_response.py @@ -0,0 +1,48 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class DeploymentRulesOptionsResponse(ModelComposed): + def __init__(self, **kwargs): + """ + Options returned in deployment rule responses representing either faulty deployment detection or monitor options. Faulty deployment detection responses always include ``excluded_resources`` , making the two variants unambiguous. + + :param duration: The duration for faulty deployment detection. + :type duration: int, optional + + :param excluded_resources: Resources to exclude from faulty deployment detection. + :type excluded_resources: [str] + + :param query: Monitors that match this query are evaluated. + :type query: str + """ + super().__init__(kwargs) + + @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.deployment_rule_options_faulty_deployment_detection_response import ( + DeploymentRuleOptionsFaultyDeploymentDetectionResponse, + ) + from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor + + return { + "oneOf": [ + DeploymentRuleOptionsFaultyDeploymentDetectionResponse, + DeploymentRuleOptionsMonitor, + ], + } diff --git a/src/datadog_api_client/v2/model/update_deployment_rule_params_data_attributes.py b/src/datadog_api_client/v2/model/update_deployment_rule_params_data_attributes.py index cc51b544a3..2ebceaef1f 100644 --- a/src/datadog_api_client/v2/model/update_deployment_rule_params_data_attributes.py +++ b/src/datadog_api_client/v2/model/update_deployment_rule_params_data_attributes.py @@ -54,7 +54,7 @@ def __init__( :param name: The name of the deployment rule. :type name: str - :param options: Options for deployment rule response representing either faulty deployment detection or monitor options. + :param options: Options for deployment rule requests representing either faulty deployment detection or monitor options. :type options: DeploymentRulesOptions """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index fe68361648..31e973c731 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1692,6 +1692,9 @@ from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import ( DeploymentRuleOptionsFaultyDeploymentDetection, ) +from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection_response import ( + DeploymentRuleOptionsFaultyDeploymentDetectionResponse, +) from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor from datadog_api_client.v2.model.deployment_rule_response import DeploymentRuleResponse from datadog_api_client.v2.model.deployment_rule_response_data import DeploymentRuleResponseData @@ -1706,6 +1709,7 @@ DeploymentRuleResponseDataAttributesUpdatedBy, ) from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions +from datadog_api_client.v2.model.deployment_rules_options_response import DeploymentRulesOptionsResponse from datadog_api_client.v2.model.detach_case_request import DetachCaseRequest from datadog_api_client.v2.model.detach_case_request_data import DetachCaseRequestData from datadog_api_client.v2.model.detach_case_request_data_relationships import DetachCaseRequestDataRelationships @@ -7682,6 +7686,7 @@ "DeploymentRelationshipData", "DeploymentRuleDataType", "DeploymentRuleOptionsFaultyDeploymentDetection", + "DeploymentRuleOptionsFaultyDeploymentDetectionResponse", "DeploymentRuleOptionsMonitor", "DeploymentRuleResponse", "DeploymentRuleResponseData", @@ -7690,6 +7695,7 @@ "DeploymentRuleResponseDataAttributesType", "DeploymentRuleResponseDataAttributesUpdatedBy", "DeploymentRulesOptions", + "DeploymentRulesOptionsResponse", "DetachCaseRequest", "DetachCaseRequestData", "DetachCaseRequestDataRelationships", diff --git a/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.frozen index 63e0f66692..106c0df992 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.frozen @@ -1 +1 @@ -2025-12-10T09:23:50.780Z \ No newline at end of file +2026-03-11T14:49:58.105Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.yaml index 5b4e8f9fd6..ea6dcd389b 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_deployment_rule_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1765358630","service":"my-service"},"type":"deployment_gate"}}' + body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1773240598","service":"my-service"},"type":"deployment_gate"}}' headers: accept: - application/json @@ -10,8 +10,8 @@ interactions: uri: https://api.datadoghq.com/api/v2/deployment_gates response: body: - string: '{"data":{"id":"24d967fe-1dec-4957-bf77-7eda18a65d47","type":"deployment_gate","attributes":{"created_at":"2025-12-10T09:23:50.813397Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1765358630","service":"my-service","updated_at":"2025-12-10T09:23:50.813397Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"2f5dd6f5-d95a-484e-854d-deef73efb664","type":"deployment_gate","attributes":{"created_at":"2026-03-11T14:49:58.708133Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1773240598","service":"my-service","updated_at":"2026-03-11T14:49:58.708133Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -27,12 +27,12 @@ interactions: content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664/rules response: body: - string: '{"data":{"id":"ebe85a93-a82d-49ec-8925-6d3d569012bb","type":"deployment_rule","attributes":{"created_at":"2025-12-10T09:23:50.871951Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"24d967fe-1dec-4957-bf77-7eda18a65d47","name":"My - deployment rule","options":{},"type":"faulty_deployment_detection","updated_at":"2025-12-10T09:23:50.871951Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"cd2c3087-0e8b-4696-a8a1-7af14e218e46","type":"deployment_rule","attributes":{"created_at":"2026-03-11T14:49:59.023723Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"2f5dd6f5-d95a-484e-854d-deef73efb664","name":"My + deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-11T14:49:59.023723Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -46,7 +46,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47/rules/ebe85a93-a82d-49ec-8925-6d3d569012bb + uri: https://api.datadoghq.com/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664/rules/cd2c3087-0e8b-4696-a8a1-7af14e218e46 response: body: string: '' @@ -60,7 +60,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47 + uri: https://api.datadoghq.com/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.frozen index 3a24fa1404..96c9be060e 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.frozen @@ -1 +1 @@ -2025-12-10T09:23:51.998Z \ No newline at end of file +2026-03-11T14:49:59.730Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.yaml index 0b5c6caf5c..b7371d4848 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_deployment_rule_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testgetdeploymentrulereturnsokresponse1765358631","service":"my-service"},"type":"deployment_gate"}}' + body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testgetdeploymentrulereturnsokresponse1773240599","service":"my-service"},"type":"deployment_gate"}}' headers: accept: - application/json @@ -10,8 +10,8 @@ interactions: uri: https://api.datadoghq.com/api/v2/deployment_gates response: body: - string: '{"data":{"id":"6177e46c-44dc-453d-8af8-8af86aa93c29","type":"deployment_gate","attributes":{"created_at":"2025-12-10T09:23:52.029575Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testgetdeploymentrulereturnsokresponse1765358631","service":"my-service","updated_at":"2025-12-10T09:23:52.029575Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"90ad7166-3050-4215-8613-4d7c6b4dda91","type":"deployment_gate","attributes":{"created_at":"2026-03-11T14:49:59.951101Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testgetdeploymentrulereturnsokresponse1773240599","service":"my-service","updated_at":"2026-03-11T14:49:59.951101Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -27,12 +27,12 @@ interactions: content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91/rules response: body: - string: '{"data":{"id":"38e32cd3-d245-49c1-85c5-b039ef868a18","type":"deployment_rule","attributes":{"created_at":"2025-12-10T09:23:52.079318Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"6177e46c-44dc-453d-8af8-8af86aa93c29","name":"My - deployment rule","options":{},"type":"faulty_deployment_detection","updated_at":"2025-12-10T09:23:52.079318Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"734c6f92-ac07-42ea-afbb-84a1f5971b57","type":"deployment_rule","attributes":{"created_at":"2026-03-11T14:50:00.24535Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"90ad7166-3050-4215-8613-4d7c6b4dda91","name":"My + deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-11T14:50:00.24535Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -46,12 +46,12 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29/rules/38e32cd3-d245-49c1-85c5-b039ef868a18 + uri: https://api.datadoghq.com/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91/rules/734c6f92-ac07-42ea-afbb-84a1f5971b57 response: body: - string: '{"data":{"id":"38e32cd3-d245-49c1-85c5-b039ef868a18","type":"deployment_rule","attributes":{"created_at":"2025-12-10T09:23:52.079318Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"6177e46c-44dc-453d-8af8-8af86aa93c29","name":"My - deployment rule","options":{},"type":"faulty_deployment_detection","updated_at":"2025-12-10T09:23:52.079318Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"734c6f92-ac07-42ea-afbb-84a1f5971b57","type":"deployment_rule","attributes":{"created_at":"2026-03-11T14:50:00.24535Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"90ad7166-3050-4215-8613-4d7c6b4dda91","name":"My + deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-11T14:50:00.24535Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -65,7 +65,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29/rules/38e32cd3-d245-49c1-85c5-b039ef868a18 + uri: https://api.datadoghq.com/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91/rules/734c6f92-ac07-42ea-afbb-84a1f5971b57 response: body: string: '' @@ -79,7 +79,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29 + uri: https://api.datadoghq.com/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.frozen index aceddb95a6..e74a02fe59 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.frozen @@ -1 +1 @@ -2025-12-10T09:23:52.700Z \ No newline at end of file +2026-03-11T14:50:01.182Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.yaml index 6e79da9d12..419c6b8538 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_deployment_rule_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testupdatedeploymentrulereturnsokresponse1765358632","service":"my-service"},"type":"deployment_gate"}}' + body: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testupdatedeploymentrulereturnsokresponse1773240601","service":"my-service"},"type":"deployment_gate"}}' headers: accept: - application/json @@ -10,8 +10,8 @@ interactions: uri: https://api.datadoghq.com/api/v2/deployment_gates response: body: - string: '{"data":{"id":"3acb9ac2-abba-4579-8697-79493b221d41","type":"deployment_gate","attributes":{"created_at":"2025-12-10T09:23:52.735765Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testupdatedeploymentrulereturnsokresponse1765358632","service":"my-service","updated_at":"2025-12-10T09:23:52.735765Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"ad028916-c8f6-4489-bce4-f6216adfc63e","type":"deployment_gate","attributes":{"created_at":"2026-03-11T14:50:01.37369Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"env":"production","identifier":"my-gate-testupdatedeploymentrulereturnsokresponse1773240601","service":"my-service","updated_at":"2026-03-11T14:50:01.37369Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -27,12 +27,12 @@ interactions: content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e/rules response: body: - string: '{"data":{"id":"ee04f24f-a980-4a28-a839-29911a632978","type":"deployment_rule","attributes":{"created_at":"2025-12-10T09:23:52.782282Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"3acb9ac2-abba-4579-8697-79493b221d41","name":"My - deployment rule","options":{},"type":"faulty_deployment_detection","updated_at":"2025-12-10T09:23:52.782282Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"930a603b-c799-4749-a465-3a9b4beb7dfb","type":"deployment_rule","attributes":{"created_at":"2026-03-11T14:50:01.635616Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"ad028916-c8f6-4489-bce4-f6216adfc63e","name":"My + deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-11T14:50:01.635616Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -48,12 +48,12 @@ interactions: content-type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41/rules/ee04f24f-a980-4a28-a839-29911a632978 + uri: https://api.datadoghq.com/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e/rules/930a603b-c799-4749-a465-3a9b4beb7dfb response: body: - string: '{"data":{"id":"ee04f24f-a980-4a28-a839-29911a632978","type":"deployment_rule","attributes":{"created_at":"2025-12-10T09:23:52.782282Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"3acb9ac2-abba-4579-8697-79493b221d41","name":"Updated - deployment rule","options":{},"type":"faulty_deployment_detection","updated_at":"2025-12-10T09:23:52.843771Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + string: '{"data":{"id":"930a603b-c799-4749-a465-3a9b4beb7dfb","type":"deployment_rule","attributes":{"created_at":"2026-03-11T14:50:01.635616Z","created_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"dry_run":false,"gate_id":"ad028916-c8f6-4489-bce4-f6216adfc63e","name":"Updated + deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection","updated_at":"2026-03-11T14:50:01.929612Z","updated_by":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' headers: content-type: @@ -67,7 +67,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41/rules/ee04f24f-a980-4a28-a839-29911a632978 + uri: https://api.datadoghq.com/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e/rules/930a603b-c799-4749-a465-3a9b4beb7dfb response: body: string: '' @@ -81,7 +81,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41 + uri: https://api.datadoghq.com/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e response: body: string: '' diff --git a/tests/v2/features/deployment_gates.feature b/tests/v2/features/deployment_gates.feature index cb0c5a1262..7dc5575c56 100644 --- a/tests/v2/features/deployment_gates.feature +++ b/tests/v2/features/deployment_gates.feature @@ -62,6 +62,7 @@ Feature: Deployment Gates And body with value {"data": {"attributes": {"dry_run": false, "name": "My deployment rule", "options": {"excluded_resources": []}, "type": "faulty_deployment_detection"}, "type": "deployment_rule"}} When the request is sent Then the response status is 200 OK + And the response "data.attributes.options.excluded_resources" is equal to [] @team:DataDog/ci-app-backend Scenario: Delete deployment gate returns "Bad Request" response @@ -206,6 +207,7 @@ Feature: Deployment Gates And request contains "id" parameter from "deployment_rule.data.id" When the request is sent Then the response status is 200 OK + And the response "data.attributes.options.excluded_resources" is equal to [] @generated @skip @team:DataDog/ci-app-backend Scenario: Get rules for a deployment gate returns "Bad request." response @@ -304,3 +306,4 @@ Feature: Deployment Gates And body with value {"data": {"attributes": {"dry_run": false, "name": "Updated deployment rule", "options": {"excluded_resources": []}}, "type": "deployment_rule"}} When the request is sent Then the response status is 200 OK + And the response "data.attributes.options.excluded_resources" is equal to []