Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating runtime dependencies for conflicts #518

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ build/distributions/tiered-storage-for-apache-kafka-$(VERSION).tgz:
./gradlew build distTar -x test -x integrationTest -x e2e:test

storage/s3/build/distributions/s3-$(VERSION).tgz:
./gradlew build :storage:s3:distTar -x test -x integrationTest -x e2e:test
./gradlew build :storage:plugins:s3:distTar -x test -x integrationTest -x e2e:test

storage/gcs/build/distributions/gcs-$(VERSION).tgz:
./gradlew build :storage:gcs:distTar -x test -x integrationTest -x e2e:test
./gradlew build :storage:plugins:gcs:distTar -x test -x integrationTest -x e2e:test

storage/gcs/build/distributions/azure-$(VERSION).tgz:
./gradlew build :storage:azure:distTar -x test -x integrationTest -x e2e:test
./gradlew build :storage:plugins:azure:distTar -x test -x integrationTest -x e2e:test

test: build
./gradlew test -x e2e:test
Expand Down
30 changes: 19 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ subprojects {
withJavadocJar()
withSourcesJar()
}
configurations.runtimeClasspath {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add some comments here to clarify how is affecting the deps validation? e.g. usage of platform feature, etc.

resolutionStrategy {
failOnVersionConflict()
}
}

checkstyle {
toolVersion = "10.12.0"
Expand Down Expand Up @@ -123,29 +128,32 @@ subprojects {

azureSdkVersion = "1.2.21"

testcontainersVersion = "1.19.4"
testcontainersVersion = "1.19.7"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this needed as part of this PR? if it's maybe a separate commit will help.


testcontainersFakeGcsServerVersion = "0.2.0"
}

dependencies {
compileOnly "org.apache.kafka:kafka-clients:$kafkaVersion"
compileOnly "org.apache.kafka:kafka-storage-api:$kafkaVersion"
compileOnly("org.apache.kafka:kafka-storage-api:$kafkaVersion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if this is a style change only or it has some implications in the context of this PR?


implementation enforcedPlatform("com.fasterxml.jackson:jackson-bom:$jacksonVersion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add some comments on what this "enforcePlatform" does and why we needed it here?

e.g. as it's only added for jacksone, does it mean that we would need to know in advance which dependencies may conflict, so we can flag it as we are doing here?

compileOnly "org.slf4j:slf4j-api:$slf4jVersion"

testImplementation "org.apache.kafka:kafka-clients:$kafkaVersion"
testImplementation "org.apache.kafka:kafka-storage-api:$kafkaVersion"
testImplementation("org.apache.kafka:kafka-storage-api:$kafkaVersion")

testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testImplementation 'org.junit.platform:junit-platform-launcher:$junitPlatformVersion'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-params"
testImplementation "org.junit.platform:junit-platform-launcher"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"

testImplementation "org.assertj:assertj-core:$assertJVersion"

testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
testImplementation(platform("org.mockito:mockito-bom:$mockitoVersion"))
testImplementation "org.mockito:mockito-core"
testImplementation "org.mockito:mockito-junit-jupiter"

testImplementation "org.awaitility:awaitility:$awaitilityVersion"

Expand Down Expand Up @@ -241,8 +249,8 @@ distributions {
from(project(":core").configurations.runtimeClasspath)
from(project(":storage:core").jar)
from(project(":storage:core").configurations.runtimeClasspath)
from(project(":storage:filesystem").jar)
from(project(":storage:filesystem").configurations.runtimeClasspath)
from(project(":storage:plugins:filesystem").jar)
from(project(":storage:plugins:filesystem").configurations.runtimeClasspath)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ dependencies {

implementation "org.bouncycastle:bcprov-jdk18on:$bouncyCastleVersion"

implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8"

implementation "com.github.luben:zstd-jni:$zstdVersion"

Expand All @@ -47,7 +47,7 @@ dependencies {
implementation project(':commons')

testImplementation(testFixtures(project(":storage:core")))
testImplementation(project(":storage:filesystem"))
testImplementation(project(":storage:plugins:filesystem"))

testImplementation "com.github.luben:zstd-jni:$zstdVersion"
integrationTestImplementation sourceSets.test.output
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ RUN cd /tiered-storage-for-apache-kafka/core \
&& tar -xf tiered-storage-for-apache-kafka-${_VERSION}.tgz --strip-components=1 \
&& rm tiered-storage-for-apache-kafka-${_VERSION}.tgz

COPY storage/s3/build/distributions/s3-${_VERSION}.tgz /tiered-storage-for-apache-kafka/s3
COPY storage/plugins/s3/build/distributions/s3-${_VERSION}.tgz /tiered-storage-for-apache-kafka/s3
RUN cd /tiered-storage-for-apache-kafka/s3 \
&& tar -xf s3-${_VERSION}.tgz --strip-components=1 \
&& rm s3-${_VERSION}.tgz

COPY storage/gcs/build/distributions/gcs-${_VERSION}.tgz /tiered-storage-for-apache-kafka/gcs
COPY storage/plugins/gcs/build/distributions/gcs-${_VERSION}.tgz /tiered-storage-for-apache-kafka/gcs
RUN cd /tiered-storage-for-apache-kafka/gcs \
&& tar -xf gcs-${_VERSION}.tgz --strip-components=1 \
&& rm gcs-${_VERSION}.tgz

COPY storage/azure/build/distributions/azure-${_VERSION}.tgz /tiered-storage-for-apache-kafka/azure
COPY storage/plugins/azure/build/distributions/azure-${_VERSION}.tgz /tiered-storage-for-apache-kafka/azure
RUN cd /tiered-storage-for-apache-kafka/azure \
&& tar -xf azure-${_VERSION}.tgz --strip-components=1 \
&& rm azure-${_VERSION}.tgz
Expand Down
9 changes: 5 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ rootProject.name = 'tiered-storage-for-apache-kafka'
include 'core'
include 'storage'
include 'storage:core'
include 'storage:filesystem'
include 'storage:azure'
include 'storage:gcs'
include 'storage:s3'
include 'storage:plugins'
include 'storage:plugins:filesystem'
include 'storage:plugins:azure'
include 'storage:plugins:gcs'
include 'storage:plugins:s3'
include 'e2e'
include 'commons'
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@
archivesBaseName = "storage-azure"

dependencies {
implementation project(":storage:core")

implementation platform("com.azure:azure-sdk-bom:$azureSdkVersion")
implementation ("com.azure:azure-identity") {
implementation("com.azure:azure-identity") {
exclude group: "org.slf4j"
exclude group: "net.java.dev.jna"
exclude group: "com.microsoft.azure", module: "msal4j"
}
implementation ("com.azure:azure-storage-blob") {
implementation("com.azure:azure-storage-blob") {
exclude group: "org.slf4j"
}

implementation project(":commons")

testImplementation(testFixtures(project(":storage:core")))

testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion"
testImplementation("org.testcontainers:junit-jupiter:$testcontainersVersion")
}
31 changes: 31 additions & 0 deletions storage/plugins/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2024 Aiven Oy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

subprojects {
configurations {
providedRuntime
implementation.extendsFrom(providedRuntime)
}
Comment on lines +18 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe some comments here as well


dependencies {
implementation project(":storage:core")

providedRuntime project(":core")

testImplementation(testFixtures(project(":storage:core")))
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
archivesBaseName = "storage-filesystem"

dependencies {
implementation project(":storage:core")

implementation "commons-io:commons-io:$apacheCommonsIOVersion"

testImplementation(testFixtures(project(":storage:core")))
}
12 changes: 6 additions & 6 deletions storage/gcs/build.gradle → storage/plugins/gcs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
archivesBaseName = "storage-gcs"

dependencies {
implementation project(":storage:core")
implementation("com.google.cloud:google-cloud-storage:$gcpSdkVersion") {
exclude group: "com.google.errorprone"
exclude group: "org.checkerframework"
}

implementation "com.google.cloud:google-cloud-storage:$gcpSdkVersion"
implementation project(":commons")

testImplementation(testFixtures(project(":storage:core")))
testImplementation("org.testcontainers:junit-jupiter:$testcontainersVersion")

testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion"

testImplementation "io.aiven:testcontainers-fake-gcs-server:$testcontainersFakeGcsServerVersion"
testImplementation("io.aiven:testcontainers-fake-gcs-server:$testcontainersFakeGcsServerVersion")
}
14 changes: 3 additions & 11 deletions storage/s3/build.gradle → storage/plugins/s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,12 @@ ext {
}

dependencies {
implementation project(":storage:core")

// Take out jackson libraries out to avoid collision with core jackson dependencies
implementation ("software.amazon.awssdk:s3:$awsSdkVersion") {
exclude group: "com.fasterxml.jackson.core"
exclude group: "com.fasterxml.jackson.dataformat"
implementation("software.amazon.awssdk:s3:$awsSdkVersion") {
exclude group: "org.slf4j"
exclude group: "commons-codec"
}
// replacing with version used by core
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:$jacksonVersion"
implementation project(':commons')

testImplementation(testFixtures(project(":storage:core")))
implementation project(":commons")

testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion"
testImplementation "org.testcontainers:localstack:$testcontainersVersion"
Expand Down