GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build: google format plugin upgrade by suztomo · Pull Request #868 · googleapis/gax-java

This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Conversation

@suztomo

@suztomo suztomo commented Feb 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Torwards #867 . The old plugin version does not work with Gradle 6.

4 Java files are needed to be updated in new version of the formatter. ./gradlew googleJavaFormat made the change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
suztomo added 2 commits February 11, 2020 12:44
@suztomo
Google-java-format-plugin 0.8
6edae36
@suztomo
Applied google-java-format with new version
64c96d9
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 11, 2020
suztomo
suztomo commented Feb 11, 2020
View reviewed changes
Comment thread build.gradle

allprojects {
repositories {
mavenCentral() // for google-java-format's dependency

@suztomo suztomo Feb 11, 2020

Copy link
Copy Markdown
Member Author

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.

Without this setting, the build fails:

suztomo@suxtomo24:~/gax-java$ ./gradlew build
> Task :verifyGoogleJavaFormat FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':verifyGoogleJavaFormat'.
> Could not resolve all files for configuration ':googleJavaFormat1.6'.
   > Cannot resolve external dependency com.google.googlejavaformat:google-java-format:1.6 because no repositories are defined.
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 0s
2 actionable tasks: 2 executed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@suztomo
suztomo requested review from chingor13 and kolea2 February 11, 2020 17:53
@suztomo

suztomo commented Feb 18, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Travis failed: https://travis-ci.org/googleapis/gax-java/jobs/649038735?utm_medium=notification&utm_source=github_status

Execution failed for task ':verifyGoogleJavaFormat'.
> com/google/googlejavaformat/java/JavaFormatterOptions$Style : Unsupported major.minor version 52.0
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rahulKQL

rahulKQL commented Feb 19, 2020

Copy link
Copy Markdown
Contributor

This is related to #865.
It seems only until google-java-format:0.6 is supported on Java 7 and unfortunately this version is not supported on Java-11.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@suztomo

suztomo commented Feb 19, 2020

Copy link
Copy Markdown
Member Author

@rahulKQL Shall we disable google format plugin for non-Java8 builds? While we care about JDK compatibility of gax-java artifacts and its tests, we don’t care source code style validation difference between JDK versions. Checking the style on Java 1.8 build should be enough.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rahulKQL

rahulKQL commented Feb 19, 2020

Copy link
Copy Markdown
Contributor

@suztomo That sounds a good workaround to me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@suztomo
VerifyGoogleJavaFormat only for Java8
3f134d0
@rahulKQL
rahulKQL requested a review from igorbernstein2 February 19, 2020 15:53
@suztomo
onlyIf
52ed07f
@codecov

codecov Bot commented Feb 19, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #868 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #868      +/-   ##
============================================
- Coverage     78.62%   78.62%   -0.01%     
  Complexity     1163     1163              
============================================
  Files           203      203              
  Lines          5142     5141       -1     
  Branches        413      413              
============================================
- Hits           4043     4042       -1     
  Misses          925      925              
  Partials        174      174
Impacted Files Coverage Δ Complexity Δ
.../java/com/google/longrunning/OperationsClient.java 73.33% <ø> (ø) 16 <0> (ø) ⬇️
...api/gax/grpc/InstantiatingGrpcChannelProvider.java 79.89% <ø> (ø) 35 <0> (ø) ⬇️
...a/com/google/api/gax/tracing/OpencensusTracer.java 87.5% <ø> (ø) 32 <0> (ø) ⬇️
...src/main/java/com/google/api/gax/rpc/Watchdog.java 80.34% <0%> (-0.17%) 11% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee90c2c...5f20fa9. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@suztomo

suztomo commented Feb 19, 2020

Copy link
Copy Markdown
Member Author

Travis builds succeeded.

Build with Java 8 ran googleFormatPlugin

> Task :verifyGoogleJavaFormat
> Task :verifyLicense
> Task :benchmark:verifyGoogleJavaFormat
> Task :benchmark:verifyLicense
> Task :gax:verifyGoogleJavaFormat
> Task :gax:verifyLicense
> Task :gax-bom:verifyGoogleJavaFormat NO-SOURCE
> Task :gax-bom:verifyLicense
> Task :gax-grpc:verifyGoogleJavaFormat
> Task :gax-grpc:verifyLicense
> Task :gax-httpjson:verifyGoogleJavaFormat

Build with Java 7 skips verifyGoogleJavaFormat.

> Task :verifyGoogleJavaFormat SKIPPED
> Task :verifyLicense
> Task :benchmark:verifyGoogleJavaFormat SKIPPED
> Task :benchmark:verifyLicense
> Task :gax:verifyGoogleJavaFormat SKIPPED
> Task :gax:verifyLicense
> Task :gax-bom:verifyGoogleJavaFormat SKIPPED
> Task :gax-bom:verifyLicense
> Task :gax-grpc:verifyGoogleJavaFormat SKIPPED
> Task :gax-grpc:verifyLicense
> Task :gax-httpjson:verifyGoogleJavaFormat SKIPPED
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

suztomo added 2 commits February 19, 2020 11:39
@suztomo
isJava8Compatible
b3b9c34
@suztomo
Added comment
ad219ad
suztomo
suztomo commented Feb 19, 2020
View reviewed changes

@suztomo suztomo left a comment

Copy link
Copy Markdown
Member Author

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.

@rahulKQL PTAL.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.gradle
exclude 'build/**'
exclude 'bazel*/**'
}
verifyGoogleJavaFormat.onlyIf { JavaVersion.current().isJava8Compatible() }

@suztomo suztomo Feb 19, 2020

Copy link
Copy Markdown
Member Author

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.

Java 11 also works fine for the plugin. Therefore, leveraging JavaVersion's isJava8Compatible method.

suztomo-macbookpro44:gax-java suztomo$ java -version
java version "11.0.4" 2019-07-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

suztomo-macbookpro44:gax-java suztomo$ ./gradlew verifyGoogleJavaFormat

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 6s
5 actionable tasks: 5 executed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@suztomo
empty commit for Kokoro build
9322eb7
@rahulKQL

rahulKQL commented Feb 20, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@suztomo Thanks for keeping me in the loop but I think we might need sign off from @kolea2 or @chingor13 as this would affect future PRs.

Also regarding the Java 11 build failure can be fixed by updating Jacoco version to "0.8.2+"

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

suztomo added 2 commits February 20, 2020 10:26
@suztomo
Jacoco 0.8.2
8cc8992
@suztomo
Merge branch 'plugin_upgrades' of https://github.com/suztomo/gax-java …
c0b03b2
…into plugin_upgrades
@suztomo suztomo changed the title build: google format plugin upgrade build: google format plugin and jacoco upgrade Feb 20, 2020
@suztomo
Giving up Jacoco upgrade
5f20fa9
* What went wrong:
A problem occurred configuring root project 'gax-java'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve gradle.plugin.com.dorongold.plugins:task-tree:1.3.1.
     Required by:
         project :
      > Could not resolve gradle.plugin.com.dorongold.plugins:task-tree:1.3.1.
         > Could not get resource 'https://plugins.gradle.org/m2/gradle/plugin/com/dorongold/plugins/task-tree/1.3.1/task-tree-1.3.1.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/gradle/plugin/com/dorongold/plugins/task-tree/1.3.1/task-tree-1.3.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed

https://source.cloud.google.com/results/invocations/e8c74bc9-fc2d-4047-82b8-3e2d5b9cdc64/targets/cloud-devrel%2Fclient-libraries%2Fjava%2Fgax-java%2Fpresubmit%2Fjava7/log
@suztomo suztomo changed the title build: google format plugin and jacoco upgrade build: google format plugin upgrade Feb 20, 2020
@suztomo

suztomo commented Feb 20, 2020

Copy link
Copy Markdown
Member Author

@rahulKQL Jacoco upgrade was not trivial. Not including that in this PR for now.
https://source.cloud.google.com/results/invocations/e8c74bc9-fc2d-4047-82b8-3e2d5b9cdc64/targets/cloud-devrel%2Fclient-libraries%2Fjava%2Fgax-java%2Fpresubmit%2Fjava7/log

* What went wrong:
A problem occurred configuring root project 'gax-java'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve gradle.plugin.com.dorongold.plugins:task-tree:1.3.1.
     Required by:
         project :
      > Could not resolve gradle.plugin.com.dorongold.plugins:task-tree:1.3.1.
         > Could not get resource 'https://plugins.gradle.org/m2/gradle/plugin/com/dorongold/plugins/task-tree/1.3.1/task-tree-1.3.1.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/gradle/plugin/com/dorongold/plugins/task-tree/1.3.1/task-tree-1.3.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@suztomo

suztomo commented Feb 20, 2020

Copy link
Copy Markdown
Member Author

@chingor13 @kolea2 Would you approve and merge this? (Now I'm in googleapis organization but I don't have write permission)

Linkage Monitor fails until #864 is merged (Would you merge that as well?)

Java 11 fails until the Jacoco version is upgraded (not in this PR).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 24, 2020
@chingor13 chingor13 self-assigned this Feb 24, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 24, 2020
chingor13
chingor13 approved these changes Feb 24, 2020
View reviewed changes
@kolea2
kolea2 merged commit 5440bc6 into googleapis:master Feb 26, 2020
@suztomo

suztomo commented Feb 26, 2020

Copy link
Copy Markdown
Member Author

@kolea2 @chingor13 Thank you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Feb 26, 2020
deps: update jacoco to 0.8.5 #883
Merged
chore(deps): update google-java-format-gradle-plugin for java 11 build #866
Closed
@chingor13 chingor13 mentioned this pull request Feb 26, 2020
Release gax-java v1.54.0 #884
Closed
@rahulKQL rahulKQL mentioned this pull request Feb 27, 2020
Gradle build fails in Open-JDK-11 bcoz google-java-format plugin and jacoco #865
Closed
@chingor13 chingor13 mentioned this pull request Feb 27, 2020
Release gax-java v1.54.0 #889
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@kolea2 kolea2 Awaiting requested review from kolea2
@igorbernstein2 igorbernstein2 Awaiting requested review from igorbernstein2
1 more reviewer
@chingor13 chingor13 chingor13 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@chingor13 chingor13

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@suztomo @rahulKQL @chingor13 @googlebot @kokoro-team @kolea2
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.