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
5 changes: 1 addition & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161864,16 +161864,13 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Patch a deployment event by version
summary: Mark a deployment as failed by version
tags: ["DORA Metrics"]
x-codegen-request-body-name: body
x-permission:
operator: OR
permissions:
- dora_metrics_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: |-
Use this API endpoint to get a list of deployment events.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Patch a deployment event by version returns "Accepted" response
// Mark a deployment as failed by version returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
Expand All @@ -15,7 +15,6 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.patchDORADeploymentByVersion", true);
DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient);

DORADeploymentPatchByVersionRequest body =
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,6 @@ public class ApiClient {
put("v2.triggerDeploymentGatesEvaluation", false);
put("v2.updateDeploymentGate", false);
put("v2.updateDeploymentRule", false);
put("v2.patchDORADeploymentByVersion", false);
put("v2.cloneForm", false);
put("v2.createAndPublishForm", false);
put("v2.createForm", false);
Expand Down
23 changes: 3 additions & 20 deletions src/main/java/com/datadog/api/client/v2/api/DoraMetricsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ public CompletableFuture<ApiResponse<Void>> patchDORADeploymentWithHttpInfoAsync
}

/**
* Patch a deployment event by version.
* Mark a deployment as failed by version.
*
* <p>See {@link #patchDORADeploymentByVersionWithHttpInfo}.
*
Expand All @@ -1458,7 +1458,7 @@ public void patchDORADeploymentByVersion(DORADeploymentPatchByVersionRequest bod
}

/**
* Patch a deployment event by version.
* Mark a deployment as failed by version.
*
* <p>See {@link #patchDORADeploymentByVersionWithHttpInfoAsync}.
*
Expand Down Expand Up @@ -1496,13 +1496,6 @@ public CompletableFuture<Void> patchDORADeploymentByVersionAsync(
*/
public ApiResponse<Void> patchDORADeploymentByVersionWithHttpInfo(
DORADeploymentPatchByVersionRequest body) throws ApiException {
// Check if unstable operation is enabled
String operationId = "patchDORADeploymentByVersion";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = body;

// verify the required parameter 'body' is set
Expand Down Expand Up @@ -1536,7 +1529,7 @@ public ApiResponse<Void> patchDORADeploymentByVersionWithHttpInfo(
}

/**
* Patch a deployment event by version.
* Mark a deployment as failed by version.
*
* <p>See {@link #patchDORADeploymentByVersionWithHttpInfo}.
*
Expand All @@ -1545,16 +1538,6 @@ public ApiResponse<Void> patchDORADeploymentByVersionWithHttpInfo(
*/
public CompletableFuture<ApiResponse<Void>> patchDORADeploymentByVersionWithHttpInfoAsync(
DORADeploymentPatchByVersionRequest body) {
// Check if unstable operation is enabled
String operationId = "patchDORADeploymentByVersion";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = body;

// verify the required parameter 'body' is set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,27 +149,24 @@ Feature: DORA Metrics
Then the response status is 200 OK

@generated @skip @team:ddoghq/ci-app-backend
Scenario: Patch a deployment event by version returns "Accepted" response
Scenario: Mark a deployment as failed by version returns "Accepted" response
Given a valid "appKeyAuth" key in the system
And operation "PatchDORADeploymentByVersion" enabled
And new "PatchDORADeploymentByVersion" request
And body with value {"data": {"attributes": {"change_failure": true, "env": "production", "remediation": {"type": "rollback", "version": "v1.2.2"}, "service": "my-service", "version": "v1.2.3"}, "type": "dora_deployment_patch_request"}}
When the request is sent
Then the response status is 202 Accepted

@generated @skip @team:ddoghq/ci-app-backend
Scenario: Patch a deployment event by version returns "Bad Request" response
Scenario: Mark a deployment as failed by version returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And operation "PatchDORADeploymentByVersion" enabled
And new "PatchDORADeploymentByVersion" request
And body with value {"data": {"attributes": {"change_failure": true, "env": "production", "remediation": {"type": "rollback", "version": "v1.2.2"}, "service": "my-service", "version": "v1.2.3"}, "type": "dora_deployment_patch_request"}}
When the request is sent
Then the response status is 400 Bad Request

@skip @team:ddoghq/ci-app-backend
Scenario: Patch a deployment event by version with a missing version returns "Bad Request" response
Scenario: Mark a deployment as failed by version with a missing version returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And operation "PatchDORADeploymentByVersion" enabled
And new "PatchDORADeploymentByVersion" request
And body with value {"data": {"attributes": {"change_failure": true, "env": "production", "service": "my-service"}, "type": "dora_deployment_patch_request"}}
When the request is sent
Expand Down
Loading