diff --git a/gradle.properties b/gradle.properties index 1587195d91..22d4c44dae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ fiatVersion=1.53.0 -korkVersion=7.247.0 +korkVersion=7.248.0 kotlinVersion=1.6.21 org.gradle.parallel=true org.gradle.jvmargs=-Xmx4g diff --git a/orca-core/src/main/java/com/netflix/spinnaker/orca/pipeline/persistence/DualExecutionRepository.kt b/orca-core/src/main/java/com/netflix/spinnaker/orca/pipeline/persistence/DualExecutionRepository.kt index d7c5232918..70c1251e45 100644 --- a/orca-core/src/main/java/com/netflix/spinnaker/orca/pipeline/persistence/DualExecutionRepository.kt +++ b/orca-core/src/main/java/com/netflix/spinnaker/orca/pipeline/persistence/DualExecutionRepository.kt @@ -237,7 +237,7 @@ class DualExecutionRepository( return ( primary.retrievePipelineConfigIdsForApplicationWithCriteria(application, criteria) + previous.retrievePipelineConfigIdsForApplicationWithCriteria(application, criteria) - ) + ).distinct() } override fun retrievePipelinesForPipelineConfigIdsBetweenBuildTimeBoundary( diff --git a/orca-front50/src/main/java/com/netflix/spinnaker/orca/front50/scheduling/UnusedPipelineDisablePollingNotificationAgent.java b/orca-front50/src/main/java/com/netflix/spinnaker/orca/front50/scheduling/UnusedPipelineDisablePollingNotificationAgent.java index 2809491346..e25bae9d25 100644 --- a/orca-front50/src/main/java/com/netflix/spinnaker/orca/front50/scheduling/UnusedPipelineDisablePollingNotificationAgent.java +++ b/orca-front50/src/main/java/com/netflix/spinnaker/orca/front50/scheduling/UnusedPipelineDisablePollingNotificationAgent.java @@ -155,7 +155,7 @@ protected void tick() { .retrieveAllApplicationNames(PIPELINE) .forEach( app -> { - log.info("Evaluating " + app + " for unused pipelines"); + log.debug("Evaluating " + app + " for unused pipelines"); List pipelineConfigIds = front50service.getPipelines(app, false, true).stream() .map(p -> (String) p.get("id")) @@ -205,9 +205,11 @@ public void disableAppPipelines( + app); front50PipelineConfigIdsNotExecuted.forEach( p -> { - log.info("Disabling pipeline execution " + p); if (!dryRun) { + log.debug("Disabling pipeline execution " + p); disableFront50PipelineConfigId(p); + } else { + log.info("DryRun mode: Disabling pipeline execution " + p); } }); } diff --git a/orca-web/src/test/groovy/com/netflix/spinnaker/orca/controllers/TaskControllerSpec.groovy b/orca-web/src/test/groovy/com/netflix/spinnaker/orca/controllers/TaskControllerSpec.groovy index 97597b8b42..7f03042fe5 100644 --- a/orca-web/src/test/groovy/com/netflix/spinnaker/orca/controllers/TaskControllerSpec.groovy +++ b/orca-web/src/test/groovy/com/netflix/spinnaker/orca/controllers/TaskControllerSpec.groovy @@ -248,7 +248,8 @@ class TaskControllerSpec extends Specification { pipelineConfigId = config.pipelineConfigId } }) - front50Service.getPipelines(app, false, null) >> [[id: "1"], [id: "2"]] + taskControllerConfigurationProperties.excludeExecutionsOfDisabledPipelines = excludeExecutionsOfDisabledPipelines + front50Service.getPipelines(app, false, taskControllerConfigurationProperties.excludeExecutionsOfDisabledPipelines ? true : null) >> front50ConfigIds front50Service.getStrategies(app) >> [] executionRepository.retrievePipelineConfigIdsForApplication(app) >> { return List.of( '2')} @@ -258,7 +259,13 @@ class TaskControllerSpec extends Specification { List results = new ObjectMapper().readValue(response.contentAsString, List) then: - results.id == ['not-started', 'also-not-started', 'older2', 'older1', 'newer'] + results.id == resultsIds + + where: + excludeExecutionsOfDisabledPipelines | front50ConfigIds | resultsIds + null | [[id: "1"], [id: "2"]] | ['not-started', 'also-not-started', 'older2', 'older1', 'newer'] + false | [[id: "1"], [id: "2"]] | ['not-started', 'also-not-started', 'older2', 'older1', 'newer'] + true | [[id: "2"]] | ['older2', 'older1'] } void '/applications/{application}/evaluateExpressions precomputes values'() {