diff --git a/gradle.properties b/gradle.properties index 4075e96395..88f30da07c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ fiatVersion=1.49.0 -korkVersion=7.237.0 +korkVersion=7.238.0 kotlinVersion=1.6.21 org.gradle.parallel=true org.gradle.jvmargs=-Xmx4g diff --git a/gradle/groovy.gradle b/gradle/groovy.gradle index 13028f4b95..c5dc22eea0 100644 --- a/gradle/groovy.gradle +++ b/gradle/groovy.gradle @@ -21,7 +21,7 @@ apply plugin: "groovy" dependencies { - implementation("org.codehaus.groovy:groovy") + implementation("org.apache.groovy:groovy") testImplementation("org.spockframework:spock-core") testImplementation("cglib:cglib-nodep") testImplementation("org.objenesis:objenesis") diff --git a/gradle/spock.gradle b/gradle/spock.gradle index de27ede4df..b2b3783a48 100644 --- a/gradle/spock.gradle +++ b/gradle/spock.gradle @@ -24,7 +24,7 @@ dependencies { testImplementation("org.spockframework:spock-core") testImplementation("cglib:cglib-nodep") testImplementation("org.objenesis:objenesis") - testImplementation("org.codehaus.groovy:groovy") + testImplementation("org.apache.groovy:groovy") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") } diff --git a/orca-bakery/orca-bakery.gradle b/orca-bakery/orca-bakery.gradle index 30d5ef446d..c0d8578f37 100644 --- a/orca-bakery/orca-bakery.gradle +++ b/orca-bakery/orca-bakery.gradle @@ -25,7 +25,7 @@ dependencies { implementation("com.fasterxml.jackson.core:jackson-databind") implementation("com.fasterxml.jackson.datatype:jackson-datatype-guava") implementation("io.spinnaker.fiat:fiat-core:$fiatVersion") - implementation("org.codehaus.groovy:groovy-datetime") + implementation("org.apache.groovy:groovy-datetime") implementation("io.spinnaker.kork:kork-retrofit") api("io.spinnaker.kork:kork-web") diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/cluster/AbstractClusterWideClouddriverTask.groovy b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/cluster/AbstractClusterWideClouddriverTask.groovy index 5cd6b841a6..dd39bca8f6 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/cluster/AbstractClusterWideClouddriverTask.groovy +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/cluster/AbstractClusterWideClouddriverTask.groovy @@ -263,7 +263,7 @@ abstract class AbstractClusterWideClouddriverTask implements RetryableTask, Clou } static boolean isActive(TargetServerGroup serverGroup) { - return serverGroup.disabled == false || serverGroup.instances.any { it.healthState == HealthState.Up } + return serverGroup.isDisabled() == false || serverGroup.instances.any { it.healthState == HealthState.Up } } static class IsActive implements Comparator { diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/SourceResolver.groovy b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/SourceResolver.groovy index 1fb2c91879..bd08456d4b 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/SourceResolver.groovy +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/SourceResolver.groovy @@ -112,7 +112,7 @@ class SourceResolver { } def instanceSize = { ServerGroup asg -> asg.instances?.size() ?: 0 } - def created = { ServerGroup asg -> asg.createdTime ?: 0 } + def created = { ServerGroup asg -> asg.createdTime ?: 0L } if (stageData.useSourceCapacity) { regionalAsgs = regionalAsgs.sort { a1, a2 -> instanceSize(a1) <=> instanceSize(a2) ?: created(a2) <=> created(a1) } } diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/JarDiffsTask.groovy b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/JarDiffsTask.groovy index 80815766bf..addd2d4f70 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/JarDiffsTask.groovy +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/JarDiffsTask.groovy @@ -19,6 +19,7 @@ package com.netflix.spinnaker.orca.kato.tasks import com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerRetrofitErrorHandler import com.netflix.spinnaker.orca.api.pipeline.models.StageExecution import com.netflix.spinnaker.orca.clouddriver.model.Instance.InstanceInfo +import org.slf4j.Logger import retrofit.converter.JacksonConverter import java.util.concurrent.TimeUnit @@ -66,6 +67,10 @@ class JarDiffsTask implements DiffTask { int platformPort = 8077 + private Logger getLog() { + return log + } + @Override public TaskResult execute(StageExecution stage) { def retriesRemaining = stage.context.jarDiffsRetriesRemaining != null ? stage.context.jarDiffsRetriesRemaining : MAX_RETRIES @@ -137,19 +142,19 @@ class JarDiffsTask implements DiffTask { int numberOfInstancesChecked = 0; instances.find { key, instanceInfo -> if (numberOfInstancesChecked++ >= 5) { - log.info("Unable to check jar list after 5 attempts, giving up!") + getLog().info("Unable to check jar list after 5 attempts, giving up!") return true } String hostName = instanceInfo.privateIpAddress ?: instanceInfo.hostName - log.debug("attempting to get a jar list from : ${key} (${hostName}:${platformPort})") + getLog().debug("attempting to get a jar list from : ${key} (${hostName}:${platformPort})") def instanceService = createInstanceService("http://${hostName}:${platformPort}") try { def instanceResponse = instanceService.getJars() jarMap = objectMapper.readValue(instanceResponse.body.in().text, Map) return true } catch(Exception e) { - log.debug("could not get a jar list from : ${key} (${hostName}:${platformPort}) - ${e.message}") + getLog().debug("could not get a jar list from : ${key} (${hostName}:${platformPort}) - ${e.message}") // swallow it so we can try the next instance return false } diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/quip/TriggerQuipTask.groovy b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/quip/TriggerQuipTask.groovy index 37c653daba..37c0e306a2 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/quip/TriggerQuipTask.groovy +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/quip/TriggerQuipTask.groovy @@ -24,6 +24,7 @@ import com.netflix.spinnaker.orca.api.pipeline.models.StageExecution import com.netflix.spinnaker.orca.api.pipeline.TaskResult import com.netflix.spinnaker.orca.clouddriver.InstanceService import groovy.util.logging.Slf4j +import org.slf4j.Logger import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component import retrofit.client.Client @@ -45,6 +46,10 @@ class TriggerQuipTask extends AbstractQuipTask implements RetryableTask { long backoffPeriod = 10000 long timeout = 600000 // 10min + private Logger getLog() { + return log + } + @Override TaskResult execute(StageExecution stage) { Map taskIdMap = [:] @@ -76,7 +81,7 @@ class TriggerQuipTask extends AbstractQuipTask implements RetryableTask { taskIdMap.put(instanceHostName, ref.substring(1 + ref.lastIndexOf('/'))) patchedInstanceIds << instanceId } catch (SpinnakerServerException e) { - log.warn("Error in Quip request: {}", e.message) + getLog().warn("Error in Quip request: {}", e.message) } } } diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/rollingpush/DetermineTerminationCandidatesTask.groovy b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/rollingpush/DetermineTerminationCandidatesTask.groovy index 67f71073bf..40ee03f66f 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/rollingpush/DetermineTerminationCandidatesTask.groovy +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/tasks/rollingpush/DetermineTerminationCandidatesTask.groovy @@ -51,7 +51,7 @@ class DetermineTerminationCandidatesTask implements Task { .orElseGet { serverGroupInstances*.instanceId } def terminationInstancePool = knownInstanceIds if (stage.context.termination?.instances) { - terminationInstancePool = knownInstanceIds.intersect(stage.context.termination?.instances) + terminationInstancePool = stage.context.termination?.instances.intersect(knownInstanceIds) if (stage.context.termination.order == 'given') { terminationInstancePool = terminationInstancePool.sort { stage.context.termination.instances.indexOf(it) } } diff --git a/orca-core/orca-core.gradle b/orca-core/orca-core.gradle index 5ccdf97546..36bb692228 100644 --- a/orca-core/orca-core.gradle +++ b/orca-core/orca-core.gradle @@ -53,7 +53,7 @@ dependencies { implementation("javax.validation:validation-api") implementation("com.jayway.jsonpath:json-path") implementation("org.yaml:snakeyaml") - implementation("org.codehaus.groovy:groovy") + implementation("org.apache.groovy:groovy") implementation("net.javacrumbs.shedlock:shedlock-spring:4.44.0") implementation("net.javacrumbs.shedlock:shedlock-provider-jdbc-template:4.44.0") diff --git a/orca-front50/orca-front50.gradle b/orca-front50/orca-front50.gradle index 328f989cf4..b208f0e922 100644 --- a/orca-front50/orca-front50.gradle +++ b/orca-front50/orca-front50.gradle @@ -20,7 +20,7 @@ dependencies { implementation(project(":orca-core")) implementation(project(":orca-retrofit")) - api("org.codehaus.groovy:groovy") + api("org.apache.groovy:groovy") implementation("io.spinnaker.fiat:fiat-api:$fiatVersion") implementation("io.spinnaker.fiat:fiat-core:$fiatVersion") @@ -38,7 +38,7 @@ dependencies { testImplementation(project(":orca-test-groovy")) testImplementation(project(":orca-pipelinetemplate")) testImplementation("com.github.ben-manes.caffeine:guava") - testImplementation("org.codehaus.groovy:groovy-json") + testImplementation("org.apache.groovy:groovy-json") testRuntimeOnly("net.bytebuddy:byte-buddy") } diff --git a/orca-integrations-cloudfoundry/orca-integrations-cloudfoundry.gradle b/orca-integrations-cloudfoundry/orca-integrations-cloudfoundry.gradle index 3e36560c32..6b709a4123 100644 --- a/orca-integrations-cloudfoundry/orca-integrations-cloudfoundry.gradle +++ b/orca-integrations-cloudfoundry/orca-integrations-cloudfoundry.gradle @@ -12,7 +12,7 @@ dependencies { implementation(project(":orca-core")) implementation("org.jetbrains:annotations") - testImplementation("org.codehaus.groovy:groovy") + testImplementation("org.apache.groovy:groovy") testImplementation("org.junit.jupiter:junit-jupiter-api") testImplementation("org.assertj:assertj-core") testImplementation("org.mockito:mockito-core:2.25.0") diff --git a/orca-keel/orca-keel.gradle b/orca-keel/orca-keel.gradle index e1e361a710..b63b7472a8 100644 --- a/orca-keel/orca-keel.gradle +++ b/orca-keel/orca-keel.gradle @@ -31,7 +31,7 @@ dependencies { testImplementation("io.mockk:mockk") testImplementation("io.strikt:strikt-jackson") testImplementation("org.assertj:assertj-core") - testImplementation("org.codehaus.groovy:groovy") + testImplementation("org.apache.groovy:groovy") testImplementation("org.junit.jupiter:junit-jupiter-api") testImplementation("org.junit.jupiter:junit-jupiter-params") testImplementation("com.github.tomakehurst:wiremock-jre8-standalone") diff --git a/orca-pipelinetemplate/orca-pipelinetemplate.gradle b/orca-pipelinetemplate/orca-pipelinetemplate.gradle index 6a69122df5..c4657be27b 100644 --- a/orca-pipelinetemplate/orca-pipelinetemplate.gradle +++ b/orca-pipelinetemplate/orca-pipelinetemplate.gradle @@ -28,7 +28,7 @@ dependencies { testImplementation("org.slf4j:slf4j-simple") testImplementation("org.assertj:assertj-core") - testImplementation("org.codehaus.groovy:groovy-json") + testImplementation("org.apache.groovy:groovy-json") testImplementation("io.spinnaker.fiat:fiat-core:$fiatVersion") testImplementation("io.spinnaker.kork:kork-retrofit") testRuntimeOnly("net.bytebuddy:byte-buddy") diff --git a/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaIntegrationSpec.groovy b/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaIntegrationSpec.groovy index b286b8364f..7aebc18f1e 100644 --- a/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaIntegrationSpec.groovy +++ b/orca-pipelinetemplate/src/test/groovy/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaIntegrationSpec.groovy @@ -114,13 +114,13 @@ class V1SchemaIntegrationSpec extends Specification { } if (it.filename.endsWith('-config.yml')) { - test.configuration = objectMapper.convertValue(yaml.load(it.file.text), TemplateConfiguration) + test.configuration = objectMapper.convertValue(yaml.load(it.getFile().text), TemplateConfiguration) } else if (it.filename.endsWith('-expected.json')) { - test.expected = objectMapper.readValue(it.file, Map) + test.expected = objectMapper.readValue(it.getFile(), Map) } else if (it.filename.endsWith('-request.json')) { - test.request = objectMapper.readValue(it.file, Map) + test.request = objectMapper.readValue(it.getFile(), Map) } else { - test.template.add(objectMapper.convertValue(yaml.load(it.file.text), PipelineTemplate)) + test.template.add(objectMapper.convertValue(yaml.load(it.getFile().text), PipelineTemplate)) } } diff --git a/orca-queue/orca-queue.gradle b/orca-queue/orca-queue.gradle index 52636faf1d..80adc85c4a 100644 --- a/orca-queue/orca-queue.gradle +++ b/orca-queue/orca-queue.gradle @@ -41,6 +41,6 @@ dependencies { testImplementation(project(":orca-queue-tck")) testImplementation(project(":orca-queue-redis")) testImplementation(project(":orca-echo")) - testImplementation("org.codehaus.groovy:groovy") + testImplementation("org.apache.groovy:groovy") testImplementation("org.assertj:assertj-core") } diff --git a/orca-retrofit/orca-retrofit.gradle b/orca-retrofit/orca-retrofit.gradle index 1a25549c05..6c1a4bc069 100644 --- a/orca-retrofit/orca-retrofit.gradle +++ b/orca-retrofit/orca-retrofit.gradle @@ -19,7 +19,7 @@ apply from: "$rootDir/gradle/groovy.gradle" dependencies { api("com.squareup.retrofit:retrofit") api("com.squareup.retrofit:converter-jackson") - api("org.codehaus.groovy:groovy") + api("org.apache.groovy:groovy") api("io.spinnaker.kork:kork-web") api("com.jakewharton.retrofit:retrofit1-okhttp3-client") diff --git a/orca-web/orca-web.gradle b/orca-web/orca-web.gradle index c9e6a4c1c5..44e97d4aa6 100644 --- a/orca-web/orca-web.gradle +++ b/orca-web/orca-web.gradle @@ -93,7 +93,7 @@ dependencies { testImplementation("dev.minutest:minutest") testImplementation("io.strikt:strikt-core") testImplementation("io.mockk:mockk") - testImplementation("org.codehaus.groovy:groovy-json") + testImplementation("org.apache.groovy:groovy-json") } test { diff --git a/orca-webhook/orca-webhook.gradle b/orca-webhook/orca-webhook.gradle index 40433fff74..0cf929e10a 100644 --- a/orca-webhook/orca-webhook.gradle +++ b/orca-webhook/orca-webhook.gradle @@ -29,7 +29,7 @@ dependencies { implementation("com.squareup.okhttp3:okhttp") implementation("com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0") testImplementation("org.springframework:spring-test") - testImplementation("org.codehaus.groovy:groovy-json") + testImplementation("org.apache.groovy:groovy-json") testRuntimeOnly("net.bytebuddy:byte-buddy") implementation("io.spinnaker.fiat:fiat-api:$fiatVersion")