GoogleCloudPlatform / cloud-opensource-java

Tools for detecting and avoiding linkage errors in GCP open source projects
Apache License 2.0
155 stars 73 forks source link

grpc-benchmarks and grpc-interop-testing in google-cloud-bom #1004

Closed suztomo closed 4 years ago

suztomo commented 4 years ago

Jeff's import_boms branch is trying to add all gRPC artifacts into google-cloud-bom.

Among these gRPC artifacts, grpc-benchmarks and grpc-interop-testing have linkage errors in their transitive dependencies. They appear as new linkage error when Linkage Monitor runs.

mockito-core-2.25.1.jar is at:
  io.grpc:grpc-benchmarks:1.24.1 (compile) / org.mockito:mockito-core:2.25.1 (compile)
byte-buddy-1.9.7.jar is at:
  io.grpc:grpc-benchmarks:1.24.1 (compile) / org.mockito:mockito-core:2.25.1 (compile) / net.bytebuddy:byte-buddy:1.9.7 (compile)
gwt-user-2.8.2.jar is at:
  io.grpc:grpc-interop-testing:1.24.1 (compile) / com.google.truth:truth:0.45 (compile) / com.google.gwt:gwt-user:2.8.2 (provided)

https://fusion.corp.google.com/runanalysis/buildlogs/prod%3Acloud-devrel%2Fclient-libraries%2Fjava%2Fgoogle-cloud-java%2Fpresubmit%2Flinkage-monitor/prod%3Acloud-devrel%2Fclient-libraries%2Fjava%2Fgoogle-cloud-java%2Fpresubmit%2Flinkage-monitor/KOKORO/b80fa904-056f-409c-99fe-c01a3e3f2776/0/prod%3Acloud-devrel%2Fclient-libraries%2Fjava%2Fgoogle-cloud-java%2Fpresubmit%2Flinkage-monitor/Targets

What can we do?

Linkage Monitor to ignore io.grpc:grpc-benchmarks and io.grpc:grpc-interop-testing

If they're not supposed to be used by users, it makes sense to skip the two artifacts.

suztomo commented 4 years ago

@chingor13 Do you see the following statement correct (or not)?

The import_boms branch is trying to add all gRPC artifacts (via grpc-bom) into google-cloud-bom's dependencyManagement section.

elharo commented 4 years ago

I disagree that it makes sense to skip these two artifacts. If they're not supposed to be used by users, google-cloud-java shouldn't import them and grpc-bom shouldn't publish them.

elharo commented 4 years ago

I don't immediately see where that branch is pulling in grpc-bom. Can you give me a line number?

suztomo commented 4 years ago

I need to dig the pom parent/import hierarchy but here is the effective pom containing grpc-benchmark and grpc-interop-testing. https://paste.googleplex.com/4906849163804672

suztomo commented 4 years ago

It turned out that it was unexpected import of grpc-bom.

elharo commented 4 years ago

More specifically, this was a true positive. The branch was importing the wrong artifact, google-cloud-automl instead of google-cloud-automl-bom. The linkage monitor did exactly what it was supposed to do here.