From 05873d3e5650a7320d95f98bfcb613f017ff829c Mon Sep 17 00:00:00 2001 From: Bastiaan Date: Fri, 8 Mar 2024 13:51:42 +0100 Subject: [PATCH 1/6] bump dev version to 1.1.3-SNAPSHOT --- buildSrc/src/main/kotlin/Versions.kt | 2 +- radar-commons-gradle/build.gradle.kts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index c3ee5dd..383dc3e 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,6 +1,6 @@ @Suppress("ConstPropertyName", "MemberVisibilityCanBePrivate") object Versions { - const val project = "1.1.2" + const val project = "1.1.3-SNAPSHOT" object Plugins { const val licenseReport = "2.5" diff --git a/radar-commons-gradle/build.gradle.kts b/radar-commons-gradle/build.gradle.kts index 9585a34..909d919 100644 --- a/radar-commons-gradle/build.gradle.kts +++ b/radar-commons-gradle/build.gradle.kts @@ -12,7 +12,7 @@ plugins { signing } -version = "1.1.2" +version = "1.1.3-SNAPSHOT" group = "org.radarbase" description = "RADAR-base common Gradle plugin setup" @@ -176,7 +176,7 @@ tasks.withType { // They should be copied from the Versions.kt file directly to maintain consistency. @Suppress("ConstPropertyName", "MemberVisibilityCanBePrivate") object Versions { - const val project = "1.1.2" + const val project = "1.1.3-SNAPSHOT" object Plugins { const val licenseReport = "2.5" From 66993f5d28de92a2e31938242d679ecb0be00c47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 00:04:04 +0000 Subject: [PATCH 2/6] Bump io.github.gradle-nexus.publish-plugin from 2.0.0-rc-1 to 2.0.0 Bumps io.github.gradle-nexus.publish-plugin from 2.0.0-rc-1 to 2.0.0. --- updated-dependencies: - dependency-name: io.github.gradle-nexus.publish-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- radar-commons-gradle/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radar-commons-gradle/build.gradle.kts b/radar-commons-gradle/build.gradle.kts index 9585a34..78006cc 100644 --- a/radar-commons-gradle/build.gradle.kts +++ b/radar-commons-gradle/build.gradle.kts @@ -7,7 +7,7 @@ plugins { // Match to the versions in the bottom of this file kotlin("jvm") version "1.9.21" `maven-publish` - id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" id("org.jetbrains.dokka") version "1.9.10" signing } From be3179a2136c220ed37fe714c69f5c1927b631cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 00:58:11 +0000 Subject: [PATCH 3/6] Bump jvm from 1.9.21 to 1.9.24 Bumps [jvm](https://github.com/JetBrains/kotlin) from 1.9.21 to 1.9.24. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.24/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.21...v1.9.24) --- updated-dependencies: - dependency-name: jvm dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- radar-commons-gradle/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radar-commons-gradle/build.gradle.kts b/radar-commons-gradle/build.gradle.kts index 9585a34..c50b08a 100644 --- a/radar-commons-gradle/build.gradle.kts +++ b/radar-commons-gradle/build.gradle.kts @@ -5,7 +5,7 @@ plugins { `kotlin-dsl` `java-gradle-plugin` // Match to the versions in the bottom of this file - kotlin("jvm") version "1.9.21" + kotlin("jvm") version "1.9.24" `maven-publish` id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1" id("org.jetbrains.dokka") version "1.9.10" From 8e589c782bb3eaa8cbc451fd2f455aa00954e51e Mon Sep 17 00:00:00 2001 From: Bastiaan Date: Thu, 23 May 2024 18:02:33 +0200 Subject: [PATCH 4/6] Move httpclient configuration into the config class --- buildSrc/src/main/kotlin/Versions.kt | 12 ++++----- radar-commons-gradle/build.gradle.kts | 15 ++++++----- .../producer/schema/SchemaRestClient.kt | 25 +++++++++---------- .../producer/schema/SchemaRetriever.kt | 2 +- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 383dc3e..787103c 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -14,17 +14,17 @@ object Versions { } const val java = 17 - const val slf4j = "2.0.9" - const val confluent = "7.5.0" - const val kafka = "7.5.0-ce" + const val slf4j = "2.0.13" + const val confluent = "7.6.0" + const val kafka = "${confluent}-ce" const val avro = "1.11.3" - const val jackson = "2.15.2" - const val okhttp = "4.11.0" + const val jackson = "2.15.3" + const val okhttp = "4.12.0" const val junit = "5.10.0" const val mockito = "5.5.0" const val mockitoKotlin = "5.1.0" const val hamcrest = "2.2" - const val radarSchemas = "0.8.4" + const val radarSchemas = "0.8.8" const val opencsv = "5.8" const val ktor = "2.3.4" const val coroutines = "1.7.3" diff --git a/radar-commons-gradle/build.gradle.kts b/radar-commons-gradle/build.gradle.kts index 66e4254..73bcfc2 100644 --- a/radar-commons-gradle/build.gradle.kts +++ b/radar-commons-gradle/build.gradle.kts @@ -190,17 +190,17 @@ object Versions { } const val java = 17 - const val slf4j = "2.0.9" - const val confluent = "7.5.0" - const val kafka = "7.5.0-ce" + const val slf4j = "2.0.13" + const val confluent = "7.6.0" + const val kafka = "${confluent}-ce" const val avro = "1.11.3" - const val jackson = "2.15.2" - const val okhttp = "4.11.0" - const val junit = "5.10.0" + const val jackson = "2.15.3" + const val okhttp = "4.12.0" + const val junit = "5.10.3" const val mockito = "5.5.0" const val mockitoKotlin = "5.1.0" const val hamcrest = "2.2" - const val radarSchemas = "0.8.4" + const val radarSchemas = "0.8.8" const val opencsv = "5.8" const val ktor = "2.3.4" const val coroutines = "1.7.3" @@ -210,4 +210,3 @@ object Versions { const val gradleVersionsPlugin = "0.50.0" const val ktlint = "12.0.3" } - diff --git a/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRestClient.kt b/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRestClient.kt index 59fa1d1..1e85dab 100644 --- a/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRestClient.kt +++ b/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRestClient.kt @@ -2,13 +2,10 @@ package org.radarbase.producer.schema import io.ktor.client.HttpClient import io.ktor.client.call.body +import io.ktor.client.plugins.auth.* +import io.ktor.client.plugins.auth.providers.* import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.client.plugins.defaultRequest -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.client.request.accept -import io.ktor.client.request.request -import io.ktor.client.request.setBody -import io.ktor.client.request.url +import io.ktor.client.request.* import io.ktor.http.ContentType import io.ktor.http.HttpMethod import io.ktor.http.contentType @@ -21,13 +18,15 @@ import kotlinx.coroutines.withContext import kotlinx.serialization.json.Json import org.apache.avro.Schema import org.radarbase.producer.rest.RestException.Companion.toRestException +import org.slf4j.LoggerFactory import java.io.IOException +import java.net.URI import kotlin.coroutines.CoroutineContext /** REST client for Confluent schema registry. */ class SchemaRestClient( httpClient: HttpClient, - baseUrl: String, + private val baseUrl: String, private val ioContext: CoroutineContext = Dispatchers.IO, ) { private val httpClient: HttpClient = httpClient.config { @@ -39,10 +38,6 @@ class SchemaRestClient( }, ) } - defaultRequest { - url(baseUrl) - accept(ContentType.Application.Json) - } } suspend inline fun request( @@ -88,7 +83,7 @@ class SchemaRestClient( @Throws(IOException::class) suspend fun schemaGet(path: String): SchemaMetadata = request { method = HttpMethod.Get - url(path) + url(URI(baseUrl).resolve(path).toString()) } @Throws(IOException::class) @@ -97,7 +92,7 @@ class SchemaRestClient( schema: Schema, ): SchemaMetadata = request { method = HttpMethod.Post - url(path) + url(URI(baseUrl).resolve(path).toString()) contentType(ContentType.Application.Json) setBody(SchemaMetadata(schema = schema.toString())) } @@ -132,4 +127,8 @@ class SchemaRestClient( schemaGet("/schemas/ids/$id") .toParsedSchemaMetadata(id) .schema + + companion object { + private val logger = LoggerFactory.getLogger(SchemaRestClient::class.java) + } } diff --git a/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRetriever.kt b/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRetriever.kt index 29d792b..82824b2 100644 --- a/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRetriever.kt +++ b/radar-commons/src/main/java/org/radarbase/producer/schema/SchemaRetriever.kt @@ -205,8 +205,8 @@ open class SchemaRetriever(config: Config) { @RadarProducerDsl class Config( val baseUrl: String, + var httpClient: HttpClient? = null, ) { - var httpClient: HttpClient? = null var schemaTimeout: CacheConfig = DEFAULT_SCHEMA_TIMEOUT_CONFIG var ioContext: CoroutineContext = Dispatchers.IO fun httpClient(config: HttpClientConfig<*>.() -> Unit) { From db54bc2f06f8836e6aef6b5d8896c998b97776fb Mon Sep 17 00:00:00 2001 From: Bastiaan Date: Mon, 10 Jun 2024 11:56:03 +0200 Subject: [PATCH 5/6] Configure Snyk to run on dev branch PRs --- .github/workflows/snyk.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/snyk.yaml b/.github/workflows/snyk.yaml index 5cc94b1..43ba556 100644 --- a/.github/workflows/snyk.yaml +++ b/.github/workflows/snyk.yaml @@ -3,6 +3,7 @@ on: pull_request: branches: - master + - dev jobs: security: From a0e5617480f65c2dc489ba0ebec4c9de4c0550f0 Mon Sep 17 00:00:00 2001 From: Bastiaan Date: Mon, 10 Jun 2024 12:43:55 +0200 Subject: [PATCH 6/6] Remove SNAPSHOT version --- buildSrc/src/main/kotlin/Versions.kt | 2 +- radar-commons-gradle/build.gradle.kts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 787103c..e53af7f 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,6 +1,6 @@ @Suppress("ConstPropertyName", "MemberVisibilityCanBePrivate") object Versions { - const val project = "1.1.3-SNAPSHOT" + const val project = "1.1.3" object Plugins { const val licenseReport = "2.5" diff --git a/radar-commons-gradle/build.gradle.kts b/radar-commons-gradle/build.gradle.kts index 73bcfc2..5d9a9d2 100644 --- a/radar-commons-gradle/build.gradle.kts +++ b/radar-commons-gradle/build.gradle.kts @@ -12,7 +12,7 @@ plugins { signing } -version = "1.1.3-SNAPSHOT" +version = Versions.project group = "org.radarbase" description = "RADAR-base common Gradle plugin setup" @@ -176,7 +176,7 @@ tasks.withType { // They should be copied from the Versions.kt file directly to maintain consistency. @Suppress("ConstPropertyName", "MemberVisibilityCanBePrivate") object Versions { - const val project = "1.1.3-SNAPSHOT" + const val project = "1.1.3" object Plugins { const val licenseReport = "2.5" @@ -196,7 +196,7 @@ object Versions { const val avro = "1.11.3" const val jackson = "2.15.3" const val okhttp = "4.12.0" - const val junit = "5.10.3" + const val junit = "5.10.0" const val mockito = "5.5.0" const val mockitoKotlin = "5.1.0" const val hamcrest = "2.2"