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 version to 32.1.1-jre #1832

Merged
merged 2 commits into from
Jul 7, 2023
Merged

build(deps): Bump guava version to 32.1.1-jre #1832

merged 2 commits into from
Jul 7, 2023

Conversation

lqiu96
Copy link
Contributor

@lqiu96 lqiu96 commented Jul 6, 2023

Thank you for opening a Pull Request! For general contributing guidelines, please refer to contributing guide

Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

BEGIN_COMMIT_OVERRIDE
deps: Bump guava version to 32.1.1-jre
END_COMMIT_OVERRIDE

@lqiu96 lqiu96 requested a review from burkedavison July 6, 2023 18:35
@lqiu96 lqiu96 requested a review from a team as a code owner July 6, 2023 18:35
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jul 6, 2023
@lqiu96
Copy link
Contributor Author

lqiu96 commented Jul 6, 2023

Error:

FAILURE: Build failed with an exception.

* What went wrong:
8 actionable tasks: 5 executed, 3 up-to-date
Execution failed for task ':gapic-google-cloud-storage-v2-java:compileTestJava'.
> Could not resolve all files for configuration ':gapic-google-cloud-storage-v2-java:testCompileClasspath'.
   > Could not resolve com.google.guava:guava:32.1.1-jre.
     Required by:
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax:2.30.1-SNAPSHOT
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax-grpc:2.30.1-SNAPSHOT
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax:2.30.1-SNAPSHOT > com.google.api:api-common:2.13.1-SNAPSHOT
      > Module 'com.google.guava:guava' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]
   > Could not resolve com.google.guava:guava:31.1-android.
     Required by:
         project :gapic-google-cloud-storage-v2-java > io.grpc:grpc-stub:1.55.3
      > Module 'com.google.guava:guava' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]
   > Could not resolve com.google.guava:guava:31.1-jre.
     Required by:
         project :gapic-google-cloud-storage-v2-java > com.google.api.grpc:grpc-google-iam-v1:1.10.0
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax-grpc:2.30.1-SNAPSHOT > io.grpc:grpc-alts:1.55.3
      > Module 'com.google.guava:guava' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]
   > Could not resolve com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava.
     Required by:
         project :gapic-google-cloud-storage-v2-java > com.google.api.grpc:grpc-google-iam-v1:1.10.0
      > Module 'com.google.guava:listenablefuture' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' also provided by [com.google.guava:guava:32.1.1-jre(jreApiElements)]
   > Could not resolve com.google.guava:guava:32.0.0-android.
     Required by:
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax:2.30.1-SNAPSHOT > com.google.auth:google-auth-library-oauth2-http:1.19.0
      > Module 'com.google.guava:guava' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]
   > Could not resolve com.google.guava:guava:30.1.1-android.
     Required by:
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax:2.30.1-SNAPSHOT > com.google.auth:google-auth-library-oauth2-http:1.19.0 > com.google.http-client:google-http-client:1.42.3
      > Module 'com.google.guava:guava' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]
   > Could not resolve com.google.guava:guava:29.0-android.
     Required by:
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax:2.30.1-SNAPSHOT > com.google.auth:google-auth-library-oauth2-http:1.19.0 > com.google.http-client:google-http-client:1.42.3 > io.opencensus:opencensus-contrib-http-util:0.31.1
      > Module 'com.google.guava:guava' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]

@lqiu96
Copy link
Contributor Author

lqiu96 commented Jul 6, 2023

May be related to: google/guava#6618

@lqiu96
Copy link
Contributor Author

lqiu96 commented Jul 6, 2023

Temp fix might be to include the snippet in our gradle template files. Going to run this locally to reproduce and see if the fix works...

I'm able to reproduce the problem locally:

> Task :gapic-google-cloud-storage-v2-java:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :gapic-google-cloud-storage-v2-java:compileTestJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gapic-google-cloud-storage-v2-java:compileTestJava'.
> Could not resolve all files for configuration ':gapic-google-cloud-storage-v2-java:testCompileClasspath'.
   > Could not resolve com.google.guava:guava:32.1.1-jre.
     Required by:
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax:2.30.1-SNAPSHOT
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax-grpc:2.30.1-SNAPSHOT
         project :gapic-google-cloud-storage-v2-java > com.google.api:gax:2.30.1-SNAPSHOT > com.google.api:api-common:2.13.1-SNAPSHOT
      > Module 'com.google.guava:guava' has been rejected:
           Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]

