From 52f852bcba57febc5f49e0c51dcc0ccbb100aa02 Mon Sep 17 00:00:00 2001 From: Matteo Mara Date: Tue, 20 Aug 2024 16:48:13 +0200 Subject: [PATCH] SONAR-20277 deprecate parameter ceTaskId and componentKey, and response field ceTaskId in api/webhooks/deliveries --- .../sonar/server/webhook/ws/WebhookDeliveriesAction.java | 9 +++++++++ sonar-ws/src/main/protobuf/ws-webhooks.proto | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/WebhookDeliveriesAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/WebhookDeliveriesAction.java index 4cba7a22003..623b4420236 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/WebhookDeliveriesAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/WebhookDeliveriesAction.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nullable; +import org.sonar.api.server.ws.Change; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; @@ -76,14 +77,22 @@ public class WebhookDeliveriesAction implements WebhooksWsAction { "Require 'Administer' permission on the related project.
" + "Note that additional information are returned by api/webhooks/delivery.") .setResponseExample(getClass().getResource("example-deliveries.json")) + .setChangelog( + new Change("10.7", + "'ceTaskId' and 'componentKey' parameters are now deprecated. These parameters won't be replaced, the deliveries related to a " + + "specific project can be obtained by fetching the webhook first, and then fetching the associated deliveries."), + new Change("10.7", + "'ceTaskId' response field is now deprecated.")) .setHandler(this); action.createParam(PARAM_COMPONENT) .setDescription("Key of the project") + .setDeprecatedSince("10.7") .setExampleValue("my-project"); action.createParam(PARAM_TASK) .setDescription("Id of the Compute Engine task") + .setDeprecatedSince("10.7") .setExampleValue(Uuids.UUID_EXAMPLE_01); action.createParam(PARAM_WEBHOOK) diff --git a/sonar-ws/src/main/protobuf/ws-webhooks.proto b/sonar-ws/src/main/protobuf/ws-webhooks.proto index 256ef05d2a7..d84e99da94e 100644 --- a/sonar-ws/src/main/protobuf/ws-webhooks.proto +++ b/sonar-ws/src/main/protobuf/ws-webhooks.proto @@ -78,7 +78,7 @@ message DeliveryWsResponse { message Delivery { optional string id = 1; optional string componentKey = 2; - optional string ceTaskId = 3; + optional string ceTaskId = 3 [deprecated=true]; optional string name = 4; optional string url = 5; optional string at = 6; -- 2.39.5