From e88d279e3399711bf1cc60d0a4b88e6dbab27a54 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 28 Dec 2022 13:53:02 -0800 Subject: [PATCH 1/5] Sort the file. --- deps.toml | 126 +++++++++++++++++++++++++++--------------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/deps.toml b/deps.toml index 9caa7b4c8509..9ac2ffc142bf 100644 --- a/deps.toml +++ b/deps.toml @@ -1,57 +1,42 @@ [versions] +commons_io = "2.7" +connectors-destination-testcontainers-clickhouse = "1.17.3" +connectors-destination-testcontainers-elasticsearch = "1.17.3" +connectors-destination-testcontainers-oracle-xe = "1.17.3" +connectors-source-testcontainers-clickhouse = "1.17.3" +connectors-testcontainers = "1.15.3" +connectors-testcontainers-cassandra = "1.16.0" +connectors-testcontainers-mariadb = "1.16.2" +connectors-testcontainers-pulsar = "1.16.2" +connectors-testcontainers-scylla = "1.16.2" +connectors-testcontainers-tidb = "1.16.3" datadog-version = "0.111.0" fasterxml_version = "2.13.3" flyway = "7.14.0" glassfish_version = "2.31" hikaricp = "5.0.1" -commons_io = "2.7" -log4j = "2.17.2" -slf4j = "1.7.36" -lombok = "1.18.24" jooq = "3.13.4" junit-jupiter = "5.9.0" +log4j = "2.17.2" +lombok = "1.18.24" micronaut = "3.7.4" micronaut-test = "3.7.0" -postgresql = "42.3.5" -connectors-testcontainers = "1.15.3" -connectors-testcontainers-cassandra = "1.16.0" -connectors-testcontainers-mariadb = "1.16.2" -connectors-testcontainers-pulsar = "1.16.2" -connectors-testcontainers-scylla = "1.16.2" -connectors-testcontainers-tidb = "1.16.3" -connectors-destination-testcontainers-clickhouse = "1.17.3" -connectors-destination-testcontainers-oracle-xe = "1.17.3" -connectors-destination-testcontainers-elasticsearch = "1.17.3" -connectors-source-testcontainers-clickhouse = "1.17.3" platform-testcontainers = "1.17.3" +postgresql = "42.3.5" +slf4j = "1.7.36" temporal = "1.17.0" [libraries] -fasterxml = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "fasterxml_version" } -glassfish = { module = "org.glassfish.jersey:jackson-bom", version.ref = "glassfish_version" } -jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "fasterxml_version" } -jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "fasterxml_version" } -jackson-dataformat = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "fasterxml_version" } -jackson-datatype = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "fasterxml_version" } -guava = { module = "com.google.guava:guava", version = "31.1-jre" } -commons-io = { module = "commons-io:commons-io", version.ref = "commons_io" } apache-commons = { module = "org.apache.commons:commons-compress", version = "1.20" } apache-commons-lang = { module = "org.apache.commons:commons-lang3", version = "3.11" } -slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } -log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } -log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } -log4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" } -log4j-web = { module = "org.apache.logging.log4j:log4j-web", version.ref = "log4j" } -jul-to-slf4j = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" } -jcl-over-slf4j = { module = "org.slf4j:jcl-over-slf4j", version.ref = "slf4j" } -hikaricp = { module = "com.zaxxer:HikariCP", version.ref = "hikaricp" } -java-dogstatsd-client = { module = "com.datadoghq:java-dogstatsd-client", version = "4.1.0" } -javax-databind = { module = "javax.xml.bind:jaxb-api", version = "2.4.0-b180830.0359" } -jooq = { module = "org.jooq:jooq", version.ref = "jooq" } -jooq-codegen = { module = "org.jooq:jooq-codegen", version.ref = "jooq" } -jooq-meta = { module = "org.jooq:jooq-meta", version.ref = "jooq" } -postgresql = { module = "org.postgresql:postgresql", version.ref = "postgresql" } -flyway-core = { module = "org.flywaydb:flyway-core", version.ref = "flyway" } +appender-log4j2 = { module = "com.therealvan:appender-log4j2", version = "3.6.0" } +assertj-core = { module = "org.assertj:assertj-core", version = "3.21.0" } +aws-java-sdk-s3 = { module = "com.amazonaws:aws-java-sdk-s3", version = "1.12.6" } +commons-io = { module = "commons-io:commons-io", version.ref = "commons_io" } +connectors-destination-testcontainers-clickhouse = { module = "org.testcontainers:clickhouse", version.ref = "connectors-destination-testcontainers-clickhouse" } +connectors-destination-testcontainers-oracle-xe = { module = "org.testcontainers:oracle-xe", version.ref = "connectors-destination-testcontainers-oracle-xe" } +connectors-source-testcontainers-clickhouse = { module = "org.testcontainers:clickhouse", version.ref = "connectors-source-testcontainers-clickhouse" } +connectors-source-testcontainers-oracle-xe = { module = "org.testcontainers:oracle-xe", version.ref = "connectors-testcontainers" } connectors-testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "connectors-testcontainers" } connectors-testcontainers-cassandra = { module = "org.testcontainers:cassandra", version.ref = "connectors-testcontainers-cassandra" } connectors-testcontainers-cockroachdb = { module = "org.testcontainers:cockroachdb", version.ref = "connectors-testcontainers" } @@ -67,36 +52,51 @@ connectors-testcontainers-postgresql = { module = "org.testcontainers:postgresql connectors-testcontainers-pulsar = { module = "org.testcontainers:pulsar", version.ref = "connectors-testcontainers-pulsar" } connectors-testcontainers-scylla = { module = "org.testcontainers:testcontainers", version.ref = "connectors-testcontainers-scylla" } connectors-testcontainers-tidb = { module = "org.testcontainers:testcontainers", version.ref = "connectors-testcontainers-tidb" } -connectors-destination-testcontainers-clickhouse = { module = "org.testcontainers:clickhouse", version.ref = "connectors-destination-testcontainers-clickhouse" } -connectors-destination-testcontainers-oracle-xe = { module = "org.testcontainers:oracle-xe", version.ref = "connectors-destination-testcontainers-oracle-xe" } -connectors-source-testcontainers-clickhouse = { module = "org.testcontainers:clickhouse", version.ref = "connectors-source-testcontainers-clickhouse" } -connectors-source-testcontainers-oracle-xe = { module = "org.testcontainers:oracle-xe", version.ref = "connectors-testcontainers" } -platform-testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "platform-testcontainers" } -platform-testcontainers-cockroachdb = { module = "org.testcontainers:cockroachdb", version.ref = "platform-testcontainers" } -platform-testcontainers-jdbc = { module = "org.testcontainers:jdbc", version.ref = "platform-testcontainers" } -platform-testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "platform-testcontainers" } -log4j-over-slf4j = { module = "org.slf4j:log4j-over-slf4j", version.ref = "slf4j" } -appender-log4j2 = { module = "com.therealvan:appender-log4j2", version = "3.6.0" } -aws-java-sdk-s3 = { module = "com.amazonaws:aws-java-sdk-s3", version = "1.12.6" } +datadog-trace-api = { module = "com.datadoghq:dd-trace-api", version.ref = "datadog-version" } +datadog-trace-ot = { module = "com.datadoghq:dd-trace-ot", version.ref = "datadog-version" } +fasterxml = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "fasterxml_version" } +findsecbugs-plugin = { module = "com.h3xstream.findsecbugs:findsecbugs-plugin", version = "1.12.0" } +flyway-core = { module = "org.flywaydb:flyway-core", version.ref = "flyway" } +glassfish = { module = "org.glassfish.jersey:jackson-bom", version.ref = "glassfish_version" } google-cloud-storage = { module = "com.google.cloud:google-cloud-storage", version = "2.2.2" } -s3 = { module = "software.amazon.awssdk:s3", version = "2.16.84" } -lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" } -junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" } +guava = { module = "com.google.guava:guava", version = "31.1-jre" } +hikaricp = { module = "com.zaxxer:HikariCP", version.ref = "hikaricp" } +jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "fasterxml_version" } +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "fasterxml_version" } +jackson-dataformat = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "fasterxml_version" } +jackson-datatype = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "fasterxml_version" } +java-dogstatsd-client = { module = "com.datadoghq:java-dogstatsd-client", version = "4.1.0" } +javax-databind = { module = "javax.xml.bind:jaxb-api", version = "2.4.0-b180830.0359" } +jcl-over-slf4j = { module = "org.slf4j:jcl-over-slf4j", version.ref = "slf4j" } +jooq = { module = "org.jooq:jooq", version.ref = "jooq" } +jooq-codegen = { module = "org.jooq:jooq-codegen", version.ref = "jooq" } +jooq-meta = { module = "org.jooq:jooq-meta", version.ref = "jooq" } +jul-to-slf4j = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" } junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" } +junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" } junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter" } -mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version = "4.0.0" } -assertj-core = { module = "org.assertj:assertj-core", version = "3.21.0" } junit-pioneer = { module = "org.junit-pioneer:junit-pioneer", version = "1.7.1" } -findsecbugs-plugin = { module = "com.h3xstream.findsecbugs:findsecbugs-plugin", version = "1.12.0" } -spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version = "4.7.3" } +log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } +log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } +log4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" } +log4j-over-slf4j = { module = "org.slf4j:log4j-over-slf4j", version.ref = "slf4j" } +log4j-web = { module = "org.apache.logging.log4j:log4j-web", version.ref = "log4j" } +lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" } +micrometer-statsd = { module = "io.micrometer:micrometer-registry-statsd", version = "1.9.3" } +mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version = "4.0.0" } otel-bom = { module = "io.opentelemetry:opentelemetry-bom", version = "1.14.0" } -otel-semconv = { module = "io.opentelemetry:opentelemetry-semconv", version = "1.14.0-alpha" } otel-sdk = { module = "io.opentelemetry:opentelemetry-sdk-metrics", version = "1.14.0" } otel-sdk-testing = { module = "io.opentelemetry:opentelemetry-sdk-metrics-testing", version = "1.13.0-alpha" } -micrometer-statsd = { module = "io.micrometer:micrometer-registry-statsd", version = "1.9.3" } -datadog-trace-api = { module = "com.datadoghq:dd-trace-api", version.ref = "datadog-version" } -datadog-trace-ot = { module = "com.datadoghq:dd-trace-ot", version.ref = "datadog-version" } +otel-semconv = { module = "io.opentelemetry:opentelemetry-semconv", version = "1.14.0-alpha" } +platform-testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "platform-testcontainers" } +platform-testcontainers-cockroachdb = { module = "org.testcontainers:cockroachdb", version.ref = "platform-testcontainers" } +platform-testcontainers-jdbc = { module = "org.testcontainers:jdbc", version.ref = "platform-testcontainers" } +platform-testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "platform-testcontainers" } +postgresql = { module = "org.postgresql:postgresql", version.ref = "postgresql" } quartz-scheduler = { module = "org.quartz-scheduler:quartz", version = "2.3.2" } +s3 = { module = "software.amazon.awssdk:s3", version = "2.16.84" } +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version = "4.7.3" } temporal-sdk = { module = "io.temporal:temporal-sdk", version.ref = "temporal" } temporal-serviceclient = { module = "io.temporal:temporal-serviceclient", version.ref = "temporal" } temporal-testing = { module = "io.temporal:temporal-testing", version.ref = "temporal" } @@ -125,15 +125,15 @@ micronaut-test-junit5 = { module = "io.micronaut.test:micronaut-test-junit5", ve micronaut-validation = { module = "io.micronaut:micronaut-validation" } [bundles] -jackson = ["jackson-databind", "jackson-annotations", "jackson-dataformat", "jackson-datatype"] apache = ["apache-commons", "apache-commons-lang"] datadog = ["datadog-trace-api", "datadog-trace-ot"] -log4j = ["log4j-api", "log4j-core", "log4j-impl", "log4j-web"] -slf4j = ["jul-to-slf4j", "jcl-over-slf4j", "log4j-over-slf4j"] +jackson = ["jackson-databind", "jackson-annotations", "jackson-dataformat", "jackson-datatype"] junit = ["junit-jupiter-api", "junit-jupiter-params", "mockito-junit-jupiter"] +log4j = ["log4j-api", "log4j-core", "log4j-impl", "log4j-web"] micronaut = ["jakarta-inject", "javax-transaction", "micronaut-http-server-netty", "micronaut-http-client", "micronaut-inject", "micronaut-validation", "micronaut-runtime", "micronaut-management", "micronaut-security", "micronaut-jaxrs-server", "micronaut-flyway", "micronaut-jdbc-hikari", "micronaut-jooq"] micronaut-annotation = ["jakarta-inject", "micronaut-inject-java"] micronaut-annotation-processor = ["micronaut-inject-java", "micronaut-management", "micronaut-validation", "micronaut-data-processor", "micronaut-jaxrs-processor"] micronaut-test = ["micronaut-test-core", "micronaut-test-junit5", "h2-database"] micronaut-test-annotation-processor = ["micronaut-inject-java"] +slf4j = ["jul-to-slf4j", "jcl-over-slf4j", "log4j-over-slf4j"] temporal = ["temporal-sdk", "temporal-serviceclient"] From c34fc2b039dc1b1a4d7ab301cc011c02839f059f Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 28 Dec 2022 14:09:16 -0800 Subject: [PATCH 2/5] Upgrade system stubs jupiter. --- airbyte-bootloader/build.gradle | 2 +- airbyte-integrations/connectors/source-jdbc/build.gradle | 2 +- .../connectors/source-mysql-strict-encrypt/build.gradle | 2 +- airbyte-integrations/connectors/source-mysql/build.gradle | 2 +- airbyte-integrations/connectors/source-postgres/build.gradle | 2 +- .../connectors/source-relational-db/build.gradle | 2 +- deps.toml | 1 + 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/airbyte-bootloader/build.gradle b/airbyte-bootloader/build.gradle index f704ec6ccfaf..ac945a727c41 100644 --- a/airbyte-bootloader/build.gradle +++ b/airbyte-bootloader/build.gradle @@ -15,7 +15,7 @@ dependencies { implementation libs.flyway.core testImplementation libs.platform.testcontainers.postgresql - testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.1' + testImplementation libs.junit.jupiter.system.stubs } application { diff --git a/airbyte-integrations/connectors/source-jdbc/build.gradle b/airbyte-integrations/connectors/source-jdbc/build.gradle index 3a54888321bf..54f984906b46 100644 --- a/airbyte-integrations/connectors/source-jdbc/build.gradle +++ b/airbyte-integrations/connectors/source-jdbc/build.gradle @@ -31,7 +31,7 @@ dependencies { testImplementation libs.postgresql testImplementation libs.connectors.testcontainers.postgresql - testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.1' + testImplementation libs.junit.jupiter.system.stubs integrationTestJavaImplementation project(':airbyte-integrations:bases:standard-source-test') integrationTestJavaImplementation libs.connectors.testcontainers.postgresql diff --git a/airbyte-integrations/connectors/source-mysql-strict-encrypt/build.gradle b/airbyte-integrations/connectors/source-mysql-strict-encrypt/build.gradle index 9933f413fd02..99eb1b7378d4 100644 --- a/airbyte-integrations/connectors/source-mysql-strict-encrypt/build.gradle +++ b/airbyte-integrations/connectors/source-mysql-strict-encrypt/build.gradle @@ -20,7 +20,7 @@ dependencies { testImplementation testFixtures(project(':airbyte-integrations:connectors:source-jdbc')) testImplementation project(':airbyte-test-utils') - testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.1' + testImplementation libs.junit.jupiter.system.stubs testImplementation libs.connectors.testcontainers.mysql diff --git a/airbyte-integrations/connectors/source-mysql/build.gradle b/airbyte-integrations/connectors/source-mysql/build.gradle index 961f00b70df2..b82567b64c26 100644 --- a/airbyte-integrations/connectors/source-mysql/build.gradle +++ b/airbyte-integrations/connectors/source-mysql/build.gradle @@ -26,7 +26,7 @@ dependencies { testImplementation testFixtures(project(':airbyte-integrations:connectors:source-jdbc')) testImplementation 'org.apache.commons:commons-lang3:3.11' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.1' + testImplementation libs.junit.jupiter.system.stubs testImplementation libs.connectors.testcontainers.mysql integrationTestJavaImplementation project(':airbyte-integrations:bases:standard-source-test') diff --git a/airbyte-integrations/connectors/source-postgres/build.gradle b/airbyte-integrations/connectors/source-postgres/build.gradle index 53c40333aaee..36e8c8b0b8a4 100644 --- a/airbyte-integrations/connectors/source-postgres/build.gradle +++ b/airbyte-integrations/connectors/source-postgres/build.gradle @@ -30,7 +30,7 @@ dependencies { testImplementation project(':airbyte-test-utils') testImplementation libs.connectors.testcontainers.jdbc testImplementation libs.connectors.testcontainers.postgresql - testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.1' + testImplementation libs.junit.jupiter.system.stubs integrationTestJavaImplementation project(':airbyte-integrations:bases:standard-source-test') performanceTestJavaImplementation project(':airbyte-integrations:bases:standard-source-test') diff --git a/airbyte-integrations/connectors/source-relational-db/build.gradle b/airbyte-integrations/connectors/source-relational-db/build.gradle index f23d855019db..8d9b66c70cad 100644 --- a/airbyte-integrations/connectors/source-relational-db/build.gradle +++ b/airbyte-integrations/connectors/source-relational-db/build.gradle @@ -20,7 +20,7 @@ dependencies { testImplementation libs.postgresql testImplementation libs.connectors.testcontainers.postgresql - testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.1' + testImplementation libs.junit.jupiter.system.stubs implementation files(project(':airbyte-integrations:bases:base-java').airbyteDocker.outputs) } diff --git a/deps.toml b/deps.toml index 9ac2ffc142bf..bf79ca4ffbfb 100644 --- a/deps.toml +++ b/deps.toml @@ -75,6 +75,7 @@ jul-to-slf4j = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" } junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" } junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" } junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter" } +junit-jupiter-system-stubs = { module = "uk.org.webcompere:system-stubs-jupiter", version = "2.0.1" } junit-pioneer = { module = "org.junit-pioneer:junit-pioneer", version = "1.7.1" } log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } From 3e7fd34557bf703f8ea474b10a750427b35aa408 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Wed, 28 Dec 2022 14:18:40 -0800 Subject: [PATCH 3/5] Upgrade all the dependencies in preparation for Java 19 upgrade. --- build.gradle | 8 ++++---- deps.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 5d7c2213598f..e0442234e8c5 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ buildscript { plugins { id 'base' id 'pmd' - id 'com.diffplug.spotless' version '6.7.1' + id 'com.diffplug.spotless' version '6.12.0' id 'com.github.hierynomus.license' version '0.16.1' id 'com.github.spotbugs' version '5.0.13' // The distribution plugin has been added to address the an issue with the copyGeneratedTar @@ -302,11 +302,11 @@ subprojects { subproj -> rulesMinimumPriority = 5 ruleSets = [] ruleSetFiles = files(rootProject.file('tools/gradle/pmd/rules.xml')) - toolVersion = '6.43.0' + toolVersion = '6.51.0' } jacoco { - toolVersion = "0.8.7" + toolVersion = "0.8.8" } jacocoTestReport { @@ -349,7 +349,7 @@ subprojects { subproj -> excludeFilter = rootProject.file('spotbugs-exclude-filter-file.xml') reportLevel = 'high' showProgress = false - toolVersion = '4.6.0' + toolVersion = '4.7.3' } test { diff --git a/deps.toml b/deps.toml index bf79ca4ffbfb..4b256417cfe9 100644 --- a/deps.toml +++ b/deps.toml @@ -84,7 +84,7 @@ log4j-over-slf4j = { module = "org.slf4j:log4j-over-slf4j", version.ref = "slf4j log4j-web = { module = "org.apache.logging.log4j:log4j-web", version.ref = "log4j" } lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" } micrometer-statsd = { module = "io.micrometer:micrometer-registry-statsd", version = "1.9.3" } -mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version = "4.0.0" } +mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version = "4.9.0" } otel-bom = { module = "io.opentelemetry:opentelemetry-bom", version = "1.14.0" } otel-sdk = { module = "io.opentelemetry:opentelemetry-sdk-metrics", version = "1.14.0" } otel-sdk-testing = { module = "io.opentelemetry:opentelemetry-sdk-metrics-testing", version = "1.13.0-alpha" } From d92c5fa00b6e6f6180764d3970456c8caaba1e88 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Thu, 29 Dec 2022 08:46:07 -0800 Subject: [PATCH 4/5] Fix all Spotbugs and PMD warnings. --- .../test/java/io/airbyte/commons/logging/MdcScopeTest.java | 4 ++-- .../config/persistence/split_secrets/SecretsHelpersTest.java | 1 + .../integrations/destination/mysql/MySQLSqlOperations.java | 5 +++++ .../integrations/destination/tidb/TiDBSqlOperations.java | 4 ++++ .../main/java/io/airbyte/server/handlers/AttemptHandler.java | 2 +- .../io/airbyte/test/utils/AirbyteAcceptanceTestHarness.java | 2 +- .../io/airbyte/workers/config/ApplicationBeanFactory.java | 2 +- .../discover/catalog/DiscoverCatalogActivityImpl.java | 2 +- tools/gradle/pmd/rules.xml | 1 + 9 files changed, 17 insertions(+), 6 deletions(-) diff --git a/airbyte-commons/src/test/java/io/airbyte/commons/logging/MdcScopeTest.java b/airbyte-commons/src/test/java/io/airbyte/commons/logging/MdcScopeTest.java index d9a101b8056d..9b347424e893 100644 --- a/airbyte-commons/src/test/java/io/airbyte/commons/logging/MdcScopeTest.java +++ b/airbyte-commons/src/test/java/io/airbyte/commons/logging/MdcScopeTest.java @@ -25,7 +25,7 @@ void init() { @Test @DisplayName("The MDC context is properly overrided") void testMDCModified() { - try (final MdcScope mdcScope = new MdcScope(modificationInMDC)) { + try (final MdcScope ignored = new MdcScope(modificationInMDC)) { final Map mdcState = MDC.getCopyOfContextMap(); Assertions.assertThat(mdcState).containsExactlyInAnyOrderEntriesOf( @@ -36,7 +36,7 @@ void testMDCModified() { @Test @DisplayName("The MDC context is properly restored") void testMDCRestore() { - try (final MdcScope mdcScope = new MdcScope(modificationInMDC)) {} + try (final MdcScope ignored = new MdcScope(modificationInMDC)) {} final Map mdcState = MDC.getCopyOfContextMap(); diff --git a/airbyte-config/config-persistence/src/test/java/io/airbyte/config/persistence/split_secrets/SecretsHelpersTest.java b/airbyte-config/config-persistence/src/test/java/io/airbyte/config/persistence/split_secrets/SecretsHelpersTest.java index ec2784532233..3aa78c93cbd6 100644 --- a/airbyte-config/config-persistence/src/test/java/io/airbyte/config/persistence/split_secrets/SecretsHelpersTest.java +++ b/airbyte-config/config-persistence/src/test/java/io/airbyte/config/persistence/split_secrets/SecretsHelpersTest.java @@ -71,6 +71,7 @@ private static Stream provideTestCases() { @ParameterizedTest @MethodSource(PROVIDE_TEST_CASES) + @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void validateTestCases(final SecretsTestCase testCase) throws JsonValidationException { final var validator = new JsonSchemaValidator(); final var spec = testCase.getSpec().getConnectionSpecification(); diff --git a/airbyte-integrations/connectors/destination-mysql/src/main/java/io/airbyte/integrations/destination/mysql/MySQLSqlOperations.java b/airbyte-integrations/connectors/destination-mysql/src/main/java/io/airbyte/integrations/destination/mysql/MySQLSqlOperations.java index c513c355ff0e..710df1676cc2 100644 --- a/airbyte-integrations/connectors/destination-mysql/src/main/java/io/airbyte/integrations/destination/mysql/MySQLSqlOperations.java +++ b/airbyte-integrations/connectors/destination-mysql/src/main/java/io/airbyte/integrations/destination/mysql/MySQLSqlOperations.java @@ -5,6 +5,7 @@ package io.airbyte.integrations.destination.mysql; import com.fasterxml.jackson.databind.JsonNode; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.airbyte.db.jdbc.JdbcDatabase; import io.airbyte.integrations.base.JavaBaseConstants; import io.airbyte.integrations.destination.StandardNameTransformer; @@ -13,10 +14,14 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; import java.util.List; +@SuppressFBWarnings( + value = {"SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE"}, + justification = "There is little chance of SQL injection. There is also little need for statement reuse. The basic statement is more readable than the prepared statement.") public class MySQLSqlOperations extends JdbcSqlOperations { private boolean isLocalFileEnabled = false; diff --git a/airbyte-integrations/connectors/destination-tidb/src/main/java/io/airbyte/integrations/destination/tidb/TiDBSqlOperations.java b/airbyte-integrations/connectors/destination-tidb/src/main/java/io/airbyte/integrations/destination/tidb/TiDBSqlOperations.java index cdea8abcb01e..9c54dee7e5ce 100644 --- a/airbyte-integrations/connectors/destination-tidb/src/main/java/io/airbyte/integrations/destination/tidb/TiDBSqlOperations.java +++ b/airbyte-integrations/connectors/destination-tidb/src/main/java/io/airbyte/integrations/destination/tidb/TiDBSqlOperations.java @@ -5,6 +5,7 @@ package io.airbyte.integrations.destination.tidb; import com.fasterxml.jackson.databind.JsonNode; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.airbyte.db.jdbc.JdbcDatabase; import io.airbyte.integrations.base.JavaBaseConstants; import io.airbyte.integrations.destination.StandardNameTransformer; @@ -17,6 +18,9 @@ import java.sql.Statement; import java.util.List; +@SuppressFBWarnings( + value = {"SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE"}, + justification = "There is little chance of SQL injection. There is also little need for statement reuse. The basic statement is more readable than the prepared statement.") public class TiDBSqlOperations extends JdbcSqlOperations { @Override diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/AttemptHandler.java b/airbyte-server/src/main/java/io/airbyte/server/handlers/AttemptHandler.java index 95579074ed08..c041e8ed5824 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/AttemptHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/handlers/AttemptHandler.java @@ -28,7 +28,7 @@ public AttemptHandler(JobPersistence jobPersistence) { public InternalOperationResult setWorkflowInAttempt(SetWorkflowInAttemptRequestBody requestBody) { try { jobPersistence.setAttemptTemporalWorkflowInfo(requestBody.getJobId(), - requestBody.getAttemptNumber(), requestBody.getWorkflowId().toString(), requestBody.getProcessingTaskQueue()); + requestBody.getAttemptNumber(), requestBody.getWorkflowId(), requestBody.getProcessingTaskQueue()); } catch (IOException ioe) { LOGGER.error("IOException when setting temporal workflow in attempt;", ioe); return new InternalOperationResult().succeeded(false); diff --git a/airbyte-test-utils/src/main/java/io/airbyte/test/utils/AirbyteAcceptanceTestHarness.java b/airbyte-test-utils/src/main/java/io/airbyte/test/utils/AirbyteAcceptanceTestHarness.java index 0799d44987b9..6fe831dd9183 100644 --- a/airbyte-test-utils/src/main/java/io/airbyte/test/utils/AirbyteAcceptanceTestHarness.java +++ b/airbyte-test-utils/src/main/java/io/airbyte/test/utils/AirbyteAcceptanceTestHarness.java @@ -173,7 +173,7 @@ public class AirbyteAcceptanceTestHarness { private final UUID defaultWorkspaceId; private final String postgresSqlInitFile; - private KubernetesClient kubernetesClient = null; + private KubernetesClient kubernetesClient; private List sourceIds; private List connectionIds; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java index 79efd27cf14e..49edebdf7266 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java @@ -144,7 +144,7 @@ public WorkspaceHelper workspaceHelper( @Singleton public AirbyteConfigValidator airbyteConfigValidator() { return new AirbyteConfigValidator(); - }; + } @Singleton public MetricClient metricClient() { diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java index 5a36c144fc43..fd205a92e987 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java @@ -56,7 +56,7 @@ public class DiscoverCatalogActivityImpl implements DiscoverCatalogActivity { private final Path workspaceRoot; private final WorkerEnvironment workerEnvironment; private final LogConfigs logConfigs; - private final AirbyteApiClient airbyteApiClient;; + private final AirbyteApiClient airbyteApiClient; private final String airbyteVersion; private final ConfigRepository configRepository; diff --git a/tools/gradle/pmd/rules.xml b/tools/gradle/pmd/rules.xml index f6d7e883d19f..f498cdf1cfa8 100644 --- a/tools/gradle/pmd/rules.xml +++ b/tools/gradle/pmd/rules.xml @@ -99,6 +99,7 @@ + From a944a41b17e391b3d8e49252432bdd79ba53e706 Mon Sep 17 00:00:00 2001 From: Davin Chia Date: Thu, 29 Dec 2022 10:52:37 -0800 Subject: [PATCH 5/5] Use 4.6.1 instead as it plays better with connector tests. --- deps.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps.toml b/deps.toml index 4b256417cfe9..7a54da9f967f 100644 --- a/deps.toml +++ b/deps.toml @@ -84,7 +84,7 @@ log4j-over-slf4j = { module = "org.slf4j:log4j-over-slf4j", version.ref = "slf4j log4j-web = { module = "org.apache.logging.log4j:log4j-web", version.ref = "log4j" } lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" } micrometer-statsd = { module = "io.micrometer:micrometer-registry-statsd", version = "1.9.3" } -mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version = "4.9.0" } +mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version = "4.6.1" } otel-bom = { module = "io.opentelemetry:opentelemetry-bom", version = "1.14.0" } otel-sdk = { module = "io.opentelemetry:opentelemetry-sdk-metrics", version = "1.14.0" } otel-sdk-testing = { module = "io.opentelemetry:opentelemetry-sdk-metrics-testing", version = "1.13.0-alpha" }