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 — Presubmit upper-bound-check with Google Libraries BOM by suztomo · Pull Request #6606 · googleapis/google-cloud-java

Conversation

@suztomo

@suztomo suztomo commented Oct 28, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Fixes GoogleCloudPlatform/cloud-opensource-java#971 .

@chingor13 , @kolea2 , @BenWhitehead I think this presubmit will help google-cloud-java to find forgotten dependency updates. Does this look good to you?

Background

Elliotte and I are thinking an additional presubmit to ensure upper bounds check to the libraries in Google Libraries BOM. This presubmit ensures Google Libraries BOM will pick up the highest versions among transitive dependencies.

Example failure

This presubmit fails with master (721d749):

+ mvn validate -Dgoogle.cloud.java.version=0.116.1-alpha-SNAPSHOT
[INFO] Scanning for projects...
[INFO] 
[INFO] --------< com.google.cloud.tools.opensource:upper-bounds-check >--------
[INFO] Building Cloud Platform Supported Libraries Upper Bounds Check 2.0.0-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce) @ upper-bounds-check ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for com.google.auth:google-auth-library-oauth2-http:0.17.2 paths to dependency are:
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-core:1.91.2
    +-com.google.auth:google-auth-library-oauth2-http:0.17.2
and
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-core:1.91.2
    +-com.google.api:gax:1.49.1 (managed) <-- com.google.api:gax:1.49.0
      +-com.google.auth:google-auth-library-oauth2-http:0.18.0
and
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-storage:1.98.1-SNAPSHOT
    +-com.google.cloud:google-cloud-core-http:1.91.2
      +-com.google.auth:google-auth-library-oauth2-http:0.17.2
and
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-storage:1.98.1-SNAPSHOT
    +-com.google.cloud:google-cloud-core-http:1.91.2
      +-com.google.api:gax-httpjson:0.66.1 (managed) <-- com.google.api:gax-httpjson:0.66.0
        +-com.google.auth:google-auth-library-oauth2-http:0.18.0
, 
Require upper bound dependencies error for com.google.auth:google-auth-library-credentials:0.17.2 paths to dependency are:
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-core:1.91.2
    +-com.google.auth:google-auth-library-credentials:0.17.2
and
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-core:1.91.2
    +-com.google.auth:google-auth-library-oauth2-http:0.17.2
      +-com.google.auth:google-auth-library-credentials:0.17.2
and
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-storage:1.98.1-SNAPSHOT
    +-com.google.cloud:google-cloud-core-http:1.91.2
      +-com.google.auth:google-auth-library-credentials:0.17.2
and
+-com.google.cloud.tools.opensource:upper-bounds-check:2.0.0-SNAPSHOT
  +-com.google.cloud:google-cloud-storage:1.98.1-SNAPSHOT
    +-com.google.cloud:google-cloud-core-http:1.91.2
      +-com.google.api:gax-httpjson:0.66.1 (managed) <-- com.google.api:gax-httpjson:0.66.0
        +-com.google.auth:google-auth-library-credentials:0.18.0
]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

What does that mean?

