From 5b3c5ed7d3b73eac701bc33cfcf79f28e6d1c1b1 Mon Sep 17 00:00:00 2001 From: Anders Rognstad Date: Tue, 21 May 2024 13:21:43 +0200 Subject: [PATCH] IS-2335: Fix versions, dependabot and postgres-embedded dependency --- .github/dependabot.yaml | 12 +- build.gradle.kts | 127 +++++++++--------- .../kotlin/no/nav/syfo/testutil/TestDB.kt | 2 +- 3 files changed, 72 insertions(+), 69 deletions(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 3752d822..b78aa3d3 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -10,6 +10,12 @@ updates: - package-ecosystem: gradle directory: "/" schedule: - interval: daily - time: "07:00" - open-pull-requests-limit: 10 \ No newline at end of file + interval: weekly + open-pull-requests-limit: 10 + groups: + minor-and-patch: + patterns: + - "*" + update-types: + - "minor" + - "patch" diff --git a/build.gradle.kts b/build.gradle.kts index 8c934b6b..62775ac3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,30 +1,27 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import org.apache.tools.ant.taskdefs.condition.Os group = "no.nav.syfo" version = "1.0-SNAPSHOT" -object Versions { - const val confluent = "7.5.1" - const val jacksonDataType = "2.16.1" - const val flyway = "9.22.3" - const val hikari = "5.1.0" - const val isdialogmoteSchema = "1.0.5" - const val json = "20231013" - const val jetty = "9.4.53.v20231009" - const val kafka = "3.6.1" - const val kafkaEmbedded = "3.2.3" - const val kluent = "1.73" - const val ktor = "2.3.8" - const val logback = "1.4.14" - const val logstashEncoder = "7.4" - const val micrometerRegistry = "1.12.2" - const val mockk = "1.13.9" - const val nimbusjosejwt = "9.37.3" - const val postgres = "42.7.2" - val postgresEmbedded = if (Os.isFamily(Os.FAMILY_MAC)) "1.0.0" else "0.13.4" - const val spek = "2.0.19" -} +val confluentVersion = "7.5.1" +val jacksonDataTypeVersion = "2.16.1" +val flywayVersion = "9.22.3" +val hikariVersion = "5.1.0" +val isdialogmoteSchemaVersion = "1.0.5" +val jsonVersion = "20231013" +val jettyVersion = "9.4.53.v20231009" +val kafkaVersion = "3.6.1" +val kafkaEmbeddedVersion = "3.2.3" +val kluentVersion = "1.73" +val ktorVersion = "2.3.8" +val logbackVersion = "1.4.14" +val logstashEncoderVersion = "7.4" +val micrometerRegistryVersion = "1.12.2" +val mockkVersion = "1.13.9" +val nimbusjosejwtVersion = "9.37.3" +val postgresVersion = "42.7.2" +val postgresEmbeddedVersion = "2.0.7" +val spekVersion = "2.0.19" plugins { kotlin("jvm") version "1.9.23" @@ -52,43 +49,43 @@ dependencies { implementation(kotlin("stdlib")) implementation(kotlin("reflect")) - implementation("io.ktor:ktor-server-auth-jwt:${Versions.ktor}") - implementation("io.ktor:ktor-server-content-negotiation:${Versions.ktor}") - implementation("io.ktor:ktor-server-call-id:${Versions.ktor}") - implementation("io.ktor:ktor-server-status-pages:${Versions.ktor}") - implementation("io.ktor:ktor-server-netty:${Versions.ktor}") - implementation("io.ktor:ktor-client-apache:${Versions.ktor}") - implementation("io.ktor:ktor-client-cio:${Versions.ktor}") - implementation("io.ktor:ktor-client-content-negotiation:${Versions.ktor}") - implementation("io.ktor:ktor-serialization-jackson:${Versions.ktor}") + implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion") + implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion") + implementation("io.ktor:ktor-server-call-id:$ktorVersion") + implementation("io.ktor:ktor-server-status-pages:$ktorVersion") + implementation("io.ktor:ktor-server-netty:$ktorVersion") + implementation("io.ktor:ktor-client-apache:$ktorVersion") + implementation("io.ktor:ktor-client-cio:$ktorVersion") + implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion") + implementation("io.ktor:ktor-serialization-jackson:$ktorVersion") // Logging - implementation("ch.qos.logback:logback-classic:${Versions.logback}") - implementation("net.logstash.logback:logstash-logback-encoder:${Versions.logstashEncoder}") - implementation("org.json:json:${Versions.json}") + implementation("ch.qos.logback:logback-classic:$logbackVersion") + implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion") + implementation("org.json:json:$jsonVersion") // Metrics and Prometheus - implementation("io.ktor:ktor-server-metrics-micrometer:${Versions.ktor}") - implementation("io.micrometer:micrometer-registry-prometheus:${Versions.micrometerRegistry}") + implementation("io.ktor:ktor-server-metrics-micrometer:$ktorVersion") + implementation("io.micrometer:micrometer-registry-prometheus:$micrometerRegistryVersion") // (De-)serialization - implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${Versions.jacksonDataType}") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonDataTypeVersion") // Database - implementation("org.postgresql:postgresql:${Versions.postgres}") - implementation("org.flywaydb:flyway-core:${Versions.flyway}") - implementation("com.zaxxer:HikariCP:${Versions.hikari}") - testImplementation("com.opentable.components:otj-pg-embedded:${Versions.postgresEmbedded}") + implementation("org.postgresql:postgresql:$postgresVersion") + implementation("org.flywaydb:flyway-core:$flywayVersion") + implementation("com.zaxxer:HikariCP:$hikariVersion") + testImplementation("io.zonky.test:embedded-postgres:$postgresEmbeddedVersion") val excludeLog4j = fun ExternalModuleDependency.() { exclude(group = "log4j") } // Kafka - implementation("org.apache.kafka:kafka_2.13:${Versions.kafka}", excludeLog4j) - implementation("io.confluent:kafka-avro-serializer:${Versions.confluent}") + implementation("org.apache.kafka:kafka_2.13:$kafkaVersion", excludeLog4j) + implementation("io.confluent:kafka-avro-serializer:$confluentVersion") constraints { implementation("org.apache.avro:avro") { - because("io.confluent:kafka-avro-serializer:${Versions.confluent} -> https://www.cve.org/CVERecord?id=CVE-2023-39410") + because("io.confluent:kafka-avro-serializer:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-39410") version { require("1.11.3") } @@ -106,57 +103,57 @@ dependencies { } } } - implementation("io.confluent:kafka-schema-registry:${Versions.confluent}", excludeLog4j) + implementation("io.confluent:kafka-schema-registry:$confluentVersion", excludeLog4j) constraints { implementation("org.apache.zookeeper:zookeeper") { - because("io.confluent:kafka-schema-registry:${Versions.confluent} -> https://www.cve.org/CVERecord?id=CVE-2023-44981") + because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-44981") version { require("3.7.2") } } implementation("com.google.protobuf:protobuf-java") { - because("io.confluent:kafka-schema-registry:${Versions.confluent} -> https://www.cve.org/CVERecord?id=CVE-2021-22569") + because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2021-22569") version { require("3.25.1") } } implementation("org.eclipse.jetty:jetty-server") { - because("io.confluent:kafka-schema-registry:${Versions.confluent} -> https://www.cve.org/CVERecord?id=CVE-2023-36478") + because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478") version { - require(Versions.jetty) + require(jettyVersion) } } implementation("org.eclipse.jetty:jetty-xml") { - because("io.confluent:kafka-schema-registry:${Versions.confluent} -> https://www.cve.org/CVERecord?id=CVE-2023-36478") + because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478") version { - require(Versions.jetty) + require(jettyVersion) } } implementation("org.eclipse.jetty:jetty-servlets") { - because("io.confluent:kafka-schema-registry:${Versions.confluent} -> https://www.cve.org/CVERecord?id=CVE-2023-36478") + because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478") version { - require(Versions.jetty) + require(jettyVersion) } } implementation("org.eclipse.jetty.http2:http2-server") { - because("io.confluent:kafka-schema-registry:${Versions.confluent} -> https://www.cve.org/CVERecord?id=CVE-2023-36478") + because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478") version { - require(Versions.jetty) + require(jettyVersion) } } } - implementation("no.nav.syfo.dialogmote.avro:isdialogmote-schema:${Versions.isdialogmoteSchema}") - testImplementation("no.nav:kafka-embedded-env:${Versions.kafkaEmbedded}", excludeLog4j) - - testImplementation("com.nimbusds:nimbus-jose-jwt:${Versions.nimbusjosejwt}") - testImplementation("io.ktor:ktor-server-test-host:${Versions.ktor}") - testImplementation("io.ktor:ktor-client-mock:${Versions.ktor}") - testImplementation("io.mockk:mockk:${Versions.mockk}") - testImplementation("org.amshove.kluent:kluent:${Versions.kluent}") - testImplementation("org.spekframework.spek2:spek-dsl-jvm:${Versions.spek}") { + implementation("no.nav.syfo.dialogmote.avro:isdialogmote-schema:$isdialogmoteSchemaVersion") + testImplementation("no.nav:kafka-embedded-env:$kafkaEmbeddedVersion", excludeLog4j) + + testImplementation("com.nimbusds:nimbus-jose-jwt:$nimbusjosejwtVersion") + testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") + testImplementation("io.ktor:ktor-client-mock:$ktorVersion") + testImplementation("io.mockk:mockk:$mockkVersion") + testImplementation("org.amshove.kluent:kluent:$kluentVersion") + testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion") { exclude(group = "org.jetbrains.kotlin") } - testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:${Versions.spek}") { + testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion") { exclude(group = "org.jetbrains.kotlin") } } diff --git a/src/test/kotlin/no/nav/syfo/testutil/TestDB.kt b/src/test/kotlin/no/nav/syfo/testutil/TestDB.kt index ad752cca..7580574d 100644 --- a/src/test/kotlin/no/nav/syfo/testutil/TestDB.kt +++ b/src/test/kotlin/no/nav/syfo/testutil/TestDB.kt @@ -1,6 +1,6 @@ package no.nav.syfo.testutil -import com.opentable.db.postgres.embedded.EmbeddedPostgres +import io.zonky.test.db.postgres.embedded.EmbeddedPostgres import no.nav.syfo.database.DatabaseInterface import no.nav.syfo.database.toList import no.nav.syfo.dialogmotestatusendring.domain.PDialogmoteStatusendring