diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index be3b9bde..53941094 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:7062473f423f339256346ddbee3d81fb1de6b784fabc2a4d959d7df2c720e375 + digest: sha256:e3746f84955528d0fe24bf2e4df89875d6ce5a036af01b9c326d61a38838523a diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c8581001..f17b29f9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,3 +5,6 @@ Thank you for opening a Pull Request! Before submitting your PR, there are a few - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> ☕️ + +If you write sample code, please follow the [samples format]( +https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 957e3c84..4901c249 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -15,12 +15,6 @@ branchProtectionRules: - units (8) - units (11) - 'Kokoro - Test: Integration' - - dependencies (8, java-bigqueryconnection) - - dependencies (8, java-storage) - - dependencies (8, java-pubsub) - - dependencies (11, java-bigqueryconnection) - - dependencies (11, java-storage) - - dependencies (11, java-pubsub) - cla/google - OwlBot Post Processor - pattern: java7 @@ -37,16 +31,6 @@ branchProtectionRules: - units (8) - units (11) - 'Kokoro - Test: Integration' - - dependencies (8, java-bigquery) - - dependencies (8, java-bigqueryconnection) - - dependencies (8, java-spanner) - - dependencies (8, java-storage) - - dependencies (8, java-pubsub) - - dependencies (11, java-bigquery) - - dependencies (11, java-bigqueryconnection) - - dependencies (11, java-spanner) - - dependencies (11, java-storage) - - dependencies (11, java-pubsub) - cla/google - pattern: 2.4.x isAdminEnforced: true @@ -61,12 +45,6 @@ branchProtectionRules: - units (8) - units (11) - 'Kokoro - Test: Integration' - - dependencies (8, java-bigqueryconnection) - - dependencies (8, java-storage) - - dependencies (8, java-pubsub) - - dependencies (11, java-bigqueryconnection) - - dependencies (11, java-storage) - - dependencies (11, java-pubsub) - cla/google - OwlBot Post Processor - pattern: 0.20.x @@ -82,12 +60,6 @@ branchProtectionRules: - units (8) - units (11) - 'Kokoro - Test: Integration' - - dependencies (8, java-bigqueryconnection) - - dependencies (8, java-storage) - - dependencies (8, java-pubsub) - - dependencies (11, java-bigqueryconnection) - - dependencies (11, java-storage) - - dependencies (11, java-pubsub) - cla/google permissionRules: - team: yoshi-admins diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index c5132427..f5fc7d51 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: pull_request: name: auto-merge-readme @@ -6,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 05de1f60..83ef7f9c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: push: branches: @@ -12,8 +27,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -24,8 +39,8 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 @@ -39,8 +54,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -49,8 +64,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 @@ -61,8 +76,8 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 diff --git a/.github/workflows/downstream.yaml b/.github/workflows/downstream.yaml index 0f1bc811..794de17c 100644 --- a/.github/workflows/downstream.yaml +++ b/.github/workflows/downstream.yaml @@ -1,30 +1,157 @@ +# Copyright 2022 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: - push: - branches: - - main pull_request: + types: [ labeled ] + branches: + - main name: downstream jobs: dependencies: + if: ${{ github.event.label.name == 'downstream-check:run' }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - java: [8, 11] + java: [17] repo: - - java-bigquery - - java-bigqueryconnection - - java-spanner - - java-storage - - java-pubsub + # This list needs to be updated manually until an automated solution is in place. + - accessapproval + - accesscontextmanager + - aiplatform + - analytics-admin + - analytics-data + - api-gateway + - apigee-connect + - appengine-admin + - area120-tables + - artifact-registry + - asset + - assured-workloads + - automl + - bigquery + - bigqueryconnection + - bigquerydatatransfer + - bigquerymigration + - bigqueryreservation + - bigtable + - billing + - billingbudgets + - binary-authorization + - channel + - cloudbuild + - compute + - contact-center-insights + - container + - containeranalysis + - data-fusion + - datacatalog + - dataflow + - datalabeling + - dataproc + - dataproc-metastore + - datastore + - datastream + - debugger-client + - deploy + - dialogflow + - dialogflow-cx + - dlp + - dms + - dns + - document-ai + - domains + - errorreporting + - essential-contacts + - eventarc + - filestore + - firestore + - functions + - game-servers + - gke-connect-gateway + - gkehub + - gsuite-addons + - iam-admin + - iamcredentials + - iot + - kms + - language + - life-sciences + - logging + - logging-logback + - managed-identities + - mediatranslation + - memcache + - monitoring + - monitoring-dashboards + - network-management + - network-security + - networkconnectivity + - notebooks + - orchestration-airflow + - orgpolicy + - os-config + - os-login + - phishingprotection + - policy-troubleshooter + - private-catalog + - profiler + - pubsublite + - recaptchaenterprise + - recommendations-ai + - recommender + - redis + - resource-settings + - resourcemanager + - retail + - scheduler + - secretmanager + - security-private-ca + - securitycenter + - securitycenter-settings + - service-control + - service-management + - service-usage + - servicedirectory + - shell + - spanner + - spanner-jdbc + - speech + - storage + - storage-nio + - storage-transfer + - talent + - tasks + - texttospeech + - tpu + - trace + - translate + - video-intelligence + - video-transcoder + - vision + - vpcaccess + - webrisk + - websecurityscanner + - workflow-executions + - workflows steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v1 - with: - java-version: ${{matrix.java}} - - run: java -version - - run: sudo apt-get install libxml2-utils - - run: .kokoro/client-library-check.sh ${{matrix.repo}} + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: sudo apt-get install libxml2-utils + - run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} diff --git a/.github/workflows/upper-bound-check.yaml b/.github/workflows/upper-bound-check.yaml deleted file mode 100644 index 45cb8b9d..00000000 --- a/.github/workflows/upper-bound-check.yaml +++ /dev/null @@ -1,23 +0,0 @@ -on: - push: - branches: - - main - pull_request: -name: upper-bound-check -jobs: - upper-bound-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - name: Install the BOM to local Maven repository - run: .kokoro/build.sh - - name: Check the BOM content satisfies the upper-bound-check test case - run: mvn -B -V -ntp verify -Dcheckstyle.skip - working-directory: upper-bound-check diff --git a/.github/workflows/version-check.yaml b/.github/workflows/version-check.yaml new file mode 100644 index 00000000..b78a560f --- /dev/null +++ b/.github/workflows/version-check.yaml @@ -0,0 +1,41 @@ +on: + push: + branches: + - main + pull_request: +name: version-check +jobs: + upper-bound-check: + name: Upper-bound check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - name: Install the BOM to local Maven repository + run: .kokoro/build.sh + - name: Check the BOM content satisfies the upper-bound-check test case + run: mvn -B -V -ntp verify -Dcheckstyle.skip + working-directory: upper-bound-check + grpc-convergence-check: + name: gRPC dependency convergence check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - name: Install the BOM to local Maven repository + run: .kokoro/build.sh + - name: Check the BOM content satisfies the dependency-convergence-check test + run: mvn -B -V -ntp verify -Dcheckstyle.skip + working-directory: dependency-convergence-check diff --git a/.kokoro/build.bat b/.kokoro/build.bat index 05826ad9..cc602c9e 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,3 +1,18 @@ :: See documentation in type-shell-output.bat +# Copyright 2022 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/client-library-check.sh b/.kokoro/client-library-check.sh deleted file mode 100755 index 0a296b03..00000000 --- a/.kokoro/client-library-check.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# 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. -# 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 - -if [[ $# -lt 1 ]]; -then - echo "Usage: $0 <repo-name>" - exit 1 -fi -REPO=$1 - -## 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}/.. - -# Make artifacts available for 'mvn validate' at the bottom -mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q - -# 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 -# java-bigquery -git clone "https://github.com/googleapis/${REPO}.git" --depth=1 -pushd ${REPO} - -# replace version -xmllint --shell <(cat pom.xml) << EOF -setns x=http://maven.apache.org/POM/4.0.0 -cd .//x:artifactId[text()="google-cloud-shared-dependencies"] -cd ../x:version -set ${VERSION} -save pom.xml -EOF - -# run dependencies script -.kokoro/dependencies.sh diff --git a/.kokoro/downstream-client-library-check.sh b/.kokoro/downstream-client-library-check.sh new file mode 100755 index 00000000..b17b020b --- /dev/null +++ b/.kokoro/downstream-client-library-check.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# Copyright 2022 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. + +set -eo pipefail +# Display commands being run. +set -x + +CLIENT_LIBRARY=$1 +## 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}"/.. + +# Make java core library artifacts available for 'mvn install' at the bottom +mvn verify install -B -V -ntp -fae \ +-DskipTests=true \ +-Dmaven.javadoc.skip=true \ +-Dgcloud.download.skip=true \ +-Denforcer.skip=true + +# Namespace (xmlns) prevents xmllint from specifying tag names in XPath +SHARED_DEPS_VERSION=$(sed -e 's/xmlns=".*"//' pom.xml | xmllint --xpath '/project/version/text()' -) + +if [ -z "${SHARED_DEPS_VERSION}" ]; then + echo "Version is not found in ${SHARED_DEPS_VERSION_POM}" + exit 1 +fi + +# Check this BOM against java client libraries +git clone "https://github.com/googleapis/java-${CLIENT_LIBRARY}.git" --depth=1 +pushd java-"${CLIENT_LIBRARY}" + +if [[ "$CLIENT_LIBRARY" == "bigtable" ]]; then + pushd google-cloud-bigtable-deps-bom +fi + +# replace version +xmllint --shell pom.xml << EOF +setns x=http://maven.apache.org/POM/4.0.0 +cd .//x:artifactId[text()="google-cloud-shared-dependencies"] +cd ../x:version +set ${SHARED_DEPS_VERSION} +save pom.xml +EOF + +if [[ $CLIENT_LIBRARY == "bigtable" ]]; then + popd +fi + +mvn verify install -B -V -ntp -fae \ +-Dmaven.javadoc.skip=true \ +-Dgcloud.download.skip=true \ +-Denforcer.skip=true diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg new file mode 100644 index 00000000..58049cc3 --- /dev/null +++ b/.kokoro/nightly/java11-integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/java11014" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 5320b813..c6534f65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [2.8.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.7.0...v2.8.0) (2022-03-02) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.33.2 ([#602](https://github.com/googleapis/java-shared-dependencies/issues/602)) ([85b132f](https://github.com/googleapis/java-shared-dependencies/commit/85b132f5830772646025b6a9fbbb970a941b86b5)) +* update dependency com.google.api:api-common to v2.1.4 ([#605](https://github.com/googleapis/java-shared-dependencies/issues/605)) ([ca7d49a](https://github.com/googleapis/java-shared-dependencies/commit/ca7d49aee26b6d90abd2afd61c20861d2307fe9c)) +* update dependency com.google.auth:google-auth-library-bom to v1.5.3 ([#614](https://github.com/googleapis/java-shared-dependencies/issues/614)) ([e6413f3](https://github.com/googleapis/java-shared-dependencies/commit/e6413f3b1be78473ace7085c344eda2d78cdf01a)) +* update dependency com.google.cloud:google-cloud-core to v2.5.6 ([#621](https://github.com/googleapis/java-shared-dependencies/issues/621)) ([3d5669f](https://github.com/googleapis/java-shared-dependencies/commit/3d5669f215689dd2df71200ffe37d5a9d385cda8)) +* update dependency com.google.code.gson:gson to v2.9.0 ([#611](https://github.com/googleapis/java-shared-dependencies/issues/611)) ([f59c28d](https://github.com/googleapis/java-shared-dependencies/commit/f59c28d8cd30ada1237f7722135ba148dce6315e)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.4 ([#608](https://github.com/googleapis/java-shared-dependencies/issues/608)) ([f9a4f23](https://github.com/googleapis/java-shared-dependencies/commit/f9a4f23d3a32148ac59e53eaae6558ccbceca12c)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.1 ([#606](https://github.com/googleapis/java-shared-dependencies/issues/606)) ([3882494](https://github.com/googleapis/java-shared-dependencies/commit/3882494770d48fcc02ed19088aa06612a8e440eb)) +* update dependency com.google.protobuf:protobuf-bom to v3.19.4 ([#593](https://github.com/googleapis/java-shared-dependencies/issues/593)) ([1e155bf](https://github.com/googleapis/java-shared-dependencies/commit/1e155bfc957bbb7e25d2e0994cdecaa81843bdc5)) +* update dependency io.grpc:grpc-bom to v1.44.1 ([#613](https://github.com/googleapis/java-shared-dependencies/issues/613)) ([3038a2c](https://github.com/googleapis/java-shared-dependencies/commit/3038a2c86cd20c91b65f2d7926eeb739147a68db)) +* update dependency junit:junit to v4.13.2 ([#607](https://github.com/googleapis/java-shared-dependencies/issues/607)) ([987e617](https://github.com/googleapis/java-shared-dependencies/commit/987e61796c7a093e005fe8832cf39275c391b2c1)) +* update dependency org.checkerframework:checker-qual to v3.21.3 ([#596](https://github.com/googleapis/java-shared-dependencies/issues/596)) ([ac5083c](https://github.com/googleapis/java-shared-dependencies/commit/ac5083cd010924dc128f041c2cdbab20166a6bf0)) +* update gax.version to v2.12.2 ([#592](https://github.com/googleapis/java-shared-dependencies/issues/592)) ([713ff8d](https://github.com/googleapis/java-shared-dependencies/commit/713ff8dd94f939c417524616bc47c771a3fbe0cf)) +* update google.common-protos.version to v2.7.4 ([#603](https://github.com/googleapis/java-shared-dependencies/issues/603)) ([bb9b4c7](https://github.com/googleapis/java-shared-dependencies/commit/bb9b4c7e39552cc73b3b9d4c826b26e8cb74459f)) +* update google.core.version ([#599](https://github.com/googleapis/java-shared-dependencies/issues/599)) ([327d0df](https://github.com/googleapis/java-shared-dependencies/commit/327d0df9b57203c0d4f426de0380770d3d7910d6)) +* update iam.version to v1.2.6 ([#598](https://github.com/googleapis/java-shared-dependencies/issues/598)) ([2801439](https://github.com/googleapis/java-shared-dependencies/commit/280143964c7c3b93a8d7f67215ba2cc74ffce761)) + ## [2.7.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.6.0...v2.7.0) (2022-01-28) diff --git a/dependency-convergence-check/README.md b/dependency-convergence-check/README.md new file mode 100644 index 00000000..d593196e --- /dev/null +++ b/dependency-convergence-check/README.md @@ -0,0 +1,6 @@ +# Dependency Convergence Check + +This project includes a test case for dependency convergence for some (not all) +artifacts in the Google Cloud Shared Dependencies BOM. + +This project is not meant to be used by end-users or published to Maven Central. diff --git a/dependency-convergence-check/pom.xml b/dependency-convergence-check/pom.xml new file mode 100644 index 00000000..b505e55e --- /dev/null +++ b/dependency-convergence-check/pom.xml @@ -0,0 +1,76 @@ +<?xml version='1.0' encoding='UTF-8'?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>com.google.cloud</groupId> + <artifactId>shared-dependencies-dependency-convergence-test</artifactId> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <name>Dependency convergence test for certain artifacts in Google Cloud Shared Dependencies</name> + <url>https://github.com/googleapis/java-shared-dependencies</url> + <description> + An dependency convergence test case for the shared dependencies BOM. A failure of this test case means + the shared dependencies BOM has outdated dependencies; there are newer version of artifacts + appearing in the dependency tree. + </description> + + <organization> + <name>Google LLC</name> + </organization> + + <scm> + <connection>scm:git:git@github.com:googleapis/java-shared-dependencies.git</connection> + <developerConnection>scm:git:git@github.com:googleapis/java-shared-dependencies.git</developerConnection> + <url>https://github.com/googleapis/java-shared-dependencies</url> + <tag>HEAD</tag> + </scm> + + <issueManagement> + <url>https://github.com/googleapis/java-shared-dependencies/issues</url> + <system>GitHub Issues</system> + </issueManagement> + + <licenses> + <license> + <name>Apache-2.0</name> + <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> + </license> + </licenses> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>com.google.cloud</groupId> + <artifactId>google-cloud-shared-dependencies</artifactId> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>31.0.1-jre</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.google.cloud.tools</groupId> + <artifactId>dependencies</artifactId> + <version>1.5.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.13.2</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> diff --git a/dependency-convergence-check/src/test/java/com/google/cloud/DependencyConvergenceTest.java b/dependency-convergence-check/src/test/java/com/google/cloud/DependencyConvergenceTest.java new file mode 100644 index 00000000..65524383 --- /dev/null +++ b/dependency-convergence-check/src/test/java/com/google/cloud/DependencyConvergenceTest.java @@ -0,0 +1,111 @@ +/* + * Copyright 2022 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. + */ + +package com.google.cloud; + +import static org.junit.Assert.assertTrue; + +import com.google.cloud.tools.opensource.classpath.ClassPathBuilder; +import com.google.cloud.tools.opensource.classpath.ClassPathEntry; +import com.google.cloud.tools.opensource.classpath.ClassPathResult; +import com.google.cloud.tools.opensource.classpath.DependencyMediation; +import com.google.cloud.tools.opensource.dependencies.Bom; +import com.google.cloud.tools.opensource.dependencies.DependencyPath; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.aether.artifact.Artifact; +import org.junit.Test; + +/** + * Test to ensure that certain artifacts in the dependency tree of each entry of the shared + * dependencies BOM have the same version. + */ +public class DependencyConvergenceTest { + + @Test + public void testGrpcConvergence() throws Exception { + // There were cases where the gRPC version set in the shared dependencies BOM and the gRPC + // version declared in gax-grpc's dependency broke the build of downstream projects. Two + // artifacts were using version range to specify exact gRPC versions. + // https://github.com/googleapis/java-shared-dependencies/pull/595 + Bom bom = Bom.readBom(Paths.get("../pom.xml")); + assertConvergence( + bom, + "io.grpc", + "grpc-netty-shaded", + ImmutableSet.of( + // Because OpenCensus's gRPC version does not use version range notation, it does not + // break downstream build + "opencensus-exporter-trace-stackdriver", + "opencensus-exporter-stats-stackdriver", + // Because grpc-gcp's gRPC version does not use version range notation, it does not + // break downstream build + "grpc-gcp")); + } + + /** + * Asserts the artifact specified at {@code groupId} and {@code artifactId} have the same version + * across the dependency trees of the managed dependencies of {@code bom}. + * + * <p>Use {@code excludingArtifactIds} to ignore certain artifacts. + */ + private void assertConvergence( + Bom bom, String groupId, String artifactId, Set<String> excludingArtifactIds) + throws Exception { + ImmutableList<Artifact> managedDependencies = bom.getManagedDependencies(); + + Set<DependencyPath> foundPaths = new HashSet<>(); + Set<String> foundVersions = new HashSet<>(); + for (Artifact managedDependency : managedDependencies) { + if (excludingArtifactIds.contains(managedDependency.getArtifactId())) { + continue; + } + + ClassPathBuilder classPathBuilder = new ClassPathBuilder(); + ClassPathResult result = + classPathBuilder.resolve( + ImmutableList.of(managedDependency), false, DependencyMediation.MAVEN); + ImmutableList<ClassPathEntry> classPath = result.getClassPath(); + for (ClassPathEntry entry : classPath) { + Artifact artifact = entry.getArtifact(); + if (artifactId.equals(artifact.getArtifactId()) && groupId.equals(artifact.getGroupId())) { + ImmutableList<DependencyPath> dependencyPaths = result.getDependencyPaths(entry); + foundPaths.add(dependencyPaths.get(0)); + foundVersions.add(artifact.getVersion()); + } + } + } + + assertTrue( + "There should be at least one version in the graph but empty; " + + "please check the assertion is using correct groupID and artifactID.", + foundVersions.size() >= 1); + + // Duplicate versions found in the dependency trees + assertTrue( + "The version for " + + groupId + + ":" + + artifactId + + " should be one but there are multiple of them: " + + Joiner.on(", ").join(foundPaths), + foundVersions.size() <= 1); + } +} diff --git a/first-party-dependencies/pom.xml b/first-party-dependencies/pom.xml index 1ba2b30d..2e1d52d6 100644 --- a/first-party-dependencies/pom.xml +++ b/first-party-dependencies/pom.xml @@ -6,7 +6,7 @@ <groupId>com.google.cloud</groupId> <artifactId>first-party-dependencies</artifactId> <packaging>pom</packaging> - <version>2.7.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> <name>Google Cloud First-party Shared Dependencies</name> <url>https://github.com/googleapis/java-shared-dependencies</url> <description> @@ -16,7 +16,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-shared-config</artifactId> - <version>1.2.6</version> + <version>1.2.7</version> </parent> <organization> @@ -55,19 +55,19 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <site.installationModule>${project.artifactId}</site.installationModule> - <grpc.version>1.44.0</grpc.version> - <gax.version>2.11.0</gax.version> + <grpc.version>1.44.1</grpc.version> + <gax.version>2.12.2</gax.version> <grpc-gcp.version>1.1.0</grpc-gcp.version> <guava.version>31.0.1-jre</guava.version> - <protobuf.version>3.19.3</protobuf.version> - <google.api-common.version>2.1.3</google.api-common.version> - <google.common-protos.version>2.7.2</google.common-protos.version> - <google.core.version>2.4.0</google.core.version> - <google.auth.version>1.4.0</google.auth.version> - <google.http-client.version>1.41.2</google.http-client.version> - <google.oauth-client.version>1.33.0</google.oauth-client.version> - <google.api-client.version>1.33.1</google.api-client.version> - <iam.version>1.2.1</iam.version> + <protobuf.version>3.19.4</protobuf.version> + <google.api-common.version>2.1.4</google.api-common.version> + <google.common-protos.version>2.7.4</google.common-protos.version> + <google.core.version>2.5.6</google.core.version> + <google.auth.version>1.5.3</google.auth.version> + <google.http-client.version>1.41.4</google.http-client.version> + <google.oauth-client.version>1.33.1</google.oauth-client.version> + <google.api-client.version>1.33.2</google.api-client.version> + <iam.version>1.2.6</iam.version> </properties> <dependencyManagement> diff --git a/pom.xml b/pom.xml index ca53517e..48c6ab58 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ <groupId>com.google.cloud</groupId> <artifactId>google-cloud-shared-dependencies</artifactId> <packaging>pom</packaging> - <version>2.7.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> <modules> <module>first-party-dependencies</module> <module>third-party-dependencies</module> @@ -18,7 +18,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-shared-config</artifactId> - <version>1.2.6</version> + <version>1.2.7</version> </parent> <organization> @@ -65,14 +65,14 @@ <dependency> <groupId>com.google.cloud</groupId> <artifactId>first-party-dependencies</artifactId> - <version>2.7.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>com.google.cloud</groupId> <artifactId>third-party-dependencies</artifactId> - <version>2.7.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> <type>pom</type> <scope>import</scope> </dependency> diff --git a/third-party-dependencies/pom.xml b/third-party-dependencies/pom.xml index 7f498f96..ae2743dc 100644 --- a/third-party-dependencies/pom.xml +++ b/third-party-dependencies/pom.xml @@ -6,7 +6,7 @@ <groupId>com.google.cloud</groupId> <artifactId>third-party-dependencies</artifactId> <packaging>pom</packaging> - <version>2.7.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> <name>Google Cloud Third-party Shared Dependencies</name> <url>https://github.com/googleapis/java-shared-dependencies</url> <description> @@ -16,7 +16,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-shared-config</artifactId> - <version>1.2.6</version> + <version>1.2.7</version> </parent> <organization> @@ -57,10 +57,10 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <site.installationModule>${project.artifactId}</site.installationModule> - <gson.version>2.8.9</gson.version> + <gson.version>2.9.0</gson.version> <threeten.version>1.5.2</threeten.version> <javax.annotations.version>1.3.2</javax.annotations.version> - <animal-sniffer.version>1.20</animal-sniffer.version> + <animal-sniffer.version>1.21</animal-sniffer.version> <opencensus.version>0.31.0</opencensus.version> <findbugs.version>3.0.2</findbugs.version> <errorprone.version>2.11.0</errorprone.version> @@ -69,7 +69,7 @@ <httpcomponents.httpcore.version>4.4.15</httpcomponents.httpcore.version> <httpcomponents.httpclient.version>4.5.13</httpcomponents.httpclient.version> <!-- ensure checker-qual version matches what Guava uses --> - <checker-qual.version>3.21.1</checker-qual.version> + <checker-qual.version>3.21.3</checker-qual.version> </properties> <dependencyManagement> diff --git a/upper-bound-check/pom.xml b/upper-bound-check/pom.xml index 2909c8b4..d090fdf3 100644 --- a/upper-bound-check/pom.xml +++ b/upper-bound-check/pom.xml @@ -4,7 +4,7 @@ <groupId>com.google.cloud</groupId> <artifactId>shared-dependencies-upper-bound-test</artifactId> <packaging>pom</packaging> - <version>2.7.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> <name>Upper bound test for Google Cloud Shared Dependencies</name> <url>https://github.com/googleapis/java-shared-dependencies</url> <description> @@ -17,7 +17,7 @@ <groupId>com.google.cloud</groupId> <!-- The shared config has RequireUpperBoundDeps enforcer rule --> <artifactId>google-cloud-shared-config</artifactId> - <version>1.2.6</version> + <version>1.2.7</version> </parent> <organization> @@ -53,7 +53,7 @@ <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-shared-dependencies</artifactId> - <version>2.7.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> + <version>2.8.0</version><!-- {x-version-update:google-cloud-shared-dependencies:current} --> <type>pom</type> <scope>import</scope> </dependency> diff --git a/versions.txt b/versions.txt index 81bf3ab8..da7da057 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-shared-dependencies:2.7.0:2.7.0 \ No newline at end of file +google-cloud-shared-dependencies:2.8.0:2.8.0 \ No newline at end of file