The dependencies in gapic-google-cloud-storage-v2-java:

dependencies {
  api 'com.google.api:gax:2.30.1-SNAPSHOT'
  testImplementation 'com.google.api:gax:2.30.1-SNAPSHOT:testlib'
  api 'com.google.api:gax-grpc:2.30.1-SNAPSHOT'
  testImplementation 'com.google.api:gax-grpc:2.30.1-SNAPSHOT:testlib'
  api 'io.grpc:grpc-protobuf:1.55.3'
  testImplementation 'io.grpc:grpc-stub:1.55.3'
  testImplementation 'io.grpc:grpc-netty-shaded:1.55.3'
  testImplementation 'junit:junit:4.13.2'

  // TODO: remove when dropping Java 8 support.
  // https://github.com/googleapis/gapic-generator-java/issues/888
  implementation 'javax.annotation:javax.annotation-api:1.3.2'

  api project(':proto-google-cloud-storage-v2-java')
  api 'com.google.api.grpc:proto-google-iam-v1:1.10.0'
  testImplementation project(':grpc-google-cloud-storage-v2-java')
  testImplementation 'com.google.api.grpc:grpc-google-iam-v1:1.10.0'
}

@lqiu96
Copy link
Contributor Author

lqiu96 commented Jul 6, 2023

Was able to resolve the build issue via two ways (possibly both temporary measures?):

Option 1

Manually include the guava version as part of the dependencies. The error above seems to trying to pull in different versions of guava. Thanks @blakeli0 for the idea.

api '{{maven.com_google_guava_guava}}'

I don't think there is any harm with specifying the guava version in the build.gradle file, but I'm not 100% sure.

Option 2

Include this blurb in the dependencies section for the template:

modules {
    module("com.google.guava:listenablefuture") {
      replacedBy("com.google.guava:guava", "listenablefuture is part of guava")
    }
  }

This is seems to be a temporary fix suggested by the guava devs: https://github.com/google/guava/releases/tag/v32.1.0#user-content-duplicate-ListenableFuture

Might be worth adding here and checking this and keeping an eye on this issue: gradle/gradle#22326. Perhaps we can remove it when the gradle issue is resolved?

@lqiu96 lqiu96 requested a review from blakeli0 July 6, 2023 22:14
@suztomo
Copy link
Member

suztomo commented Jul 7, 2023

When if Gradle fixes the problem in their latest Gradle 9, I expect we don't use that latest Gradle 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 Jul 7, 2023
@suztomo
Copy link
Member

suztomo commented Jul 7, 2023

Also, I've never heard our self-service client library (that Gradle file is used there) being used in Android. Option 1 is good.

@sonarcloud
Copy link

sonarcloud bot commented Jul 7, 2023

[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

@sonarcloud
Copy link

sonarcloud bot commented Jul 7, 2023

[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

@sonarcloud
Copy link

sonarcloud bot commented Jul 7, 2023

[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

@lqiu96 lqiu96 merged commit 016e84d into main Jul 7, 2023
@lqiu96 lqiu96 deleted the guava-32.1.1 branch July 7, 2023 14:11
lqiu96 added a commit that referenced this pull request Jul 12, 2023
* chore: Bump guava version to 32.1.1-jre

* chore: Add guava to gradle template
lqiu96 added a commit that referenced this pull request Jul 17, 2023
* fix: Use bindings for resolving multi pattern resources

* chore: Fix lint issues

* chore: Add unit tests for the behavior

* chore: Add comments for the tests

* chore: Remove unused comment

* feat: support GDC-H Credentials  (#1642)

* chore: initial additions to handle GDC-H API audience

* chore: add unit tests for GDC-H

* chore: cleanup of logic

* chore: decompose tests into separate methods

* chore: fix clirr diff check

* chore: fmt:format

* chore: add support in `ClientSettings`

* chore: add showcase IT for GDCH credentials

* chore: comments

* chore: improve tests

* chore: add partial IT for testing context credential

* chore: recreate GdchCredentials with audience using convenience method

* chore: more readable api audience logic

* chore: no wildcard imports

* chore: javadoc for public methods

* chore: gdch test to use default null initialization

* chore: tear down for gdch IT

* chore: `assertThrows` for gdch ITs

* chore: mvn fmt:format

* test: remove context test

* docs: explain that audience will be overriden if set through client/stub settings

* test: test audience setting should modify initial credentials

* chore: clirr check

* chore: ignore gdch changes

* chore: format

* chore: default to endpoint if audience not provided

* test: refresh gdch creds to confirm audience works

* chore: fmt

* chore: fmt

* chore: better test names in ClientContextTest

* chore: better test names for showcase tests

* chore: simplify refresh verification logic

* chore: include outcome in gdch it test names

* chore: expand comments in GDCH ITs

* test: intercept mock transport to verify audience

* chore: fmt

* chore: move auth test-jar to shared dependencies

* chore: cleanup

* chore: use inferred version for auth library

* deps: update google-auth-java-library to 1.19.0

* choreL fmt ITGdch.java

* chore: import auth test-jar using common version variable

* chore: remove auth test-jar import from first-party-dependencies

* chore: add license headers to new files

* chore: revert google-auth-version to be obtained from main branch

* chore: correct showcase parent pom indentation

* chore: remove resource declaration for native test build

* fix: [gapic-generator-java] handle response and metadata type ambiguity in LRO parsing (#1726)

* chore: Bump grpc-java version to 1.55.3 (#1829)

* chore: Bump gapic-showcase version to 0.28.2 (#1830)

* build(deps): Bump guava version to 32.1.1-jre (#1832)

* chore: Bump guava version to 32.1.1-jre

* chore: Add guava to gradle template

* chore: Add j2obc-annotations to shared-dependencies (#1834)

* ci: fix showcase-clirr check on release PRs (#1835)

Install sdk-platform-java before performing final clirr check, so version changes are available in the local repository

* chore(main): release 2.23.0 (#1806)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* chore(main): release 2.23.1-SNAPSHOT (#1836)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* chore: Implement gRPC and HttpJson showcase tests for IAM (#1789)

* chore: Add framework for iam showcase tests

* chore: Generate clients with IAM stubs

* chore: Add IAM showcase tests

* chore: Add samples

* chore: Exclude httpjson tests

* chore: Use @before to create the resource

* chore: Use constant for policy

* chore: Log resource name

* chore: Test use setPolicyRequest's resourceName

* chore: run mvn clean before showcase tests

* chore: Attempt again with cache deleted

* chore: Add logging for test

* chore: Sleep for 1s

* chore: Use resource from setPolicyRequest

* chore: Ignore failing HttpJson test for now

* chore: Un-ignore test

* chore: Fix lint issues

* chore: Test with rooms/ prefix

* chore: Use Identity client for Users

* chore: Create user resource to assign policy to

* chore: Use user's name as resource id

* chore: Change resource name before each test

* chore: Add iam-grpc in pom

* chore: Resolve sonar issues

* chore: Add comment for testIamPolicy

* chore: Address PR comments

* ci: showcase native check (#1833)

* ci: showcase native check

* fix: add explicit java version

* fix: adjust syntax

* fix: add resource-config entry for ITGdch

* fix: copy file to temp folder so it can be accessed by path

* chore: formatting

* fix: prevent shutdown warnings with client.awaitTermination

* ci: fix build file location for downstream test

* chore: use static imports for Truth assertions

* chore: Resolve merge conflicts

* chore: Use bindings for any matching resource patterns

* chore: Fix lint issues

* chore: Remove unused code

* chore: Fix lint issues

* chore: Add test for resourceName matching bindings

* chore: Fix lint issues

---------

Co-authored-by: Diego Alonso Marquez Palacios <[email protected]>
Co-authored-by: Emily Wang <[email protected]>
Co-authored-by: Burke Davison <[email protected]>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants