From 6f80233f9f35aeaa47c757dffc583f41dcfcdb41 Mon Sep 17 00:00:00 2001 From: Jason McIntosh Date: Tue, 14 Apr 2026 13:53:05 -0500 Subject: [PATCH 1/2] fix(gate): Add a property to default on calls to orca to include nested pipelines AI-Session-Id: b7a7635e-8e1a-4e72-a78d-63ab95b1c8ed AI-Tool: claude-code AI-Model: unknown --- .../gate/services/internal/OrcaService.java | 3 +- .../controllers/ExecutionsController.java | 29 ++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) 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..189bc08488 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 @@ -20,17 +20,25 @@ import io.swagger.v3.oas.annotations.Parameter; import java.util.Collections; import java.util.List; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @RestController public class ExecutionsController { - private OrcaServiceSelector orcaServiceSelector; + private final boolean includeNestedExecutionsByDefault; + + private final OrcaServiceSelector orcaServiceSelector; @Autowired - public ExecutionsController(OrcaServiceSelector orcaServiceSelector) { + public ExecutionsController( + OrcaServiceSelector orcaServiceSelector, + @Value("${orca.defaults.includeNestedExecutionsByDefault:false}") + boolean includeNestedExecutionsByDefault) { this.orcaServiceSelector = orcaServiceSelector; + this.includeNestedExecutionsByDefault = includeNestedExecutionsByDefault; } @Operation( @@ -62,7 +70,12 @@ 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 = "") + String includeNestedExecutions) { if ((executionIds == null || executionIds.trim().isEmpty()) && (pipelineConfigIds == null || pipelineConfigIds.trim().isEmpty())) { return Collections.emptyList(); @@ -70,7 +83,15 @@ List getLatestExecutionsByConfigIds( return orcaServiceSelector .select() - .getSubsetOfExecutions(pipelineConfigIds, executionIds, limit, statuses, expand); + .getSubsetOfExecutions( + pipelineConfigIds, + executionIds, + limit, + statuses, + expand, + StringUtils.isBlank(includeNestedExecutions) + ? includeNestedExecutionsByDefault + : Boolean.parseBoolean(includeNestedExecutions)); } @Operation( From ead0ed9ef2438f69438083510fe76bfc4c976c23 Mon Sep 17 00:00:00 2001 From: Jason McIntosh Date: Tue, 14 Apr 2026 13:58:40 -0500 Subject: [PATCH 2/2] fix(gate): Add a property to default on calls to orca to include nested pipelines AI-Session-Id: b7a7635e-8e1a-4e72-a78d-63ab95b1c8ed AI-Tool: claude-code AI-Model: unknown --- .../controllers/ExecutionsController.java | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) 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 189bc08488..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 @@ -20,25 +20,17 @@ import io.swagger.v3.oas.annotations.Parameter; import java.util.Collections; import java.util.List; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @RestController public class ExecutionsController { - private final boolean includeNestedExecutionsByDefault; - private final OrcaServiceSelector orcaServiceSelector; @Autowired - public ExecutionsController( - OrcaServiceSelector orcaServiceSelector, - @Value("${orca.defaults.includeNestedExecutionsByDefault:false}") - boolean includeNestedExecutionsByDefault) { + public ExecutionsController(OrcaServiceSelector orcaServiceSelector) { this.orcaServiceSelector = orcaServiceSelector; - this.includeNestedExecutionsByDefault = includeNestedExecutionsByDefault; } @Operation( @@ -74,8 +66,10 @@ List getLatestExecutionsByConfigIds( @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 = "") - String includeNestedExecutions) { + @RequestParam( + value = "includeNestedExecutions", + defaultValue = "${orca.defaults.includeNestedExecutionsByDefault:false}") + boolean includeNestedExecutions) { if ((executionIds == null || executionIds.trim().isEmpty()) && (pipelineConfigIds == null || pipelineConfigIds.trim().isEmpty())) { return Collections.emptyList(); @@ -84,14 +78,7 @@ List getLatestExecutionsByConfigIds( return orcaServiceSelector .select() .getSubsetOfExecutions( - pipelineConfigIds, - executionIds, - limit, - statuses, - expand, - StringUtils.isBlank(includeNestedExecutions) - ? includeNestedExecutionsByDefault - : Boolean.parseBoolean(includeNestedExecutions)); + pipelineConfigIds, executionIds, limit, statuses, expand, includeNestedExecutions); } @Operation(