Skip to content

Commit

Permalink
Merge branch 'master' into feat/excludeExecutionForDisabledPipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
christosarvanitis committed Jan 17, 2025
2 parents adf9f48 + ab81739 commit c3e3f22
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class DualExecutionRepository(
return (
primary.retrievePipelineConfigIdsForApplicationWithCriteria(application, criteria) +
previous.retrievePipelineConfigIdsForApplicationWithCriteria(application, criteria)
)
).distinct()
}

override fun retrievePipelinesForPipelineConfigIdsBetweenBuildTimeBoundary(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> pipelineConfigIds =
front50service.getPipelines(app, false, true).stream()
.map(p -> (String) p.get("id"))
Expand Down Expand Up @@ -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);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
Expand All @@ -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'() {
Expand Down

0 comments on commit c3e3f22

Please sign in to comment.