Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Conversation

@suztomo
Copy link
Member

@suztomo suztomo commented Feb 1, 2022

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.

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

There are io.grpc:grpc-netty-shaded:1.27.2, io.grpc:grpc-netty-shaded:1.36.0 and io.grpc:grpc-netty-shaded:1.44.0 in the dependency graph... In order to pass this test, we need to upgrade io.opencensus:opencensus-exporter-trace-stackdriver and com.google.cloud:grpc-gcp:jar to use the latest gRPC version.

Fixes #532 ☕️

@suztomo suztomo added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Feb 1, 2022
@suztomo suztomo force-pushed the grpc_version_check branch from e42474e to eff6258 Compare February 2, 2022 16:40
pull_request:
name: version-check
jobs:
upper-bound-check:
Copy link
Member Author

@suztomo suztomo Feb 2, 2022

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

Comment on lines +102 to +109
assertTrue(
"The version for "
+ groupId
+ ":"
+ artifactId
+ " should be one but there are multiple of them: "
+ Joiner.on(", ").join(foundPaths),
foundVersions.size() <= 1);
Copy link
Member Author

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 {
Copy link
Member Author

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.

- 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:
Copy link
Member Author

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.

@suztomo suztomo added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 2, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 2, 2022
@suztomo suztomo marked this pull request as ready for review February 2, 2022 17:45
@suztomo suztomo requested a review from a team as a code owner February 2, 2022 17:45
@suztomo suztomo requested a review from Neenu1995 February 2, 2022 17:47
@suztomo
Copy link
Member Author

suztomo commented Feb 3, 2022

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)

@suztomo suztomo added kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Feb 3, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 3, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Feb 3, 2022
@suztomo suztomo requested review from mpeddada1 and removed request for mpeddada1 February 8, 2022 15:52
@Neenu1995 Neenu1995 added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 8, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 8, 2022
@suztomo suztomo merged commit 60df3db into googleapis:main Feb 8, 2022
@suztomo suztomo deleted the grpc_version_check branch February 8, 2022 21:11
suztomo added a commit to suztomo/java-shared-dependencies that referenced this pull request Mar 17, 2022
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A test case for grpc-netty-shaded version agreement

3 participants