-
Notifications
You must be signed in to change notification settings - Fork 17
test: dependency convergence check on gRPC and GAX #595
Conversation
e42474e to
eff6258
Compare
| pull_request: | ||
| name: version-check | ||
| jobs: | ||
| upper-bound-check: |
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 upper-bound-check section is a copy from .github/workflows/upper-bound-check.yaml
| assertTrue( | ||
| "The version for " | ||
| + groupId | ||
| + ":" | ||
| + artifactId | ||
| + " should be one but there are multiple of them: " | ||
| + Joiner.on(", ").join(foundPaths), | ||
| foundVersions.size() <= 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.
When this assertion fails, it prints the following error:
java.lang.AssertionError: The version for io.grpc:grpc-netty-shaded should be one but there are multiple of them:
com.google.cloud:grpc-gcp:jar:1.1.0 / io.grpc:grpc-netty-shaded:1.36.0 (runtime),
io.opencensus:opencensus-exporter-trace-stackdriver:jar:0.31.0 / io.grpc:grpc-netty-shaded:1.27.2 (compile),
com.google.api:gax-grpc:jar:2.11.0 / io.grpc:grpc-netty-shaded:1.44.0 (runtime),
io.opencensus:opencensus-exporter-stats-stackdriver:jar:0.31.0 / io.grpc:grpc-netty-shaded:1.27.2 (compile),
io.grpc:grpc-interop-testing:jar:1.44.0 / io.grpc:grpc-alts:1.44.0 (runtime) / io.grpc:grpc-netty-shaded:1.44.0 (compile),
io.grpc:grpc-xds:jar:1.44.0 / io.grpc:grpc-netty-shaded:1.44.0 (compile),
io.grpc:grpc-alts:jar:1.44.0 / io.grpc:grpc-netty-shaded:1.44.0 (compile),
com.google.cloud:native-image-support:jar:0.11.0 / io.grpc:grpc-netty-shaded:1.44.0 (provided),
io.grpc:grpc-all:jar:1.44.0 / io.grpc:grpc-xds:1.44.0 (compile) / io.grpc:grpc-netty-shaded:1.44.0 (compile),
com.google.cloud:google-cloud-core-grpc:jar:2.4.0 / com.google.api:gax-grpc:2.11.0 (compile) / io.grpc:grpc-netty-shaded:1.44.0 (runtime),
io.grpc:grpc-netty-shaded:jar:1.44.0
| public class DependencyConvergenceTest { | ||
|
|
||
| @Test | ||
| public void testGrpcConvergence() throws Exception { |
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.
For now, it only checks gRPC used by GAX.
.github/workflows/version-check.yaml
Outdated
| - name: Check the BOM content satisfies the upper-bound-check test case | ||
| run: mvn -B -V -ntp verify -Dcheckstyle.skip | ||
| working-directory: upper-bound-check | ||
| dependency-convergence-check: |
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.
dependency-convergence-check is a new check.
|
36b9816 gives an example failure: |
* ci: adding dependency convergence check * test: try bad gRPC version * ci: fixed description of the check * test: reverted gRPC version * renaming to gRPC convergence test
This PR adds a check to confirm gRPC version in the BOM and GAX's gRPC version converge.
Example failure
36b9816 gives an example failure:
Failed tests: testGrpcConvergence(com.google.cloud.DependencyConvergenceTest): The version for io.grpc:grpc-netty-shaded should be one but there are multiple of them: com.google.api:gax-grpc:jar:2.11.0 / io.grpc:grpc-netty-shaded:1.44.0 (runtime), io.grpc:grpc-xds:jar:1.43.2 / io.grpc:grpc-netty-shaded:1.43.2 (compile), io.grpc:grpc-all:jar:1.43.2 / io.grpc:grpc-xds:1.43.2 (compile) / io.grpc:grpc-netty-shaded:1.43.2 (compile), com.google.cloud:google-cloud-core-grpc:jar:2.4.0 / com.google.api:gax-grpc:2.11.0 (compile) / io.grpc:grpc-netty-shaded:1.44.0 (runtime), io.grpc:grpc-alts:jar:1.43.2 / io.grpc:grpc-netty-shaded:1.43.2 (compile), io.grpc:grpc-interop-testing:jar:1.43.2 / io.grpc:grpc-alts:1.43.2 (runtime) / io.grpc:grpc-netty-shaded:1.43.2 (compile), io.grpc:grpc-netty-shaded:jar:1.43.2, com.google.cloud:native-image-support:jar:0.11.0 / io.grpc:grpc-netty-shaded:1.44.0 (provided)Excluding the opencensus artifact and grpc-grp
This is a compromise to implement the check without waiting for perfect convergence.
The test case ignores opencensus and grpc-grp artifacts because they depend on old gRPC version.
There are
io.grpc:grpc-netty-shaded:1.27.2,io.grpc:grpc-netty-shaded:1.36.0andio.grpc:grpc-netty-shaded:1.44.0in the dependency graph... In order to pass this test, we need to upgradeio.opencensus:opencensus-exporter-trace-stackdriverandcom.google.cloud:grpc-gcp:jarto use the latest gRPC version.Fixes #532 ☕️