diff --git a/gate-core/src/main/java/com/netflix/spinnaker/gate/services/internal/OrcaService.java b/gate-core/src/main/java/com/netflix/spinnaker/gate/services/internal/OrcaService.java index d37601842b..8e5ffb9749 100644 --- a/gate-core/src/main/java/com/netflix/spinnaker/gate/services/internal/OrcaService.java +++ b/gate-core/src/main/java/com/netflix/spinnaker/gate/services/internal/OrcaService.java @@ -57,7 +57,8 @@ List getSubsetOfExecutions( @Query("executionIds") String executionIds, @Query("limit") Integer limit, @Query("statuses") String statuses, - @Query("expand") boolean expand); + @Query("expand") boolean expand, + @Query("includeNestedExecutions") boolean includeNestedExecutions); @Headers("Accept: application/json") @GET("/applications/{application}/pipelines/search") diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ExecutionsController.java b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ExecutionsController.java index da79f61ecd..ce24fb0fc8 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ExecutionsController.java +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/ExecutionsController.java @@ -26,7 +26,7 @@ @RestController public class ExecutionsController { - private OrcaServiceSelector orcaServiceSelector; + private final OrcaServiceSelector orcaServiceSelector; @Autowired public ExecutionsController(OrcaServiceSelector orcaServiceSelector) { @@ -62,7 +62,14 @@ List getLatestExecutionsByConfigIds( description = "Expands each execution object in the resulting list. If this value is missing, it is defaulted to true.") @RequestParam(value = "expand", defaultValue = "true") - boolean expand) { + boolean expand, + @Parameter( + description = + "Expands the pipeline refs to be real pipeline references AND the execution data. For backwards compliant calls when pipeline ref is turned on. Set to true or false lowercase as needed. Defaults to false or a property on fallback") + @RequestParam( + value = "includeNestedExecutions", + defaultValue = "${orca.defaults.includeNestedExecutionsByDefault:false}") + boolean includeNestedExecutions) { if ((executionIds == null || executionIds.trim().isEmpty()) && (pipelineConfigIds == null || pipelineConfigIds.trim().isEmpty())) { return Collections.emptyList(); @@ -70,7 +77,8 @@ List getLatestExecutionsByConfigIds( return orcaServiceSelector .select() - .getSubsetOfExecutions(pipelineConfigIds, executionIds, limit, statuses, expand); + .getSubsetOfExecutions( + pipelineConfigIds, executionIds, limit, statuses, expand, includeNestedExecutions); } @Operation(