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

build(deps): bump guava to 32.0.1-jre, google-http-client to 1.43.3. #1791

Merged
merged 8 commits into from
Jun 21, 2023

Conversation

zhumin8
Copy link
Contributor

@zhumin8 zhumin8 commented Jun 21, 2023

Discrepancy in guava version causing shared dependencies check failures.
https://github.com/googleapis/sdk-platform-java/actions/runs/5335175946/jobs/9668027541
manual version bump to be consistent with #1774, #1775. #1776

This guava version is not picked up by bot.
And future discrepancy should be eliminated once #1777 merges in

Also upgrades checker-qual:3.33.0 to resolve this error.

Error:  Rule 2: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for org.checkerframework:checker-qual:3.32.0 paths to dependency are:
+-com.google.cloud:google-cloud-core:2.19.1-SNAPSHOT
  +-com.google.guava:guava:32.0.0-jre
    +-org.checkerframework:checker-qual:3.32.0 (managed) <-- org.checkerframework:checker-qual:3.33.0
]

Summary of changes in PR:

  • upgrade guava to 32.0.1-jre
  • upgrade google-http-client to 1.43.3 (with j2objc-annotation:2.8)
  • [temp solution] exclude j2objc-annotations from protobuf-java-util dependencies
  • upgrades checker-qual to 3.33.0, j2objc-annotations to 2.8 to be consistent
  • add comment to remove temp solution on next protobuf upgrade

…r-java-pom-parent

manual version bump to be consistent with #1774, #1775. #1776
@zhumin8 zhumin8 requested a review from a team as a code owner June 21, 2023 14:37
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jun 21, 2023
@zhumin8
Copy link
Contributor Author

zhumin8 commented Jun 21, 2023

Now the dependency check is failing on:

Error:  Rule 2: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
2205Failed while enforcing RequireUpperBoundDeps. The error(s) are [
2206Require upper bound dependencies error for com.google.j2objc:j2objc-annotations:1.3 paths to dependency are:
2207+-com.google.cloud:google-cloud-core-http:2.19.1-SNAPSHOT
2208  +-com.google.http-client:google-http-client:1.43.1
2209    +-com.google.j2objc:j2objc-annotations:1.3
2210and
2211+-com.google.cloud:google-cloud-core-http:2.19.1-SNAPSHOT
2212  +-com.google.guava:guava:32.0.0-jre
2213    +-com.google.j2objc:j2objc-annotations:2.8
2214and
2215+-com.google.cloud:google-cloud-core-http:2.19.1-SNAPSHOT
2216  +-com.google.cloud:google-cloud-core:2.19.1-SNAPSHOT
2217    +-com.google.protobuf:protobuf-java-util:3.23.2 (managed) <-- com.google.protobuf:protobuf-java-util:3.23.2
2218      +-com.google.j2objc:j2objc-annotations:1.3
2219]

Related change in guava:
v31.1 defines j2objc-annotations:1.3 in https://github.com/google/guava/blob/v31.1/pom.xml#L281
v32.0.0 defines j2objc-annotations:2.8 https://github.com/google/guava/blob/v32.0.0/pom.xml#L299

j2objc-annotation versions in
protobuf-java-util:3.23.2 (current for us) is 1.3 https://github.com/protocolbuffers/protobuf/blob/v23.2/java/util/pom.xml#L33
protobuf-java-util:3.23.3 is 2.8 https://github.com/protocolbuffers/protobuf/blob/v23.3/java/util/pom.xml#LL33

google-http-client:1.43.1 (current for us) is 1.3 https://github.com/googleapis/google-http-java-client/blob/v1.43.1/pom.xml#LL230C1-L234C20
google-http-client:1.43.2 is also 1.3 https://github.com/googleapis/google-http-java-client/blob/v1.43.2/pom.xml#L233

@suztomo
Copy link
Member

suztomo commented Jun 21, 2023

Can you upgrade to 32.0.1-jre? https://guava.dev/ has the version.

@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Jun 21, 2023
@zhumin8 zhumin8 changed the title build(deps): bump guava from 31.1-jre to 32.0.0-jre in gapic-generator-java-pom-parent build(deps): bump guava to 32.0.1-jre Jun 21, 2023
@@ -25,7 +25,7 @@ version.gax_httpjson=2.29.1-SNAPSHOT
# with the sources.
# The protobuf version is only used for generating gradle files for showcase module,
# not for self-service clients (from googleapis project).
version.com_google_protobuf=3.23.2
version.com_google_protobuf=3.23.3
Copy link
Member

Choose a reason for hiding this comment

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

Guava and j2objc-annotation dependency versions also need to be updated in this file, below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, thanks pointing them out.

@zhumin8 zhumin8 changed the title build(deps): bump guava to 32.0.1-jre build(deps): bump guava to 32.0.1-jre, protobuf to 3.23.3 and google-http-client to 1.43.3. Jun 21, 2023
@zhumin8
Copy link
Contributor Author

zhumin8 commented Jun 21, 2023

merge the protobuf 3.23.3 and HTTP client updates into this PR so that enforcer can check for compatible dependencies together.

Error caused by protobuf upgrade:

Error:  Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (compile-protos) on project gapic-generator-java: Unable to resolve artifact: Missing:
Error:  ----------
Error:  1) com.google.protobuf:protoc:exe:linux-x86_64:3.23.3
Error:  
Error:    Try downloading the file manually from the project website.
Error:  
Error:    Then, install it using the command: 
Error:        mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.23.3 -Dclassifier=linux-x86_64 -Dpackaging=exe -Dfile=/path/to/file
Error:  
Error:    Alternatively, if you host your own repository you can deploy the file there: 
Error:        mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.23.3 -Dclassifier=linux-x86_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Error:  
Error:    Path to dependency: 
Error:    	1) com.google.api:gapic-generator-java:jar:2.21.1-SNAPSHOT
Error:    	2) com.google.protobuf:protoc:exe:linux-x86_64:3.23.3
Error:  
Error:  ----------
Error:  1 required artifact is missing.

This seems to be a known issue.
protocolbuffers/protobuf#13070

Next:

  • Downgrade protobuf back to 3.23.2,
  • To avoid j2objc-annotations version discrepancies, exclude j2objc-annotations from protobuf-java-util dependencies. This should work since every location with protobuf-java-util, either google-http-client or guava is present, so j2objc-annotations:2.8 can be picked up.

@zhumin8 zhumin8 changed the title build(deps): bump guava to 32.0.1-jre, protobuf to 3.23.3 and google-http-client to 1.43.3. build(deps): bump guava to 32.0.1-jre, google-http-client to 1.43.3. Jun 21, 2023
@zhumin8 zhumin8 requested review from burkedavison and suztomo June 21, 2023 20:40
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jun 21, 2023
@sonarqubecloud
Copy link

[gapic-generator-java-root] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[java_showcase_integration_tests] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[java_showcase_unit_tests] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants