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

[BEAM-10961] Enabled strict dependency on sdks-extensions #13686

Closed
wants to merge 12 commits into from

Conversation

sonam-vend
Copy link
Contributor

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:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Dataflow Flink Samza Spark Twister2
Go Build Status --- Build Status --- Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status --- --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@sonam-vend
Copy link
Contributor Author

Run Java PreCommit

@sonam-vend
Copy link
Contributor Author

Run Java PreCommit

@shehzaadn-vd
Copy link
Contributor

R: @ibzib Requesting your attention on this PR too.

@ibzib
Copy link
Contributor

ibzib commented Jan 27, 2021

Similar to sdks/java/io, extensions is a large folder that contains many different projects. It'd be better to break this one up too, by going one directory deeper (so sdks/java/extensions/sql can be in one largeish PR and everything else is by itself).

@codecov
Copy link

codecov bot commented Jan 28, 2021

Codecov Report

Merging #13686 (7352ed1) into master (2946e4b) will decrease coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13686      +/-   ##
==========================================
- Coverage   82.99%   82.83%   -0.17%     
==========================================
  Files         469      466       -3     
  Lines       58330    57596     -734     
==========================================
- Hits        48412    47710     -702     
+ Misses       9918     9886      -32     
Impacted Files Coverage Δ
...n/apache_beam/runners/direct/evaluation_context.py
...rcs/sdks/python/apache_beam/typehints/typehints.py
...hon/apache_beam/examples/wordcount_with_metrics.py
...srcs/sdks/python/apache_beam/io/gcp/dicomclient.py
...beam/testing/benchmarks/nexmark/queries/query11.py
.../snippets/transforms/elementwise/withtimestamps.py
...am/examples/complete/juliaset/juliaset/__init__.py
...srcs/sdks/python/apache_beam/transforms/display.py
.../examples/snippets/transforms/aggregation/count.py
...ache_beam/examples/cookbook/datastore_wordcount.py
... and 925 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 643ad9e...619d078. Read the comment docs.

@shehzaadn-vd
Copy link
Contributor

Run Java PreCommit

@shehzaadn-vd
Copy link
Contributor

shehzaadn-vd commented Feb 1, 2021

@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.

@shehzaadn-vd
Copy link
Contributor

@ibzib please see if with the latest changes this is good to go. thanks.

@shehzaadn-vd
Copy link
Contributor

R: @ibzib

testCompile library.java.mockito_core
testCompile 'com.google.cloud:google-cloud-video-intelligence:1.2.0'
Copy link
Contributor

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"
Copy link
Contributor

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.


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")
Copy link
Contributor

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"
Copy link
Contributor

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",

Copy link
Contributor

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")
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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"
Copy link
Contributor

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",

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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).

Copy link
Contributor

Choose a reason for hiding this comment

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

Removed.

@ibzib ibzib changed the title Enabled strict dependency on sdks-extensions [BEAM-10961] Enabled strict dependency on sdks-extensions Feb 11, 2021
testCompile library.java.mockito_core
// TODO(BEAM-10632): remove this dependency
testCompile "org.checkerframework:checker-qual:3.10.0"
Copy link
Contributor

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.

@shehzaadn-vd
Copy link
Contributor

shehzaadn-vd commented Feb 25, 2021

Similar to sdks/java/io, extensions is a large folder that contains many different projects. It'd be better to break this one up too, by going one directory deeper (so sdks/java/extensions/sql can be in one largeish PR and everything else is by itself).

@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?

@aaltay
Copy link
Member

aaltay commented Mar 11, 2021

Can we close this PR? It looks like it was split into smaller ones and merged.

@ibzib ibzib closed this Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants