-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BEAM-10961] Enabled strict dependency on sdks-extensions #13686
Changes from 7 commits
6c9550c
29b2183
57b9451
3a2fa11
d794f6a
b679b53
77fddd3
ac654b3
73dfeae
7ff6f4f
740e349
619d078
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -21,25 +21,33 @@ import groovy.json.JsonOutput | |||
*/ | ||||
|
||||
plugins { id 'org.apache.beam.module' } | ||||
applyJavaNature(automaticModuleName: 'org.apache.beam.sdk.extensions.ml') | ||||
applyJavaNature( | ||||
enableStrictDependencies: true, | ||||
automaticModuleName: 'org.apache.beam.sdk.extensions.ml' | ||||
) | ||||
|
||||
description = 'Apache Beam :: SDKs :: Java :: Extensions :: ML' | ||||
|
||||
dependencies { | ||||
compile project(path: ":sdks:java:core", configuration: "shadow") | ||||
compile project(":sdks:java:expansion-service") | ||||
permitUnusedDeclared project(":sdks:java:expansion-service") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please link the jira in a comment (BEAM-11761) for the |
||||
compile 'com.google.cloud:google-cloud-video-intelligence:1.2.0' | ||||
compile 'com.google.cloud:google-cloud-dlp:1.1.4' | ||||
compile 'com.google.cloud:google-cloud-language:1.99.4' | ||||
compile 'com.google.api.grpc:proto-google-cloud-dlp-v2:1.1.4' | ||||
compile 'com.google.api.grpc:proto-google-cloud-language-v1:1.81.4' | ||||
compile 'com.google.api.grpc:proto-google-cloud-video-intelligence-v1:1.2.0' | ||||
compile 'com.google.api.grpc:proto-google-cloud-vision-v1:1.81.3' | ||||
compile library.java.gax | ||||
compile library.java.protobuf_java | ||||
compile library.java.slf4j_api | ||||
provided library.java.junit | ||||
testCompile project(path: ':sdks:java:core', configuration: 'shadowTest') | ||||
compile 'com.google.cloud:google-cloud-vision:1.99.3' | ||||
permitUsedUndeclared "com.google.auto.value:auto-value-annotations:1.7" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this need to be permitUsedUndeclared? Don't we already declare it in BeamModulePlugin?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ibzib When i remove this line, i get the error:
To dig into this further, I ran ../../../../gradlew -q dependencies in sdks/java/extensions/ml and captured the output here: It seems that via com.google.cloud:google-cloud-video-intelligence:1.2.0, we are getting runtimeClasspath dependencies to com.google.auto.value:auto-value-annotations:1.7 - which is not being resolved to 1.7.2, the version declared in BeamModulePlugin.groovy as a compileOnly dependency. See the highlighted lines in the doc I linked to above. Maybe this is because BeamModulePlugin.groovy declares auto-value-annotations as compileOnly whereas it is actually needed at runtime. Not sure if this could point to the the cause or it's just a red herring...? |
||||
testCompile library.java.mockito_core | ||||
testCompile 'com.google.cloud:google-cloud-video-intelligence:1.2.0' | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing these testCompile lines since the same dependencies already have compile lines. |
||||
testCompile 'com.google.cloud:google-cloud-dlp:1.1.4' | ||||
testCompile project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "testRuntime") | ||||
testCompile 'com.google.cloud:google-cloud-language:1.99.4' | ||||
testCompile 'com.google.cloud:google-cloud-vision:1.99.3' | ||||
testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") | ||||
testRuntimeOnly project(":runners:google-cloud-dataflow-java") | ||||
} | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,15 @@ applyJavaNature( | |
|
||
dependencies { | ||
compile project(path: ":sdks:java:expansion-service") | ||
permitUnusedDeclared project(path: ":sdks:java:expansion-service") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are likely candidates for removal. We may even want to make a JIRA specifically for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ibzib By *-expansion-service, did you mean all these ./sdks/java/io/kinesis/expansion-service I can file the JIRA as a sub-task of BEAM-11761. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we already merged some of these without a new JIRA. I don't think a new JIRA is strictly necessary - it's easy enough to find these instances if you're looking for them. So let's just use BEAM-11761. |
||
compile project(":sdks:java:io:jdbc") | ||
permitUnusedDeclared project(":sdks:java:io:jdbc") | ||
compile library.java.postgres | ||
permitUnusedDeclared library.java.postgres | ||
compile project(path: ":model:pipeline", configuration: "shadow") | ||
compile project(path: ":sdks:java:core", configuration: "shadow") | ||
compile library.java.vendored_grpc_1_26_0 | ||
compile library.java.vendored_guava_26_0_jre | ||
testCompile library.java.junit | ||
testCompile library.java.powermock_mockito | ||
testCompile library.java.mockito_core | ||
// TODO(BEAM-10632): remove this dependency | ||
testCompile "org.checkerframework:checker-qual:3.5.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
|
||
plugins { id 'org.apache.beam.module' } | ||
applyJavaNature( | ||
enableStrictDependencies: true, | ||
automaticModuleName: 'org.apache.beam.sdk.extensions.sketching') | ||
|
||
description = "Apache Beam :: SDKs :: Java :: Extensions :: Sketching" | ||
|
@@ -26,15 +27,14 @@ def streamlib_version = "2.9.5" | |
def tdigest_version = "3.2" | ||
|
||
dependencies { | ||
compile library.java.slf4j_api | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure this one is actually safe to remove. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ibzib I'm curious how to determine whether this project contains loggers, and why removing this particular dependency entirely seems safer than removing others (where we are adding permitUnusedDeclared). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed. |
||
permitUnusedDeclared library.java.slf4j_api | ||
compile library.java.vendored_guava_26_0_jre | ||
compile project(path: ":sdks:java:core", configuration: "shadow") | ||
compile "com.clearspring.analytics:stream:$streamlib_version" | ||
compile "com.tdunning:t-digest:$tdigest_version" | ||
compile library.java.slf4j_api | ||
testCompile library.java.avro | ||
testCompile project(path: ":sdks:java:core", configuration: "shadowTest") | ||
testCompile library.java.hamcrest_core | ||
testCompile library.java.hamcrest_library | ||
testCompile library.java.junit | ||
testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") | ||
} |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -20,6 +20,7 @@ import groovy.json.JsonOutput | |||
|
||||
plugins { id 'org.apache.beam.module' } | ||||
applyJavaNature( | ||||
enableStrictDependencies: true, | ||||
automaticModuleName: 'org.apache.beam.sdk.extensions.zetasketch') | ||||
|
||||
description = "Apache Beam :: SDKs :: Java :: Extensions :: ZetaSketch" | ||||
|
@@ -32,6 +33,7 @@ dependencies { | |||
compile library.java.slf4j_api | ||||
compile library.java.vendored_guava_26_0_jre | ||||
compile project(path: ":sdks:java:core", configuration: "shadow") | ||||
compile "com.google.auto.value:auto-value-annotations:1.6.3" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? Aren't we already importing autovalue in BeamModulePlugin?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same kind of thing as the comment i added for sdks/java/extensions/ml/build.gradle. Here there is a runtime dependency on "com.google.auto.value:auto-value-annotations:1.6.3" via "com.google.zetasketch:zetasketch:0.1.0"
|
||||
compile "com.google.zetasketch:zetasketch:$zetasketch_version" | ||||
testCompile library.java.junit | ||||
testCompile project(":sdks:java:io:google-cloud-platform") | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting that these dependencies are also included in the Java nature configuratioin's
shadowClosure.dependencies
. I'm don't think it's a problem, but I'm curious what is the difference between specifying dependencies inshadowClosure
vs the regular dependencies block.