GeezerVison is showing github.com — Presubmit upper-bound-check with Google Libraries BOM by suztomo · Pull Request #6606 · googleapis/google-cloud-java
Conversation
suztomo
commented
Oct 28, 2019
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
|
The errors seem valid. I added "What can we do?" section.
@elharo Do they (this PR and the diagnosis) look good to you?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Oct 28, 2019
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merging #6606 into master will not change coverage.
The diff coverage is n/a.

@@ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
|
# 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()' -`
|
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.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Nice solution with xmllint!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
#6650 merged #6649 and this PR and the upper bounds tests passes
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
suztomo
commented
Oct 29, 2019
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
@chingor13 Thank you for confirmation in 6650. Would you merge this PR? (Only those with write access to this repository can merge pull requests.)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
+2 more reviewers
elharo
elharo 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.
Milestone
No milestone
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.
|