From 79ff7e9a378cd48c04bb64194965240d631193e4 Mon Sep 17 00:00:00 2001 From: stephwang Date: Fri, 16 Oct 2020 15:06:59 -0400 Subject: [PATCH 1/4] buid(ci): add check to verify the BOM works in client libraries --- .kokoro/client-test.sh | 57 +++++++++++++++++++++++++++++++ .kokoro/presubmit/client-test.cfg | 12 +++++++ 2 files changed, 69 insertions(+) create mode 100755 .kokoro/client-test.sh create mode 100644 .kokoro/presubmit/client-test.cfg diff --git a/.kokoro/client-test.sh b/.kokoro/client-test.sh new file mode 100755 index 00000000..b2bf9f5d --- /dev/null +++ b/.kokoro/client-test.sh @@ -0,0 +1,57 @@ +#!/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 + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# 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 version property tag of this BOM in the client library +VERSION_KEY=google.cloud.shared-dependencies.version +# Read the current version of this BOM in the POM. Example version: '0.116.1-alpha-SNAPSHOT' +VERSION_POM=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}" + +# Check this BOM against a few java client libraries +git clone https://github.com/googleapis/java-bigquery.git +cd java-bigquery +mvn install + +cd google-cloud-bigquery +mvn validate -D${VERSION_KEY}=${VERSION} diff --git a/.kokoro/presubmit/client-test.cfg b/.kokoro/presubmit/client-test.cfg new file mode 100644 index 00000000..e26661e3 --- /dev/null +++ b/.kokoro/presubmit/client-test.cfg @@ -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/java-cloud-bom/.kokoro/bom-upper-bounds-check.sh" +} From 6a65ca4101db4a4c8d08f875bea6e9628a02099b Mon Sep 17 00:00:00 2001 From: stephwang Date: Fri, 16 Oct 2020 16:45:43 -0400 Subject: [PATCH 2/4] add a few more clients --- .kokoro/client-test.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.kokoro/client-test.sh b/.kokoro/client-test.sh index b2bf9f5d..31a3b7a1 100755 --- a/.kokoro/client-test.sh +++ b/.kokoro/client-test.sh @@ -49,9 +49,30 @@ fi echo "Version: ${VERSION}" # Check this BOM against a few java client libraries +# java-bigquery git clone https://github.com/googleapis/java-bigquery.git cd java-bigquery mvn install - cd google-cloud-bigquery mvn validate -D${VERSION_KEY}=${VERSION} + +# java-bigqueryconnection +git clone https://github.com/googleapis/java-bigqueryconnection.git +cd java-bigqueryconnection +mvn install +cd google-cloud-bigqueryconnection +mvn validate -D${VERSION_KEY}=${VERSION} + +# java-storage +git clone https://github.com/googleapis/java-storage.git +cd java-storage +mvn install +cd google-cloud-storage +mvn validate -D${VERSION_KEY}=${VERSION} + +# java-spanner +git clone https://github.com/googleapis/java-spanner.git +cd java-spanner +mvn install +cd google-cloud-spanner +mvn validate -D${VERSION_KEY}=${VERSION} \ No newline at end of file From 3664680cae64b66044e9f4757284af877428dfd1 Mon Sep 17 00:00:00 2001 From: stephwang Date: Fri, 16 Oct 2020 16:59:26 -0400 Subject: [PATCH 3/4] update filenames --- .kokoro/{client-test.sh => client-library-check.sh} | 0 .kokoro/presubmit/{client-test.cfg => client-library-check.cfg} | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .kokoro/{client-test.sh => client-library-check.sh} (100%) rename .kokoro/presubmit/{client-test.cfg => client-library-check.cfg} (76%) diff --git a/.kokoro/client-test.sh b/.kokoro/client-library-check.sh similarity index 100% rename from .kokoro/client-test.sh rename to .kokoro/client-library-check.sh diff --git a/.kokoro/presubmit/client-test.cfg b/.kokoro/presubmit/client-library-check.cfg similarity index 76% rename from .kokoro/presubmit/client-test.cfg rename to .kokoro/presubmit/client-library-check.cfg index e26661e3..51efcf8d 100644 --- a/.kokoro/presubmit/client-test.cfg +++ b/.kokoro/presubmit/client-library-check.cfg @@ -8,5 +8,5 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-cloud-bom/.kokoro/bom-upper-bounds-check.sh" + value: "github/java-shared-dependencies/.kokoro/client-library-check.sh" } From 08247b341e8696afbda4ad610ea287c99a3f224a Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 16 Oct 2020 17:25:57 -0400 Subject: [PATCH 4/4] Update .kokoro/client-library-check.sh Co-authored-by: Jeff Ching --- .kokoro/client-library-check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/client-library-check.sh b/.kokoro/client-library-check.sh index 31a3b7a1..6c2c31a6 100755 --- a/.kokoro/client-library-check.sh +++ b/.kokoro/client-library-check.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2019 Google LLC +# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -75,4 +75,4 @@ git clone https://github.com/googleapis/java-spanner.git cd java-spanner mvn install cd google-cloud-spanner -mvn validate -D${VERSION_KEY}=${VERSION} \ No newline at end of file +mvn validate -D${VERSION_KEY}=${VERSION}