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
Conversation
Run Java PreCommit |
255ff5b
to
0ef8888
Compare
Run Java PreCommit |
R: @ibzib Requesting your attention on this PR too. |
Similar to |
7352ed1
to
6c9550c
Compare
Run Java PreCommit |
@ibzib I don't seem to have the access/capability to re-run the failing "Java Tests / Java Unit Tests (macos-latest) (pull_request) " test above (per your tips in another PR). Could you please re-run it for me? Thanks in advance. |
…with permitUnusedDeclared (2) alphabeticize some lines
@ibzib please see if with the latest changes this is good to go. thanks. |
R: @ibzib |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Removing these testCompile lines since the same dependencies already have compile lines.
compile "com.esotericsoftware:kryo:${kryoVersion}" | ||
compile "org.objenesis:objenesis:2.5.1" |
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 in shadowClosure
vs the regular dependencies block.
sdks/java/extensions/ml/build.gradle
Outdated
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Please link the jira in a comment (BEAM-11761) for the permitUnusedDeclared
instances we're not sure if we can remove.
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 comment
The 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?
"com.google.auto.value:auto-value-annotations:$autovalue_version", |
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.
@ibzib When i remove this line, i get the error:
Execution failed for task ':sdks:java:extensions:ml:analyzeClassesDependencies'.
> Dependency analysis found issues.
usedUndeclaredArtifacts:
- com.google.auto.value:auto-value-annotations:1.7@jar
To dig into this further, I ran ../../../../gradlew -q dependencies in sdks/java/extensions/ml and captured the output here:
https://docs.google.com/document/d/1FNxea7Qbn8ckrphV25U7qh75a6z-PEl3iKgdJJwld5E/edit
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...?
@@ -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 comment
The 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 permitUnusedDeclared
instances in *-expansion-service
, because the solution for all these expansion services will be the same.
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.
@ibzib By *-expansion-service, did you mean all these
./sdks/java/io/kinesis/expansion-service
./sdks/java/io/expansion-service
./sdks/java/io/snowflake/expansion-service
./sdks/java/io/google-cloud-platform/expansion-service
./sdks/java/expansion-service
./sdks/java/extensions/schemaio-expansion-service
./sdks/java/extensions/sql/expansion-service
./sdks/java/testing/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 comment
The 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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? Aren't we already importing autovalue in BeamModulePlugin?
"com.google.auto.value:auto-value-annotations:$autovalue_version", |
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.
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"
\--- com.google.zetasketch:zetasketch:0.1.0
+--- com.google.auto.value:auto-value-annotations:1.6.3
+--- com.google.code.findbugs:jsr305:3.0.2
+--- com.google.errorprone:error_prone_annotations:2.3.2 -> 2.3.1
+--- it.unimi.dsi:fastutil:8.2.2
\--- org.checkerframework:checker-qual:2.8.1 -> 3.7.0
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this one is actually safe to remove. slf4j
is used for logging, and this project doesn't contain any loggers. If anyone wants to add logging to this project, it's easy to add this dependency back in.
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.
@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 comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
…sketching/build.gradle
testCompile library.java.mockito_core | ||
// TODO(BEAM-10632): remove this dependency | ||
testCompile "org.checkerframework:checker-qual:3.10.0" |
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.
This was introduced by @kennknowles back in Oct. Since then we've moved the checker-qual dependency into BeamModulePlugin. Checking if it's ok to remove it from here.
@ibzib Sorry - I had overlooked this comment earlier. Since then the review has made forward progress. Would you still like this PR split into individual files? |
Can we close this PR? It looks like it was split into smaller ones and merged. |
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.