feat(managed): expose override and retry verification endpoints
ADD
gate-core/src/main/groovy/com/netflix/spinnaker/gate/model/manageddelivery/OverrideVerificationRequest.java
+/*
+ * Copyright 2021 Netflix, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.netflix.spinnaker.gate.model.manageddelivery;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import lombok.Data;
+import lombok.NonNull;
+
+@Data
+public class OverrideVerificationRequest {
+ @NonNull @Nonnull String artifactReference;
+ @NonNull @Nonnull String artifactVersion;
+ @NonNull @Nonnull String status;
+ @Nullable String comment;
+}

ADD
gate-core/src/main/groovy/com/netflix/spinnaker/gate/model/manageddelivery/RetryVerificationRequest.java
+/*
+ * Copyright 2021 Netflix, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.netflix.spinnaker.gate.model.manageddelivery;
+
+import javax.annotation.Nonnull;
+import lombok.Data;
+import lombok.NonNull;
+
+@Data
+public class RetryVerificationRequest {
+ @NonNull @Nonnull String artifactReference;
+ @NonNull @Nonnull String artifactVersion;
+}

MODIFY
gate-core/src/main/java/com/netflix/spinnaker/gate/services/internal/KeelService.java
gate-core/src/main/java/com/netflix/spinnaker/gate/services/internal/KeelService.java
@@ -22,7 +22,9 @@ import com.netflix.spinnaker.gate.model.manageddelivery.ConstraintStatus;
import com.netflix.spinnaker.gate.model.manageddelivery.DeliveryConfig;
import com.netflix.spinnaker.gate.model.manageddelivery.EnvironmentArtifactPin;
import com.netflix.spinnaker.gate.model.manageddelivery.EnvironmentArtifactVeto;
+import com.netflix.spinnaker.gate.model.manageddelivery.OverrideVerificationRequest;
import com.netflix.spinnaker.gate.model.manageddelivery.Resource;
+import com.netflix.spinnaker.gate.model.manageddelivery.RetryVerificationRequest;
import com.netflix.spinnaker.kork.plugins.SpinnakerPluginDescriptor;
import java.util.List;
import java.util.Map;
@@ -163,6 +165,20 @@ public interface KeelService {
@POST("/application/{application}/mark/good")
Response markGood(@Path("application") String application, @Body EnvironmentArtifactVeto veto);
+ @POST("/application/{application}/environment/{environment}/verifications/{verificationId}")
+ Response overrideVerification(
+ @Path("application") String application,
+ @Path("environment") String environment,
+ @Path("verificationId") String verificationId,
+ @Body OverrideVerificationRequest payload);
+
+ @POST("/application/{application}/environment/{environment}/verifications/{verificationId}/retry")
+ Response retryVerification(
+ @Path("application") String application,
+ @Path("environment") String environment,
+ @Path("verificationId") String verificationId,
+ @Body RetryVerificationRequest payload);
+
@GET("/installedPlugins")
List<SpinnakerPluginDescriptor> getInstalledPlugins();
}

MODIFY
gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ManagedController.java
gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ManagedController.java
@@ -8,7 +8,9 @@ import com.netflix.spinnaker.gate.model.manageddelivery.ConstraintStatus;
import com.netflix.spinnaker.gate.model.manageddelivery.DeliveryConfig;
import com.netflix.spinnaker.gate.model.manageddelivery.EnvironmentArtifactPin;
import com.netflix.spinnaker.gate.model.manageddelivery.EnvironmentArtifactVeto;
+import com.netflix.spinnaker.gate.model.manageddelivery.OverrideVerificationRequest;
import com.netflix.spinnaker.gate.model.manageddelivery.Resource;
+import com.netflix.spinnaker.gate.model.manageddelivery.RetryVerificationRequest;
import com.netflix.spinnaker.gate.services.NotificationService;
import com.netflix.spinnaker.gate.services.internal.KeelService;
import groovy.util.logging.Slf4j;
@@ -346,6 +348,27 @@ public class ManagedController {
keelService.markGood(application, veto);
}
+ @ApiOperation(value = "Override the status of a verification")
+ @PostMapping(path = "/{application}/environment/{environment}/verifications/{verificationId}")
+ void overrideVerification(
+ @PathVariable("application") String application,
+ @PathVariable("environment") String environment,
+ @PathVariable("verificationId") String verificationId,
+ @RequestBody OverrideVerificationRequest payload) {
+ keelService.overrideVerification(application, environment, verificationId, payload);
+ }
+
+ @ApiOperation(value = "Retry a verification")
+ @PostMapping(
+ path = "/{application}/environment/{environment}/verifications/{verificationId}/retry")
+ void retryVerification(
+ @PathVariable("application") String application,
+ @PathVariable("environment") String environment,
+ @PathVariable("verificationId") String verificationId,
+ @RequestBody RetryVerificationRequest payload) {
+ keelService.retryVerification(application, environment, verificationId, payload);
+ }
+
@PostMapping(
path = "/notifications/callbacks/{source}",
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,

feat(managed): expose override and retry verification endpoints (#1425)