-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Presubmit upper-bound-check with Google Libraries BOM #6606
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
# Copyright 2019 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Presubmit to ensure the dependencies of the Google Libraries BOM, with the modification of change | ||
# in the PR, pick up the highest versions among transitive dependencies. | ||
# https://maven.apache.org/enforcer/enforcer-rules/requireUpperBoundDeps.html | ||
|
||
set -eo pipefail | ||
# Display commands being run. | ||
set -x | ||
|
||
cd github/google-cloud-java/ | ||
|
||
# Print out tool version | ||
echo $JOB_TYPE | ||
java -version | ||
mvn -version | ||
git version | ||
|
||
# Make artifacts available for 'mvn validate' at the bottom | ||
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V | ||
|
||
# The property key for this repository in Google Libraries BOM | ||
VERSION_KEY=google.cloud.java.version | ||
# 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()' -` | ||
|
||
if [ -z "${VERSION}" ]; then | ||
echo "Version is not found in ${VERSION_POM}" | ||
exit 1 | ||
fi | ||
echo "Version: ${VERSION}" | ||
|
||
# Run the upper bound check against Google Libraries BOM in cloud-opensource-java | ||
git clone https://github.com/GoogleCloudPlatform/cloud-opensource-java.git | ||
|
||
cd cloud-opensource-java/boms/cloud-oss-bom | ||
mvn install | ||
chingor13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# This upper-bounds-check project has the enforcer rule with requireUpperBoundDeps | ||
cd ../upper-bounds-check | ||
mvn validate -D${VERSION_KEY}=${VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
# Configure the docker image for kokoro-trampoline. | ||
env_vars: { | ||
key: "TRAMPOLINE_IMAGE" | ||
value: "gcr.io/cloud-devrel-kokoro-resources/java8" | ||
} | ||
|
||
env_vars: { | ||
key: "TRAMPOLINE_BUILD_FILE" | ||
value: "github/google-cloud-java/.kokoro/bom-upper-bounds-check.sh" | ||
} |
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.
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=".*"?
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