This output shows 2 errors:

  • com.google.auth:google-auth-library-oauth2-http: 0.18.0 is the highest but 0.17.2 is picked up (because it's closer to the root).
  • com.google.auth:google-auth-library-credentials: 0.18.0 is the highest but 0.17.2 is picked up.

What can we do?

Update the version of the two libraries.

  • Both libraries are managed by com.google.auth:google-auth-library-bom
  • google-cloud-core:1.91.3 already uses the google-auth version 0.18.0. Good.
  • google-cloud-bom to update google-cloud-core dependency to 1.91.3 from 1.91.2 (721d749)

Sorry, something went wrong.

Uh oh!

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

All reactions
@suztomo
Draft of bom-upper-bounds-check.sh
177fe92
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 28, 2019
@suztomo
Format
f0cc490
@suztomo suztomo changed the title [Not for merge yet] Draft of bom-upper-bounds-check.sh Presubmit upper-bound-check with Google Libraries BOM Oct 28, 2019
@suztomo suztomo mentioned this pull request Oct 28, 2019
Can upperBoundCheck run as part of a presubmit in libraries' repositories? GoogleCloudPlatform/cloud-opensource-java#971
Closed
@suztomo

suztomo commented Oct 28, 2019

Copy link
Copy Markdown
Member Author

The errors seem valid. I added "What can we do?" section.

@elharo Do they (this PR and the diagnosis) look good to you?

All reactions

Sorry, something went wrong.

Uh oh!

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

@elharo

elharo commented Oct 28, 2019

Copy link
Copy Markdown
Contributor

Sounds accurate. I agree that google-cloud-bom should update google-cloud-core dependency to 1.91.3 ASAP and absolutely before the next release. This is why we need this check. The PR that made this change shouldn't have gone in.

suztomo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@suztomo
Added comment
e8da764
@suztomo
suztomo marked this pull request as ready for review October 28, 2019 15:28
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 28, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 28, 2019
@suztomo
Kokoro build file
1aa0e98
@codecov

codecov Bot commented Oct 28, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

Merging #6606 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #6606   +/-   ##
=========================================
  Coverage     46.35%   46.35%           
  Complexity    28001    28001           
=========================================
  Files          2613     2613           
  Lines        288075   288075           
  Branches      33779    33779           
=========================================
  Hits         133526   133526           
  Misses       144309   144309           
  Partials      10240    10240

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 721d749...b66e454. Read the comment docs.

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 Oct 28, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 28, 2019
BenWhitehead
BenWhitehead reviewed Oct 28, 2019
View reviewed changes
Comment thread .kokoro/bom-upper-bounds-check.sh Resolved

Uh oh!

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

@suztomo
Install libraries-bom before validate
9df5058
@chingor13 chingor13 added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 28, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 28, 2019
suztomo
suztomo commented Oct 28, 2019
View reviewed changes
Comment thread .kokoro/bom-upper-bounds-check.sh Resolved

Uh oh!

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

@suztomo
xmllint
b66e454
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 29, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 29, 2019
chingor13
chingor13 approved these changes Oct 29, 2019
View reviewed changes
elharo
elharo reviewed Oct 29, 2019
View reviewed changes
Comment thread .kokoro/bom-upper-bounds-check.sh
# Read the version of POM. Example version: '0.116.1-alpha-SNAPSHOT'
VERSION_POM=google-cloud-bom/pom.xml
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
VERSION=`sed -e 's/xmlns=".*"//' $VERSION_POM | xmllint --xpath '/project/version/text()' -`

@elharo elharo Oct 29, 2019

Copy link
Copy Markdown
Contributor

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.

why sed -e 's/xmlns=".*"?

Sorry, something went wrong.

Uh oh!

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

All reactions

@suztomo suztomo Oct 29, 2019

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.

Because Namespace (xmlns) prevents xmllint from specifying tag names in XPath.
https://stackoverflow.com/questions/41114695/get-pom-xml-version-with-xmllint

Sorry, something went wrong.

Uh oh!

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

All reactions
@suztomo

suztomo commented Oct 29, 2019

Copy link
Copy Markdown
Member Author

xmllint works nicely:

+ VERSION_POM=google-cloud-bom/pom.xml
++ sed -e 's/xmlns=".*"//' google-cloud-bom/pom.xml
++ xmllint --xpath '/project/version/text()' -
+ VERSION=0.116.1-alpha-SNAPSHOT
All reactions

Sorry, something went wrong.

Uh oh!

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

@chingor13 chingor13 mentioned this pull request Oct 29, 2019
Do not merge: testing #6650
Closed
@BenWhitehead

BenWhitehead commented Oct 29, 2019

Copy link
Copy Markdown
Contributor

Nice solution with xmllint!

All reactions

Sorry, something went wrong.

Uh oh!

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

@chingor13

chingor13 commented Oct 29, 2019

Copy link
Copy Markdown
Contributor

#6650 merged #6649 and this PR and the upper bounds tests passes

All reactions

Sorry, something went wrong.

Uh oh!

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

@suztomo

suztomo commented Oct 29, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

@chingor13 Thank you for confirmation in 6650. Would you merge this PR? (Only those with write access to this repository can merge pull requests.)

All reactions

Sorry, something went wrong.

Uh oh!

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

@chingor13
chingor13 merged commit 597f52e into googleapis:master Oct 29, 2019
@suztomo
suztomo deleted the bom-upper-bounds branch October 29, 2019 20:25
@chingor13 chingor13 mentioned this pull request Oct 30, 2019
Release google-cloud-java v0.117.0 #6664
Merged
@codyoss codyoss mentioned this pull request Nov 6, 2019
Release google-cloud-java v0.112.0 #6703
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chingor13 chingor13 chingor13 approved these changes
+2 more reviewers
@elharo elharo elharo left review comments
@BenWhitehead BenWhitehead BenWhitehead left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

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.

Can upperBoundCheck run as part of a presubmit in libraries' repositories?

Uh oh!

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

6 participants

@suztomo @elharo @BenWhitehead @chingor13 @googlebot @yoshi-kokoro
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.