From f5a2d09b8377cfa194eca9beda0cba27dc0fd7c6 Mon Sep 17 00:00:00 2001 From: spinnakerbot Date: Tue, 5 Nov 2024 11:26:31 -0500 Subject: [PATCH 1/2] chore(dependencies): Autobump korkVersion (#1452) Co-authored-by: root --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2d27fd26c..f9a8fc74c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ fiatVersion=1.50.0 -korkVersion=7.242.0 +korkVersion=7.243.0 kotlinVersion=1.6.21 org.gradle.parallel=true spinnakerGradleVersion=8.32.1 From 98eb168e904615e2fb348bd907cbf6a136f74e84 Mon Sep 17 00:00:00 2001 From: Kiran Godishala <53332225+kirangodishala@users.noreply.github.com> Date: Wed, 6 Nov 2024 23:14:10 +0530 Subject: [PATCH 2/2] refactor(retrofit): replace OkClient with Ok3Client (#1453) --- .../netflix/spinnaker/echo/config/JiraConfig.java | 4 ++-- .../echo/config/SchedulerConfiguration.groovy | 3 --- echo-telemetry/echo-telemetry.gradle | 1 + .../spinnaker/echo/config/TelemetryConfig.kt | 15 ++++++++------- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/config/JiraConfig.java b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/config/JiraConfig.java index dbf525b0e..7101a5171 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/config/JiraConfig.java +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/config/JiraConfig.java @@ -18,6 +18,7 @@ import static retrofit.Endpoints.newFixedEndpoint; +import com.jakewharton.retrofit.Ok3Client; import com.netflix.spinnaker.echo.jackson.EchoObjectMapper; import com.netflix.spinnaker.echo.jira.JiraProperties; import com.netflix.spinnaker.echo.jira.JiraService; @@ -32,7 +33,6 @@ import org.springframework.context.annotation.Configuration; import retrofit.RestAdapter; import retrofit.client.Client; -import retrofit.client.OkClient; import retrofit.converter.JacksonConverter; @Configuration @@ -42,7 +42,7 @@ public class JiraConfig { private static Logger LOGGER = LoggerFactory.getLogger(JiraConfig.class); @Autowired(required = false) - private OkClient x509ConfiguredClient; + private Ok3Client x509ConfiguredClient; @Bean JiraService jiraService( diff --git a/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/config/SchedulerConfiguration.groovy b/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/config/SchedulerConfiguration.groovy index d712fd996..8ce91fb52 100644 --- a/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/config/SchedulerConfiguration.groovy +++ b/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/config/SchedulerConfiguration.groovy @@ -22,7 +22,6 @@ import com.netflix.spinnaker.echo.scheduler.actions.pipeline.QuartzDiscoveryActi import com.netflix.spinnaker.echo.scheduler.actions.pipeline.TriggerConverter import com.netflix.spinnaker.echo.scheduler.actions.pipeline.TriggerListener import com.netflix.spinnaker.kork.sql.config.DefaultSqlConfiguration -import com.squareup.okhttp.OkHttpClient import org.quartz.JobDetail import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression @@ -34,8 +33,6 @@ import org.springframework.context.annotation.Import import org.springframework.scheduling.quartz.JobDetailFactoryBean import org.springframework.scheduling.quartz.SchedulerFactoryBean import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean -import retrofit.client.Client -import retrofit.client.OkClient import javax.sql.DataSource import java.util.concurrent.TimeUnit diff --git a/echo-telemetry/echo-telemetry.gradle b/echo-telemetry/echo-telemetry.gradle index d921f000a..530f3e8d3 100644 --- a/echo-telemetry/echo-telemetry.gradle +++ b/echo-telemetry/echo-telemetry.gradle @@ -25,6 +25,7 @@ dependencies { implementation "io.spinnaker.kork:kork-proto" implementation "io.spinnaker.kork:kork-security" implementation 'io.spinnaker.kork:kork-web' + implementation 'com.jakewharton.retrofit:retrofit1-okhttp3-client' implementation 'com.squareup.retrofit:retrofit' implementation 'com.squareup.retrofit:converter-jackson' implementation 'de.huxhorn.sulky:de.huxhorn.sulky.ulid' diff --git a/echo-telemetry/src/main/java/com/netflix/spinnaker/echo/config/TelemetryConfig.kt b/echo-telemetry/src/main/java/com/netflix/spinnaker/echo/config/TelemetryConfig.kt index 9d867f664..073e7036c 100644 --- a/echo-telemetry/src/main/java/com/netflix/spinnaker/echo/config/TelemetryConfig.kt +++ b/echo-telemetry/src/main/java/com/netflix/spinnaker/echo/config/TelemetryConfig.kt @@ -15,13 +15,14 @@ */ package com.netflix.spinnaker.echo.config +import com.jakewharton.retrofit.Ok3Client import com.netflix.spinnaker.echo.config.TelemetryConfig.TelemetryConfigProps import com.netflix.spinnaker.echo.telemetry.TelemetryService import com.netflix.spinnaker.retrofit.RetrofitConfigurationProperties import com.netflix.spinnaker.retrofit.Slf4jRetrofitLogger -import com.squareup.okhttp.OkHttpClient import de.huxhorn.sulky.ulid.ULID import java.util.concurrent.TimeUnit +import okhttp3.OkHttpClient import org.slf4j.LoggerFactory import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.boot.context.properties.ConfigurationProperties @@ -29,7 +30,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import retrofit.RestAdapter -import retrofit.client.OkClient import retrofit.converter.JacksonConverter @Configuration @@ -57,11 +57,12 @@ open class TelemetryConfig { .create(TelemetryService::class.java) } - private fun telemetryOkClient(configProps: TelemetryConfigProps): OkClient { - val httpClient = OkHttpClient() - httpClient.setConnectTimeout(configProps.connectionTimeoutMillis.toLong(), TimeUnit.MILLISECONDS) - httpClient.setReadTimeout(configProps.readTimeoutMillis.toLong(), TimeUnit.MILLISECONDS) - return OkClient(httpClient) + private fun telemetryOkClient(configProps: TelemetryConfigProps): Ok3Client { + val httpClient = OkHttpClient.Builder() + .connectTimeout(configProps.connectionTimeoutMillis.toLong(), TimeUnit.MILLISECONDS) + .readTimeout(configProps.readTimeoutMillis.toLong(), TimeUnit.MILLISECONDS) + .build() + return Ok3Client(httpClient) } @ConfigurationProperties(prefix = "stats")