Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17075,6 +17075,12 @@ components:
required:
- id
type: object
DeploymentGateRulesResponse:
description: Response for a deployment gate rules.
properties:
data:
$ref: '#/components/schemas/ListDeploymentRuleResponseData'
type: object
DeploymentMetadata:
description: Metadata object containing the publication creation information.
properties:
Expand Down Expand Up @@ -30199,6 +30205,37 @@ components:
type: string
x-enum-varnames:
- LIST_CONNECTIONS_RESPONSE
ListDeploymentRuleResponseData:
description: Data for a list of deployment rules.
properties:
attributes:
$ref: '#/components/schemas/ListDeploymentRulesResponseDataAttributes'
id:
description: Unique identifier of the deployment rule.
example: 1111-2222-3333-4444-555566667777
type: string
type:
$ref: '#/components/schemas/ListDeploymentRulesDataType'
required:
- type
- attributes
- id
type: object
ListDeploymentRulesDataType:
description: List deployment rule resource type.
enum:
- list_deployment_rules
example: list_deployment_rules
type: string
x-enum-varnames:
- LIST_DEPLOYMENT_RULES
ListDeploymentRulesResponseDataAttributes:
properties:
rules:
items:
$ref: '#/components/schemas/DeploymentRuleResponseDataAttributes'
type: array
type: object
ListDevicesResponse:
description: List devices response.
properties:
Expand Down Expand Up @@ -66236,6 +66273,50 @@ paths:

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/deployment_gates/{gate_id}/rules:
get:
description: Endpoint to get rules for a deployment gate.
operationId: GetDeploymentGateRules
parameters:
- description: The ID of the deployment gate.
in: path
name: gate_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DeploymentGateRulesResponse'
description: OK
'400':
$ref: '#/components/responses/HTTPCDGatesBadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPCIAppErrors'
description: Internal Server Error
security:
- apiKeyAuth: []
appKeyAuth: []
summary: Get rules for a deployment gate
tags:
- Deployment Gates
x-permission:
operator: OR
permissions:
- deployment_gates_read
x-unstable: '**Note**: This endpoint is in preview and may be subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
post:
description: Endpoint to create a deployment rule. A gate for the rule must
already exist.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-12-10T19:27:22.958Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
"log": {
"_recordingName": "Deployment Gates/Get rules for a deployment gate returns \"OK\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "42cfce0685efeac3923b49c239f22198",
"_order": 0,
"cache": {},
"request": {
"bodySize": 189,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 570,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetrulesforadeploymentgatereturnsokresponse1765394842\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/deployment_gates"
},
"response": {
"bodySize": 573,
"content": {
"mimeType": "application/vnd.api+json",
"size": 573,
"text": "{\"data\":{\"id\":\"718d7fb4-bbc4-4b69-8a1b-98dda014726d\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-10T19:27:24.004043Z\",\"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-testgetrulesforadeploymentgatereturnsokresponse1765394842\",\"service\":\"my-service\",\"updated_at\":\"2025-12-10T19:27:24.004043Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/vnd.api+json"
}
],
"headersSize": 683,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-12-10T19:27:23.712Z",
"time": 378
},
{
"_id": "b5e8c70aad196d0736b7d54d5d8fb062",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 562,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/deployment_gates/718d7fb4-bbc4-4b69-8a1b-98dda014726d/rules"
},
"response": {
"bodySize": 111,
"content": {
"mimeType": "application/vnd.api+json",
"size": 111,
"text": "{\"data\":{\"id\":\"718d7fb4-bbc4-4b69-8a1b-98dda014726d\",\"type\":\"list_deployment_rules\",\"attributes\":{\"rules\":[]}}}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/vnd.api+json"
}
],
"headersSize": 681,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-12-10T19:27:24.098Z",
"time": 340
},
{
"_id": "b6dc9bafbd4972fbfe63acda919b9dd1",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "*/*"
}
],
"headersSize": 544,
"httpVersion": "HTTP/1.1",
"method": "DELETE",
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/deployment_gates/718d7fb4-bbc4-4b69-8a1b-98dda014726d"
},
"response": {
"bodySize": 0,
"content": {
"mimeType": "text/plain",
"size": 0
},
"cookies": [],
"headers": [],
"headersSize": 623,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 204,
"statusText": "No Content"
},
"startedDateTime": "2025-12-10T19:27:24.443Z",
"time": 317
}
],
"pages": [],
"version": "1.2"
}
}
17 changes: 17 additions & 0 deletions features/v2/deployment_gates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,23 @@ Feature: Deployment Gates
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/ci-app-backend
Scenario: Get rules for a deployment gate returns "Bad request." response
Given operation "GetDeploymentGateRules" enabled
And new "GetDeploymentGateRules" request
And request contains "gate_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad request.

@team:DataDog/ci-app-backend
Scenario: Get rules for a deployment gate returns "OK" response
Given there is a valid "deployment_gate" in the system
And operation "GetDeploymentGateRules" enabled
And new "GetDeploymentGateRules" request
And request contains "gate_id" parameter from "deployment_gate.data.id"
When the request is sent
Then the response status is 200 OK

@team:DataDog/ci-app-backend
Scenario: Update deployment gate returns "Bad Request" response
Given operation "UpdateDeploymentGate" enabled
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,12 @@
"type": "unsafe"
}
},
"GetDeploymentGateRules": {
"tag": "Deployment Gates",
"undo": {
"type": "safe"
}
},
"CreateDeploymentRule": {
"tag": "Deployment Gates",
"undo": {
Expand Down
7 changes: 7 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5407,6 +5407,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "DeploymentGateResponse",
},
"DeploymentGatesApi.V2.GetDeploymentGateRules": {
gateId: {
type: "string",
format: "",
},
operationResponseType: "DeploymentGateRulesResponse",
},
"DeploymentGatesApi.V2.CreateDeploymentRule": {
gateId: {
type: "string",
Expand Down
Loading