diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml index 0eee4025d3..1cb1f4b861 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.12.0' + _JAVA_SHARED_CONFIG_VERSION: '1.12.2' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml index d6d0671483..00c78a69a2 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.12.0' + _JAVA_SHARED_CONFIG_VERSION: '1.12.2' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml index a101db5564..18f9f47c5b 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -14,8 +14,8 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.40.0' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.12.0' + _SHARED_DEPENDENCIES_VERSION: '3.41.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.12.2' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml index 9e1625da88..9bf8199f04 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.12.0' + _JAVA_SHARED_CONFIG_VERSION: '1.12.2' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml index c8945500b1..7e1625ea78 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.12.0' + _JAVA_SHARED_CONFIG_VERSION: '1.12.2' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml index bd0ad1ff85..c31d6054e3 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -14,8 +14,8 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.40.0' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.12.0' + _SHARED_DEPENDENCIES_VERSION: '3.41.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.12.2' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml index 8904bf1318..e834d07f41 100644 --- a/.cloudbuild/graalvm/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -14,8 +14,8 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.40.0' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.12.0' + _SHARED_DEPENDENCIES_VERSION: '3.41.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.12.2' steps: # GraalVM A build - name: gcr.io/cloud-builders/docker diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml index 95ee665f3e..ae318d890e 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _IMAGE_NAME: "us-docker.pkg.dev/java-hermetic-build-prod/private-resources/java-library-generation" - _GAPIC_GENERATOR_JAVA_VERSION: '2.50.0' # {x-version-update:gapic-generator-java:current} + _GAPIC_GENERATOR_JAVA_VERSION: '2.51.0' # {x-version-update:gapic-generator-java:current} _SHA_IMAGE_ID: "${_IMAGE_NAME}:${COMMIT_SHA}" _LATEST_IMAGE_ID: "${_IMAGE_NAME}:latest" _VERSIONED_IMAGE_ID: "${_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}" diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml index db56519519..8a8a26a2dd 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _IMAGE_NAME: "gcr.io/cloud-devrel-public-resources/java-library-generation" - _GAPIC_GENERATOR_JAVA_VERSION: '2.50.0' # {x-version-update:gapic-generator-java:current} + _GAPIC_GENERATOR_JAVA_VERSION: '2.51.0' # {x-version-update:gapic-generator-java:current} _SHA_IMAGE_ID: "${_IMAGE_NAME}:${COMMIT_SHA}" _LATEST_IMAGE_ID: "${_IMAGE_NAME}:latest" _VERSIONED_IMAGE_ID: "${_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}" diff --git a/.cloudbuild/library_generation/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile index 6f7b4ef1a4..d7c85fc5ca 100644 --- a/.cloudbuild/library_generation/library_generation.Dockerfile +++ b/.cloudbuild/library_generation/library_generation.Dockerfile @@ -15,25 +15,23 @@ # install gapic-generator-java in a separate layer so we don't overload the image # with the transferred source code and jars -# 3.9.9-eclipse-temurin-11-alpine -FROM docker.io/library/maven@sha256:006d25558f9d5244ed55b5d2bd8eaf34d883e447d0c4b940e67b9f44d21167bf AS ggj-build +FROM docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine@sha256:3bab9f2cd4fa8704445bf01444e8e5e0f1ab819a41616069872a898b432a7309 AS ggj-build WORKDIR /sdk-platform-java COPY . . # {x-version-update-start:gapic-generator-java:current} -ENV DOCKER_GAPIC_GENERATOR_VERSION="2.50.0" +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.51.0" # {x-version-update-end} RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \ "./gapic-generator-java.jar" -# alpine:3.20.3 -FROM docker.io/library/alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d as glibc-compat +FROM docker.io/library/alpine:3.21.0@sha256:21dc6063fd678b478f57c0e13f47560d0ea4eeba26dfc947b2a4f81f686b9f45 as glibc-compat RUN apk add git sudo # This SHA is the latest known-to-work version of this binary compatibility tool -ARG GLIB_MUS_SHA=7717dd4dc26377dd9cedcc92b72ebf35f9e68a2d +ARG GLIB_MUS_SHA=e94aca542e3ab08b42aa0b0d6e72478b935bb8e8 WORKDIR /home # Install compatibility layer to run glibc-based programs (such as the @@ -49,14 +47,11 @@ RUN git checkout "${GLIB_MUS_SHA}" RUN chmod a+x compile-x86_64-alpine-linux.sh RUN sh compile-x86_64-alpine-linux.sh -# python:3.12.7-alpine3.20 -FROM docker.io/library/python@sha256:38e179a0f0436c97ecc76bcd378d7293ab3ee79e4b8c440fdc7113670cb6e204 as final +FROM docker.io/library/python:3.13.1-alpine3.20@sha256:804ad02b9ba67ea1f8307eeb6407b121c6bd6bb19d3f182aae166821eb59d6a4 as final - - -ARG OWLBOT_CLI_COMMITTISH=38fe6f89a2339ee75c77739b31b371f601b01bb3 +ARG OWLBOT_CLI_COMMITTISH=ae0a72f2c1e71b60c8758a2f389673dbae1c6b81 ARG PROTOC_VERSION=25.5 -ARG GRPC_VERSION=1.68.1 +ARG GRPC_VERSION=1.69.0 ARG JAVA_FORMAT_VERSION=1.7 ENV HOME=/home ENV OS_ARCHITECTURE="linux-x86_64" @@ -80,6 +75,9 @@ COPY --from=glibc-compat /lib/libc.* /lib/ COPY --from=glibc-compat /usr/lib/libgcc* /usr/lib/ COPY --from=glibc-compat /usr/lib/libstdc* /usr/lib/ COPY --from=glibc-compat /usr/lib/libobstack* /usr/lib/ +COPY --from=glibc-compat /lib/libm.so.6 /usr/lib/ +COPY --from=glibc-compat /usr/lib/libucontext.so.1 /usr/lib/ + # copy source code COPY hermetic_build/common /src/common @@ -90,7 +88,7 @@ WORKDIR /protoc RUN source /src/library_generation/utils/utilities.sh \ && download_protoc "${PROTOC_VERSION}" "${OS_ARCHITECTURE}" # we indicate protoc is available in the container via env vars -ENV DOCKER_PROTOC_LOCATION=/protoc +ENV DOCKER_PROTOC_LOCATION=/protoc/bin ENV DOCKER_PROTOC_VERSION="${PROTOC_VERSION}" # install grpc @@ -98,9 +96,7 @@ WORKDIR /grpc RUN source /src/library_generation/utils/utilities.sh \ && download_grpc_plugin "${GRPC_VERSION}" "${OS_ARCHITECTURE}" # similar to protoc, we indicate grpc is available in the container via env vars -ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java-${GRPC_VERSION}-${OS_ARCHITECTURE}.exe" -ENV DOCKER_GRPC_VERSION="${GRPC_VERSION}" - +ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java.exe" # Here we transfer gapic-generator-java from the previous stage. # Note that the destination is a well-known location that will be assumed at runtime @@ -108,6 +104,7 @@ ENV DOCKER_GRPC_VERSION="${GRPC_VERSION}" # well as to avoid it making it overridable at runtime (via ENV). COPY --from=ggj-build "/sdk-platform-java/gapic-generator-java.jar" "${HOME}/.library_generation/gapic-generator-java.jar" RUN chmod 755 "${HOME}/.library_generation/gapic-generator-java.jar" +ENV GAPIC_GENERATOR_LOCATION="${HOME}/.library_generation/gapic-generator-java.jar" RUN python -m pip install --upgrade pip @@ -126,11 +123,13 @@ RUN git checkout "${OWLBOT_CLI_COMMITTISH}" RUN npm i && npm run compile && npm link RUN owl-bot copy-code --version RUN chmod o+rx $(which owl-bot) +RUN apk del -r npm && apk cache clean # download the Java formatter ADD https://maven-central.storage-download.googleapis.com/maven2/com/google/googlejavaformat/google-java-format/${JAVA_FORMAT_VERSION}/google-java-format-${JAVA_FORMAT_VERSION}-all-deps.jar \ "${HOME}"/.library_generation/google-java-format.jar RUN chmod 755 "${HOME}"/.library_generation/google-java-format.jar +ENV JAVA_FORMATTER_LOCATION="${HOME}/.library_generation/google-java-format.jar" # allow users to access the script folders RUN chmod -R o+rx /src diff --git a/.github/scripts/update_googleapis_commit.sh b/.github/scripts/update_googleapis_commit.sh index b950be9af4..2acad04855 100644 --- a/.github/scripts/update_googleapis_commit.sh +++ b/.github/scripts/update_googleapis_commit.sh @@ -54,18 +54,26 @@ fi current_branch="generate-libraries-${base_branch}" title="chore: update googleapis commit at $(date)" -# try to find a open pull request associated with the branch +git checkout "${base_branch}" +# Try to find a open pull request associated with the branch pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") -# create a branch if there's no open pull request associated with the +# Create a branch if there's no open pull request associated with the # branch; otherwise checkout the pull request. if [ -z "${pr_num}" ]; then git checkout -b "${current_branch}" + # Push the current branch to remote so that we can + # compare the commits later. + git push -u origin "${current_branch}" else gh pr checkout "${pr_num}" fi +# Only allow fast-forward merging; exit with non-zero result if there's merging +# conflict. +git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" + mkdir tmp-googleapis -# use partial clone because only commit history is needed. +# Use partial clone because only commit history is needed. git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis pushd tmp-googleapis git pull @@ -79,12 +87,25 @@ changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then echo "The latest googleapis commit is not changed." echo "Skip committing to the pull request." +else + git commit -m "${title}" +fi + +# There are potentially at most two commits: merge commit and change commit. +# We want to exit the script if no commit happens (otherwise this will be an +# infinite loop). +# `git cherry` is a way to find whether the local branch has commits that are +# not in the remote branch. +# If we find any such commit, push them to remote branch. +unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l) +if [[ "${unpushed_commit}" -eq 0 ]]; then + echo "No unpushed commits, exit" exit 0 fi -git commit -m "${title}" + if [ -z "${pr_num}" ]; then git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" - git fetch -q --unshallow remote_repo + git fetch -q remote_repo git push -f remote_repo "${current_branch}" gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" else diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cbe7bd9bd6..82cdfc44ea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -330,7 +330,7 @@ jobs: run: | mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip - name: Validate gapic-generator-java-bom - uses: googleapis/java-cloud-bom/tests/validate-bom@0cd97b7151b36465390bd5e31d017ec015a4bae9 + uses: googleapis/java-cloud-bom/tests/validate-bom@93740d54e9e5dc9b83972ab8209c239acb993f48 with: bom-path: gapic-generator-java-bom/pom.xml diff --git a/.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml b/.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml new file mode 100644 index 0000000000..8e8de19abb --- /dev/null +++ b/.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml @@ -0,0 +1,50 @@ +on: + pull_request: + # Runs on PRs targeting main, but will be filtered for Release PRs + branches: + - 'main' + workflow_dispatch: + inputs: + protobuf_runtime_versions: + description: 'Comma separated list of Protobuf-Java versions (i.e. "3.25.x","4.x.y")' + required: true + schedule: + - cron: '0 1 * * *' # Nightly at 1am + +name: Downstream Protobuf Compatibility Check Nightly +jobs: + downstream-protobuf-test: + # Checks if PR comes from Release-Please branch or if invoked from nightly job + if: github.head_ref == 'release-please--branches--main' || github.event_name == 'schedule' + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + repo: + - google-cloud-java + - java-bigtable + - java-bigquery + - java-bigquerystorage + - java-datastore + - java-firestore + - java-logging + - java-logging-logback + - java-pubsub + - java-pubsublite + - java-spanner-jdbc + - java-spanner + - java-storage + - java-storage-nio + # Default Protobuf-Java versions to use are specified here. Without this, the nightly workflow won't know + # which values to use and would resolve to ''. + protobuf-version: ${{ fromJSON(format('[{0}]', inputs.protobuf_runtime_versions || '"3.25.5","4.28.3"')) }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - name: Print Protobuf-Java testing version + run: echo "Testing with Protobuf-Java v${{ matrix.protobuf-version }}" + - name: Perform downstream source compatibility testing + run: REPOS_UNDER_TEST="${{ matrix.repo }}" PROTOBUF_RUNTIME_VERSION="${{ matrix.protobuf-version}}" ./.kokoro/nightly/downstream-protobuf-source-compatibility.sh diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index ea29373da3..4eac9faded 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -51,7 +51,7 @@ jobs: run: | GENERATOR_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl gapic-generator-java) echo "GENERATOR_VERSION=${GENERATOR_VERSION}" >> "$GITHUB_ENV" - docker build \ + DOCKER_BUILDKIT=1 docker build \ -f .cloudbuild/library_generation/library_generation.Dockerfile \ -t gcr.io/cloud-devrel-public-resources/java-library-generation:"${GENERATOR_VERSION}" \ . diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 12e239ae8c..90140d9f9e 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -11,20 +11,20 @@ jobs: strategy: fail-fast: false matrix: - os: [ macOS-12, ubuntu-22.04, windows-2022 ] + os: [ macOS-13, ubuntu-22.04, windows-2022 ] java: [ 11, 17 ] runs-on: ${{ matrix.os }} steps: - run: git config --global core.longpaths true - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: temurin cache: maven - run: mvn -version - name: Install - run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -T 1C + run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip - name: Create issue if previous step fails if: ${{ failure() }} env: @@ -37,28 +37,28 @@ jobs: strategy: fail-fast: false matrix: - os: [ macOS-12, ubuntu-22.04, windows-2022 ] + os: [ macOS-13, ubuntu-22.04, windows-2022 ] runs-on: ${{ matrix.os }} steps: - run: git config --global core.longpaths true - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: java-version: 11 distribution: temurin cache: maven - run: mvn -version - name: Install with Java 11 - run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -DskipTests -T 1C + run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -DskipTests - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: java-version: 8 distribution: temurin - run: mvn -version - name: Test with Java 8 # Direct goal invocation ("surefire:test") prevents recompiling tests - run: mvn surefire:test --errors --batch-mode --no-transfer-progress -T 1C + run: mvn surefire:test --errors --batch-mode --no-transfer-progress - name: Create issue if previous step fails if: ${{ failure() }} env: diff --git a/.github/workflows/shared_dependencies.yaml b/.github/workflows/shared_dependencies.yaml index 047b647dc9..10ba688b21 100644 --- a/.github/workflows/shared_dependencies.yaml +++ b/.github/workflows/shared_dependencies.yaml @@ -14,12 +14,10 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: + distribution: temurin java-version: 11 - run: java -version - name: Install maven modules diff --git a/.github/workflows/update_googleapis_commit.yaml b/.github/workflows/update_googleapis_commit.yaml index 2e64d5588b..5a5087e2a0 100644 --- a/.github/workflows/update_googleapis_commit.yaml +++ b/.github/workflows/update_googleapis_commit.yaml @@ -28,6 +28,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - name: Update googleapis commit to latest shell: bash diff --git a/.github/workflows/verify_library_generation.yaml b/.github/workflows/verify_library_generation.yaml index c1bb381984..fc6759f50e 100644 --- a/.github/workflows/verify_library_generation.yaml +++ b/.github/workflows/verify_library_generation.yaml @@ -27,7 +27,7 @@ jobs: git checkout -b "${head_ref}" fork/${head_ref} changed_directories="$(git diff --name-only "fork/${head_ref}" "origin/${base_ref}")" fi - if [[ ${changed_directories} =~ "hermetic_build/" ]]; then + if [[ ${changed_directories} =~ "hermetic_build/" ]] || [[ ${changed_directories} =~ ".cloudbuild/library_generation/" ]]; then echo "should_run=true" >> $GITHUB_OUTPUT else echo "should_run=false" >> $GITHUB_OUTPUT diff --git a/.kokoro/nightly/downstream-protobuf-source-compatibility.sh b/.kokoro/nightly/downstream-protobuf-source-compatibility.sh new file mode 100755 index 0000000000..c7caeb724c --- /dev/null +++ b/.kokoro/nightly/downstream-protobuf-source-compatibility.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2023 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 + +# Comma-delimited list of repos to test with the local java-shared-dependencies +if [ -z "${REPOS_UNDER_TEST}" ]; then + echo "REPOS_UNDER_TEST must be set to run downstream-protobuf-source-compatibility.sh" + echo "Expects a comma-delimited list: i.e REPOS_UNDER_TEST=\"java-bigtable,java-bigquery\"" + exit 1 +fi + +# Version of Protobuf-Java runtime to compile with +if [ -z "${PROTOBUF_RUNTIME_VERSION}" ]; then + echo "PROTOBUF_RUNTIME_VERSION must be set to run downstream-protobuf-source-compatibility.sh" + echo "Expects a single Protobuf-Java runtime version i.e. PROTOBUF_RUNTIME_VERSION=\"4.28.3\"" + exit 1 +fi + +for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma + # Perform source-compatibility testing on main (latest changes) + git clone "https://github.com/googleapis/$repo.git" --depth=1 + pushd "$repo" + + # Compile the Handwritten Library with the Protobuf-Java version to test source compatibility + # Run unit tests to help check for any behavior differences (dependant on coverage) + mvn clean test -B -V -ntp \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \ + -T 1C + popd +done \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 11ee7212d7..318899b64d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.50.0" + ".": "2.51.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bedb3aa241..776fa766f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,61 @@ # Changelog +## [2.51.0](https://github.com/googleapis/sdk-platform-java/compare/v2.50.0...v2.51.0) (2024-12-12) + + +### Features + +* [iam] add ResourcePolicyMember to google/iam/v1 ([b8e2859](https://github.com/googleapis/sdk-platform-java/commit/b8e28597774d778fc6b79354edbfacbbd76015af)) + + +### Bug Fixes + +* [#3381](https://github.com/googleapis/sdk-platform-java/issues/3381) ([75dcb96](https://github.com/googleapis/sdk-platform-java/commit/75dcb96b799990bec9998b420463aa782fb65661)) +* graalvm missing build time class when using protobuf 4.x ([#3438](https://github.com/googleapis/sdk-platform-java/issues/3438)) ([f0236cf](https://github.com/googleapis/sdk-platform-java/commit/f0236cfc102cf7ce06e1f733a4f40a50133d6b24)) +* return all library names if repo-level parameter changes ([#3379](https://github.com/googleapis/sdk-platform-java/issues/3379)) ([75dcb96](https://github.com/googleapis/sdk-platform-java/commit/75dcb96b799990bec9998b420463aa782fb65661)), closes [#3381](https://github.com/googleapis/sdk-platform-java/issues/3381) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.18.2 ([#3422](https://github.com/googleapis/sdk-platform-java/issues/3422)) ([fdc3a54](https://github.com/googleapis/sdk-platform-java/commit/fdc3a5427836fcc5e9052fed736c178d7e7bdf18)) +* update dependency com.google.api-client:google-api-client-bom to v2.7.1 ([#3450](https://github.com/googleapis/sdk-platform-java/issues/3450)) ([35f1310](https://github.com/googleapis/sdk-platform-java/commit/35f1310cde638c89cf6680282e82f442821afe65)) +* update dependency com.google.auth:google-auth-library-oauth2-http to v1.30.0 ([#3428](https://github.com/googleapis/sdk-platform-java/issues/3428)) ([78cbff1](https://github.com/googleapis/sdk-platform-java/commit/78cbff1af55fb804400df5307b0df464936e0bae)) +* update dependency com.google.errorprone:error_prone_annotations to v2.36.0 ([#3425](https://github.com/googleapis/sdk-platform-java/issues/3425)) ([52dcc0d](https://github.com/googleapis/sdk-platform-java/commit/52dcc0d7aa525a18329a56fefe8a3b97efd6b1d3)) +* update dependency com.google.errorprone:error_prone_annotations to v2.36.0 ([#3426](https://github.com/googleapis/sdk-platform-java/issues/3426)) ([77dd85d](https://github.com/googleapis/sdk-platform-java/commit/77dd85d5cc7ad39d5dbbb5bab3bb17863fc8b9c9)) +* update dependency dev.cel:cel to v0.8.0 ([#3429](https://github.com/googleapis/sdk-platform-java/issues/3429)) ([79cde20](https://github.com/googleapis/sdk-platform-java/commit/79cde2028c2ec307001c6bedd4310a78d04f379e)) +* update dependency io.github.java-diff-utils:java-diff-utils to v4.15 ([#3430](https://github.com/googleapis/sdk-platform-java/issues/3430)) ([91fd5cb](https://github.com/googleapis/sdk-platform-java/commit/91fd5cb4aaf6ca02a0f73d664c0dbe283d13e989)) +* update dependency net.bytebuddy:byte-buddy to v1.15.10 ([#3298](https://github.com/googleapis/sdk-platform-java/issues/3298)) ([7b503de](https://github.com/googleapis/sdk-platform-java/commit/7b503dead0c8142630a5b05142e1e8a07f7300c3)) +* update dependency org.checkerframework:checker-qual to v3.48.3 ([#3278](https://github.com/googleapis/sdk-platform-java/issues/3278)) ([c5fd1b4](https://github.com/googleapis/sdk-platform-java/commit/c5fd1b4e201de5d042c3e0999ab74ad2a1bd6c17)) +* update dependency org.easymock:easymock to v5.5.0 ([#3431](https://github.com/googleapis/sdk-platform-java/issues/3431)) ([3c22f5e](https://github.com/googleapis/sdk-platform-java/commit/3c22f5e8dc73d867689df3f63c97580c908dfeb5)) +* update dependency packaging to v24.2 ([#3432](https://github.com/googleapis/sdk-platform-java/issues/3432)) ([c1e7c81](https://github.com/googleapis/sdk-platform-java/commit/c1e7c81b68e46a6a7e350cc3d857df48254e337b)) +* update docker.io/library/alpine docker tag to v3.21.0 ([#3433](https://github.com/googleapis/sdk-platform-java/issues/3433)) ([c8318c2](https://github.com/googleapis/sdk-platform-java/commit/c8318c243857242f155d9a78b3a4ff24e31a1b7e)) +* update docker.io/library/alpine:3.20.3 docker digest to 1e42bbe ([#3417](https://github.com/googleapis/sdk-platform-java/issues/3417)) ([0f4ef19](https://github.com/googleapis/sdk-platform-java/commit/0f4ef19b9fa30155fa7630b7b5b95495da646043)) +* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to 3bab9f2 ([#3447](https://github.com/googleapis/sdk-platform-java/issues/3447)) ([ccf7eac](https://github.com/googleapis/sdk-platform-java/commit/ccf7eacf19c70e1063fc4e15d6340bc0d6c6dac0)) +* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to cdfb386 ([#3418](https://github.com/googleapis/sdk-platform-java/issues/3418)) ([2559ff8](https://github.com/googleapis/sdk-platform-java/commit/2559ff8998f1cc8f1cb279a02520ad9ee7bac776)) +* update docker.io/library/python docker tag to v3.13.1 ([#3434](https://github.com/googleapis/sdk-platform-java/issues/3434)) ([feefd27](https://github.com/googleapis/sdk-platform-java/commit/feefd2788ac7447f2778bb971f5d752d93ef3b0e)) +* update google api dependencies ([#3435](https://github.com/googleapis/sdk-platform-java/issues/3435)) ([3a1e8f2](https://github.com/googleapis/sdk-platform-java/commit/3a1e8f214a28b514956a6f4ce3857fe89856c4a0)) +* update google auth library dependencies to v1.30.1 ([#3453](https://github.com/googleapis/sdk-platform-java/issues/3453)) ([d7b7dd9](https://github.com/googleapis/sdk-platform-java/commit/d7b7dd98314de957b048c9ddb70ad3089f39fc63)) +* update google http client dependencies to v1.45.2 ([#3394](https://github.com/googleapis/sdk-platform-java/issues/3394)) ([f8ee892](https://github.com/googleapis/sdk-platform-java/commit/f8ee89227ac6b095b186db8c81d067aa5af9bc66)) +* update google http client dependencies to v1.45.3 ([#3454](https://github.com/googleapis/sdk-platform-java/issues/3454)) ([a112559](https://github.com/googleapis/sdk-platform-java/commit/a112559ef0ac4f70d53dcc7ba1c5eaa73b6cc3c1)) +* update google.cloud.opentelemetry.version to v0.33.0 ([#3436](https://github.com/googleapis/sdk-platform-java/issues/3436)) ([e519626](https://github.com/googleapis/sdk-platform-java/commit/e519626e2dc538ff8291f94b699e54b37d50d6a4)) +* update googleapis/java-cloud-bom digest to 93740d5 ([#3280](https://github.com/googleapis/sdk-platform-java/issues/3280)) ([f987db5](https://github.com/googleapis/sdk-platform-java/commit/f987db5dc8bc0f5f8bd7805a2596e13055343cc0)) +* update grpc dependencies to v1.68.2 ([#3420](https://github.com/googleapis/sdk-platform-java/issues/3420)) ([6d0a169](https://github.com/googleapis/sdk-platform-java/commit/6d0a169065b99c00e88592c1caa608447e0fc4e8)) +* update grpc dependencies to v1.69.0 ([#3451](https://github.com/googleapis/sdk-platform-java/issues/3451)) ([0effb37](https://github.com/googleapis/sdk-platform-java/commit/0effb371f88fd7c911861ab7aca7d67c52cc4ad0)) +* update junit5 monorepo to v5.11.3 ([#3310](https://github.com/googleapis/sdk-platform-java/issues/3310)) ([4e33f2b](https://github.com/googleapis/sdk-platform-java/commit/4e33f2b8ff9e169e96f59683a21bb08dc086c110)) +* update netty dependencies ([#3423](https://github.com/googleapis/sdk-platform-java/issues/3423)) ([22ea7b5](https://github.com/googleapis/sdk-platform-java/commit/22ea7b533241660aba124062b0a5d6a5cbfcef7b)) +* update opentelemetry-java monorepo to v1.44.1 ([#3437](https://github.com/googleapis/sdk-platform-java/issues/3437)) ([66b85da](https://github.com/googleapis/sdk-platform-java/commit/66b85da86faef954274d4208f074ca52ad4aebc4)) +* update opentelemetry-java monorepo to v1.45.0 ([#3439](https://github.com/googleapis/sdk-platform-java/issues/3439)) ([d29475a](https://github.com/googleapis/sdk-platform-java/commit/d29475a7ad89e96026f3c710e331976902a161b7)) +* update repo-automation-bots digest to 6662ddc ([#3421](https://github.com/googleapis/sdk-platform-java/issues/3421)) ([dec5de0](https://github.com/googleapis/sdk-platform-java/commit/dec5de0e628ad9be6bd5fb8d768d50918c2edab7)) +* update repo-automation-bots digest to 8230b4e ([#3448](https://github.com/googleapis/sdk-platform-java/issues/3448)) ([e53199b](https://github.com/googleapis/sdk-platform-java/commit/e53199be9632c2f8cc6a94ba25f3aa3567d63ffa)) +* update repo-automation-bots digest to ae0a72f ([#3452](https://github.com/googleapis/sdk-platform-java/issues/3452)) ([331bacf](https://github.com/googleapis/sdk-platform-java/commit/331bacf1b222d9282e116c4b829140407d9b9127)) +* update repo-automation-bots digest to f3fbbab ([#3419](https://github.com/googleapis/sdk-platform-java/issues/3419)) ([343a029](https://github.com/googleapis/sdk-platform-java/commit/343a029a75e7e325f069e0e2aebb131d79a26901)) + + +### Documentation + +* explain default generation config in `README.md` ([#3388](https://github.com/googleapis/sdk-platform-java/issues/3388)) ([2ac86de](https://github.com/googleapis/sdk-platform-java/commit/2ac86de1baf263e92cb442b970a86350d54bbca5)) +* hermetic build README syntax fix ([#3391](https://github.com/googleapis/sdk-platform-java/issues/3391)) ([cf32e72](https://github.com/googleapis/sdk-platform-java/commit/cf32e72d83c06d1d36e1eea01afc37bee5766455)) + ## [2.50.0](https://github.com/googleapis/sdk-platform-java/compare/v2.49.0...v2.50.0) (2024-11-14) diff --git a/WORKSPACE b/WORKSPACE index 71e2af2758..da72d75ae2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -58,13 +58,14 @@ load("@rules_jvm_external//:defs.bzl", "maven_install") load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS") load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS") -_gapic_generator_java_version = "2.50.0" # {x-version-update:gapic-generator-java:current} +_gapic_generator_java_version = "2.51.0" # {x-version-update:gapic-generator-java:current} maven_install( artifacts = [ "com.google.api:gapic-generator-java:" + _gapic_generator_java_version, ] + PROTOBUF_MAVEN_ARTIFACTS + IO_GRPC_GRPC_JAVA_ARTIFACTS, fail_on_missing_checksum = False, + override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS, repositories = [ "m2Local", "https://repo.maven.apache.org/maven2/", diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index 07f447df37..358584c3bd 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,14 +5,14 @@ com.google.api api-common jar - 2.41.0 + 2.42.0 API Common Common utilities for Google APIs in Java com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 65269d7aa0..24a33a0a17 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -31,22 +31,22 @@ com.google.api gax - 2.58.0 + 2.59.0 com.google.api gax-grpc - 2.58.0 + 2.59.0 com.google.api gax-httpjson - 2.58.0 + 2.59.0 com.google.api api-common - 2.41.0 + 2.42.0 diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index 5d70b96524..6c9c3b0c63 100644 --- a/gapic-generator-java-bom/pom.xml +++ b/gapic-generator-java-bom/pom.xml @@ -4,7 +4,7 @@ com.google.api gapic-generator-java-bom pom - 2.50.0 + 2.51.0 GAPIC Generator Java BOM BOM for the libraries in gapic-generator-java repository. Users should not @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent @@ -75,61 +75,61 @@ com.google.api api-common - 2.41.0 + 2.42.0 com.google.api gax-bom - 2.58.0 + 2.59.0 pom import com.google.api gapic-generator-java - 2.50.0 + 2.51.0 com.google.api.grpc grpc-google-common-protos - 2.49.0 + 2.50.0 com.google.api.grpc proto-google-common-protos - 2.49.0 + 2.50.0 com.google.api.grpc proto-google-iam-v1 - 1.44.0 + 1.45.0 com.google.api.grpc proto-google-iam-v2 - 1.44.0 + 1.45.0 com.google.api.grpc proto-google-iam-v2beta - 1.44.0 + 1.45.0 com.google.api.grpc grpc-google-iam-v1 - 1.44.0 + 1.45.0 com.google.api.grpc grpc-google-iam-v2 - 1.44.0 + 1.45.0 com.google.api.grpc grpc-google-iam-v2beta - 1.44.0 + 1.45.0 diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 2dc1174f94..19c2301f71 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 pom GAPIC Generator Java POM Parent https://github.com/googleapis/sdk-platform-java @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.12.0 + 1.12.2 @@ -26,18 +26,18 @@ 1.3.2 - 1.68.1 - 1.30.0 - 1.45.0 + 1.69.0 + 1.30.1 + 1.45.3 2.11.0 33.3.1-jre 3.25.5 - 1.42.1 + 1.45.0 8 - 2.35.1 + 2.36.0 3.0.0 1.7.0 - 5.11.2 + 5.11.3 @@ -115,7 +115,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.0 + 3.5.2 @@ -131,7 +131,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.0 + 3.5.2 diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 050a393f7c..d995b41c52 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.google.api gapic-generator-java - 2.50.0 + 2.51.0 GAPIC Generator Java GAPIC generator Java @@ -22,7 +22,7 @@ com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent @@ -31,7 +31,7 @@ com.google.api gapic-generator-java-bom - 2.50.0 + 2.51.0 pom import @@ -317,7 +317,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.0 + 3.5.2 @@ -473,7 +473,7 @@ io.github.java-diff-utils java-diff-utils - 4.12 + 4.15 test diff --git a/gax-java/README.md b/gax-java/README.md index d219315e5e..17445323b5 100644 --- a/gax-java/README.md +++ b/gax-java/README.md @@ -34,27 +34,27 @@ If you are using Maven, add this to your pom.xml file com.google.api gax - 2.58.0 + 2.59.0 com.google.api gax-grpc - 2.58.0 + 2.59.0 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.api:gax:2.58.0', - 'com.google.api:gax-grpc:2.58.0' +compile 'com.google.api:gax:2.59.0', + 'com.google.api:gax-grpc:2.59.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.api" % "gax" % "2.58.0" -libraryDependencies += "com.google.api" % "gax-grpc" % "2.58.0" +libraryDependencies += "com.google.api" % "gax" % "2.59.0" +libraryDependencies += "com.google.api" % "gax-grpc" % "2.59.0" ``` [//]: # ({x-version-update-end}) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 77aeab9fe2..268c3ab503 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -8,16 +8,16 @@ # Versions of oneself # {x-version-update-start:gax:current} -version.gax=2.58.0 +version.gax=2.59.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.58.0 +version.gax_grpc=2.59.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.58.0 +version.gax_bom=2.59.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_httpjson=2.58.0 +version.gax_httpjson=2.59.0 # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. @@ -28,33 +28,33 @@ version.gax_httpjson=2.58.0 version.com_google_protobuf=3.25.5 version.google_java_format=1.15.0 -version.io_grpc=1.68.1 +version.io_grpc=1.69.0 # Maven artifacts. # Note, the actual name of each property matters (bazel build scripts depend on it). # It should be constructed the following way: # 1) Take full artifact id (including the group and classifier (if any) portions) and remove version portion. # 2) Replace all characters which are neither alphabetic nor digits with the underscore ('_') character -maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.46.0 -maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.46.0 -maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.30.0 -maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.30.0 -maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.42.1 +maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.49.0 +maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.49.0 +maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.30.1 +maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.30.1 +maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.45.0 maven.io_opencensus_opencensus_api=io.opencensus:opencensus-api:0.31.1 maven.io_opencensus_opencensus_contrib_grpc_metrics=io.opencensus:opencensus-contrib-grpc-metrics:0.31.1 maven.io_opencensus_opencensus_contrib_http_util=io.opencensus:opencensus-contrib-http-util:0.31.1 -maven.io_netty_netty_tcnative_boringssl_static=io.netty:netty-tcnative-boringssl-static:2.0.66.Final -maven.io_netty_netty_handler=io.netty:netty-handler:4.1.114.Final -maven.io_netty_netty_common=io.netty:netty-common:4.1.114.Final -maven.io_netty_netty_codec_socks=io.netty:netty-codec-socks:4.1.114.Final -maven.io_netty_netty_codec_http2=io.netty:netty-codec-http2:4.1.114.Final -maven.io_netty_netty_codec_http=io.netty:netty-codec-http:4.1.114.Final -maven.io_netty_netty_codec=io.netty:netty-codec:4.1.114.Final -maven.io_netty_netty_buffer=io.netty:netty-buffer:4.1.114.Final -maven.io_netty_netty_resolver=io.netty:netty-resolver:4.1.114.Final -maven.io_netty_netty_transport=io.netty:netty-transport:4.1.114.Final -maven.io_netty_netty_handler_proxy=io.netty:netty-handler-proxy:4.1.114.Final -maven.io_netty_netty_transport_native_unix_common=io.netty:netty-transport-native-unix-common:4.1.114.Final +maven.io_netty_netty_tcnative_boringssl_static=io.netty:netty-tcnative-boringssl-static:2.0.69.Final +maven.io_netty_netty_handler=io.netty:netty-handler:4.1.115.Final +maven.io_netty_netty_common=io.netty:netty-common:4.1.115.Final +maven.io_netty_netty_codec_socks=io.netty:netty-codec-socks:4.1.115.Final +maven.io_netty_netty_codec_http2=io.netty:netty-codec-http2:4.1.115.Final +maven.io_netty_netty_codec_http=io.netty:netty-codec-http:4.1.115.Final +maven.io_netty_netty_codec=io.netty:netty-codec:4.1.115.Final +maven.io_netty_netty_buffer=io.netty:netty-buffer:4.1.115.Final +maven.io_netty_netty_resolver=io.netty:netty-resolver:4.1.115.Final +maven.io_netty_netty_transport=io.netty:netty-transport:4.1.115.Final +maven.io_netty_netty_handler_proxy=io.netty:netty-handler-proxy:4.1.115.Final +maven.io_netty_netty_transport_native_unix_common=io.netty:netty-transport-native-unix-common:4.1.115.Final maven.io_perfmark_perfmark_api=io.perfmark:perfmark-api:0.27.0 maven.org_apache_tomcat_annotations_api=org.apache.tomcat:annotations-api:6.0.53 maven.com_google_code_gson_gson=com.google.code.gson:gson:2.11.0 @@ -63,16 +63,16 @@ maven.com_google_guava_failureaccess=com.google.guava:failureaccess:1.0.2 maven.org_apache_commons_commons_lang3=org.apache.commons:commons-lang3:3.17.0 maven.com_google_android_annotations=com.google.android:annotations:4.1.1.4 maven.com_google_code_findbugs_jsr305=com.google.code.findbugs:jsr305:3.0.2 -maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_prone_annotations:2.35.1 +maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_prone_annotations:2.36.0 maven.com_google_j2objc_j2objc_annotations=com.google.j2objc:j2objc-annotations:2.8 maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.11.0 maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.11.0 -maven.com_google_api_api_common=com.google.api:api-common:2.38.0 +maven.com_google_api_api_common=com.google.api:api-common:2.41.0 maven.org_threeten_threetenbp=org.threeten:threetenbp:1.7.0 -maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:1.41.0 -maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.41.0 -maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.45.0 -maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.45.0 +maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:1.44.0 +maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.44.0 +maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.45.3 +maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.45.3 maven.org_codehaus_mojo_animal_sniffer_annotations=org.codehaus.mojo:animal-sniffer-annotations:1.24 maven.javax_annotation_javax_annotation_api=javax.annotation:javax.annotation-api:1.3.2 maven.org_graalvm_sdk=org.graalvm.sdk:graal-sdk:22.3.5 @@ -84,7 +84,7 @@ maven.org_mockito_mockito_junit_jupiter=org.mockito:mockito-junit-jupiter:4.11.0 maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3 maven.com_google_truth_truth=com.google.truth:truth:1.4.4 maven.com_googlecode_java_diff_utils_diffutils=com.googlecode.java-diff-utils:diffutils:1.3.0 -maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.15.3 +maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.15.10 maven.org_objenesis_objenesis=org.objenesis:objenesis:2.6 -maven.org_junit_jupiter_junit_jupiter_api=org.junit.jupiter:junit-jupiter-api:5.11.2 -maven.org_junit_jupiter_junit_jupiter_params=org.junit.jupiter:junit-jupiter-params:5.11.2 +maven.org_junit_jupiter_junit_jupiter_api=org.junit.jupiter:junit-jupiter-api:5.11.3 +maven.org_junit_jupiter_junit_jupiter_params=org.junit.jupiter:junit-jupiter-params:5.11.3 diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 011e42b586..ec1c814088 100644 --- a/gax-java/gax-bom/pom.xml +++ b/gax-java/gax-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.api gax-bom - 2.58.0 + 2.59.0 pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -11,7 +11,7 @@ com.google.cloud google-cloud-shared-config - 1.12.0 + 1.12.2 @@ -43,55 +43,55 @@ com.google.api gax - 2.58.0 + 2.59.0 com.google.api gax - 2.58.0 + 2.59.0 test-jar testlib com.google.api gax - 2.58.0 + 2.59.0 testlib com.google.api gax-grpc - 2.58.0 + 2.59.0 com.google.api gax-grpc - 2.58.0 + 2.59.0 test-jar testlib com.google.api gax-grpc - 2.58.0 + 2.59.0 testlib com.google.api gax-httpjson - 2.58.0 + 2.59.0 com.google.api gax-httpjson - 2.58.0 + 2.59.0 test-jar testlib com.google.api gax-httpjson - 2.58.0 + 2.59.0 testlib diff --git a/gax-java/gax-grpc/BUILD.bazel b/gax-java/gax-grpc/BUILD.bazel index 99e4aba500..be224ff3f8 100644 --- a/gax-java/gax-grpc/BUILD.bazel +++ b/gax-java/gax-grpc/BUILD.bazel @@ -28,7 +28,6 @@ _COMPILE_DEPS = [ "@io_grpc_grpc_netty_shaded//jar", "@io_grpc_grpc_grpclb//jar", "@io_grpc_grpc_java//alts:alts", - "@io_grpc_grpc_java//s2a:s2av2_credentials", "@io_netty_netty_tcnative_boringssl_static//jar", "@javax_annotation_javax_annotation_api//jar", "//gax:gax", diff --git a/gax-java/gax-grpc/clirr-ignored-differences.xml b/gax-java/gax-grpc/clirr-ignored-differences.xml index 8b595b0a85..3cc02d6562 100644 --- a/gax-java/gax-grpc/clirr-ignored-differences.xml +++ b/gax-java/gax-grpc/clirr-ignored-differences.xml @@ -7,4 +7,10 @@ com/google/api/gax/grpc/GrpcTransportChannel boolean isDirectPath() + + + 7002 + com/google/api/gax/grpc/InstantiatingGrpcChannelProvider + * withUseS2A(*) + diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index 927415b594..3d44fe2ce4 100644 --- a/gax-java/gax-grpc/pom.xml +++ b/gax-java/gax-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-grpc - 2.58.0 + 2.59.0 jar GAX (Google Api eXtensions) for Java (gRPC) Google Api eXtensions for Java (gRPC) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.58.0 + 2.59.0 @@ -63,10 +63,6 @@ io.grpc grpc-protobuf - - io.grpc - grpc-s2a - io.grpc grpc-stub diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java index 8cad9f0383..ae4d7f9e51 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java @@ -46,24 +46,19 @@ import com.google.auth.ApiKeyCredentials; import com.google.auth.Credentials; import com.google.auth.oauth2.ComputeEngineCredentials; -import com.google.auth.oauth2.SecureSessionAgent; -import com.google.auth.oauth2.SecureSessionAgentConfig; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; -import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.io.Files; import io.grpc.CallCredentials; import io.grpc.ChannelCredentials; import io.grpc.Grpc; -import io.grpc.InsecureChannelCredentials; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.TlsChannelCredentials; import io.grpc.alts.GoogleDefaultChannelCredentials; import io.grpc.auth.MoreCallCredentials; -import io.grpc.s2a.S2AChannelCredentials; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -104,15 +99,6 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP @VisibleForTesting static final String DIRECT_PATH_ENV_ENABLE_XDS = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"; - // The public portion of the mTLS MDS root certificate is stored for performing - // cert verification when establishing an mTLS connection with the MDS. See - // https://cloud.google.com/compute/docs/metadata/overview#https-mds-root-certs - private static final String MTLS_MDS_ROOT_PATH = "/run/google-mds-mtls/root.crt"; - // The mTLS MDS credentials are formatted as the concatenation of a PEM-encoded certificate chain - // followed by a PEM-encoded private key. See - // https://cloud.google.com/compute/docs/metadata/overview#https-mds-client-certs - private static final String MTLS_MDS_CERT_CHAIN_AND_KEY_PATH = "/run/google-mds-mtls/client.key"; - static final long DIRECT_PATH_KEEP_ALIVE_TIME_SECONDS = 3600; static final long DIRECT_PATH_KEEP_ALIVE_TIMEOUT_SECONDS = 20; static final String GCE_PRODUCTION_NAME_PRIOR_2016 = "Google"; @@ -121,7 +107,6 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP private final int processorCount; private final Executor executor; private final HeaderProvider headerProvider; - private final boolean useS2A; private final String endpoint; // TODO: remove. envProvider currently provides DirectPath environment variable, and is only used // during initial rollout for DirectPath. This provider will be removed once the DirectPath @@ -141,7 +126,6 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP @Nullable private final Boolean allowNonDefaultServiceAccount; @VisibleForTesting final ImmutableMap directPathServiceConfig; @Nullable private final MtlsProvider mtlsProvider; - @Nullable private final SecureSessionAgent s2aConfigProvider; @VisibleForTesting final Map headersWithDuplicatesRemoved = new HashMap<>(); @Nullable @@ -152,9 +136,7 @@ private InstantiatingGrpcChannelProvider(Builder builder) { this.executor = builder.executor; this.headerProvider = builder.headerProvider; this.endpoint = builder.endpoint; - this.useS2A = builder.useS2A; this.mtlsProvider = builder.mtlsProvider; - this.s2aConfigProvider = builder.s2aConfigProvider; this.envProvider = builder.envProvider; this.interceptorProvider = builder.interceptorProvider; this.maxInboundMessageSize = builder.maxInboundMessageSize; @@ -243,17 +225,6 @@ public TransportChannelProvider withEndpoint(String endpoint) { return toBuilder().setEndpoint(endpoint).build(); } - /** - * Specify whether or not to use S2A. - * - * @param useS2A - * @return A new {@link InstantiatingGrpcChannelProvider} with useS2A set. - */ - @Override - public TransportChannelProvider withUseS2A(boolean useS2A) { - return toBuilder().setUseS2A(useS2A).build(); - } - /** @deprecated Please modify pool settings via {@link #toBuilder()} */ @Deprecated @Override @@ -439,101 +410,6 @@ ChannelCredentials createMtlsChannelCredentials() throws IOException, GeneralSec return null; } - /** - * This method creates {@link TlsChannelCredentials} to be used by the client to establish an mTLS - * connection to S2A. Returns null if any of {@param trustBundle}, {@param privateKey} or {@param - * certChain} are missing. - * - * @param trustBundle the trust bundle to be used to establish the client -> S2A mTLS connection - * @param privateKey the client's private key to be used to establish the client -> S2A mtls - * connection - * @param certChain the client's cert chain to be used to establish the client -> S2A mtls - * connection - * @return {@link ChannelCredentials} to use to create an mtls connection between client and S2A - * @throws IOException on error - */ - @VisibleForTesting - ChannelCredentials createMtlsToS2AChannelCredentials( - File trustBundle, File privateKey, File certChain) throws IOException { - if (trustBundle == null || privateKey == null || certChain == null) { - return null; - } - return TlsChannelCredentials.newBuilder() - .keyManager(privateKey, certChain) - .trustManager(trustBundle) - .build(); - } - - /** - * This method creates {@link ChannelCredentials} to be used by client to establish a plaintext - * connection to S2A. if {@param plaintextAddress} is not present, returns null. - * - * @param plaintextAddress the address to reach S2A which accepts plaintext connections - * @return {@link ChannelCredentials} to use to create a plaintext connection between client and - * S2A - */ - ChannelCredentials createPlaintextToS2AChannelCredentials(String plaintextAddress) { - if (Strings.isNullOrEmpty(plaintextAddress)) { - return null; - } - return S2AChannelCredentials.newBuilder(plaintextAddress, InsecureChannelCredentials.create()) - .build(); - } - - /** - * This method creates gRPC {@link ChannelCredentials} configured to use S2A to estbalish a mTLS - * connection. First, the address of S2A is discovered by using the {@link S2A} utility to learn - * the {@code mtlsAddress} to reach S2A and the {@code plaintextAddress} to reach S2A. Prefer to - * use the {@code mtlsAddress} address to reach S2A if it is non-empty and the MTLS-MDS - * credentials can successfully be discovered and used to create {@link TlsChannelCredentials}. If - * there is any failure using mTLS-to-S2A, fallback to using a plaintext connection to S2A using - * the {@code plaintextAddress}. If {@code plaintextAddress} is not available, this function - * returns null; in this case S2A will not be used, and a TLS connection to the service will be - * established. - * - * @return {@link ChannelCredentials} configured to use S2A to create mTLS connection to - * mtlsEndpoint. - */ - ChannelCredentials createS2ASecuredChannelCredentials() { - SecureSessionAgentConfig config = s2aConfigProvider.getConfig(); - String plaintextAddress = config.getPlaintextAddress(); - String mtlsAddress = config.getMtlsAddress(); - if (Strings.isNullOrEmpty(mtlsAddress)) { - // Fallback to plaintext connection to S2A. - LOG.log( - Level.INFO, - "Cannot establish an mTLS connection to S2A because autoconfig endpoint did not return a mtls address to reach S2A."); - return createPlaintextToS2AChannelCredentials(plaintextAddress); - } - // Currently, MTLS to MDS is only available on GCE. See: - // https://cloud.google.com/compute/docs/metadata/overview#https-mds - // Try to load MTLS-MDS creds. - File rootFile = new File(MTLS_MDS_ROOT_PATH); - File certKeyFile = new File(MTLS_MDS_CERT_CHAIN_AND_KEY_PATH); - if (rootFile.isFile() && certKeyFile.isFile()) { - // Try to connect to S2A using mTLS. - ChannelCredentials mtlsToS2AChannelCredentials = null; - try { - mtlsToS2AChannelCredentials = - createMtlsToS2AChannelCredentials(rootFile, certKeyFile, certKeyFile); - } catch (IOException ignore) { - // Fallback to plaintext-to-S2A connection on error. - LOG.log( - Level.WARNING, - "Cannot establish an mTLS connection to S2A due to error creating MTLS to MDS TlsChannelCredentials credentials, falling back to plaintext connection to S2A: " - + ignore.getMessage()); - return createPlaintextToS2AChannelCredentials(plaintextAddress); - } - return S2AChannelCredentials.newBuilder(mtlsAddress, mtlsToS2AChannelCredentials).build(); - } else { - // Fallback to plaintext-to-S2A connection if MTLS-MDS creds do not exist. - LOG.log( - Level.INFO, - "Cannot establish an mTLS connection to S2A because MTLS to MDS credentials do not exist on filesystem, falling back to plaintext connection to S2A"); - return createPlaintextToS2AChannelCredentials(plaintextAddress); - } - } - private ManagedChannel createSingleChannel() throws IOException { GrpcHeaderInterceptor headerInterceptor = new GrpcHeaderInterceptor(headersWithDuplicatesRemoved); @@ -571,7 +447,6 @@ private ManagedChannel createSingleChannel() throws IOException { builder.keepAliveTime(DIRECT_PATH_KEEP_ALIVE_TIME_SECONDS, TimeUnit.SECONDS); builder.keepAliveTimeout(DIRECT_PATH_KEEP_ALIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS); } else { - // Try and create credentials via DCA. See https://google.aip.dev/auth/4114. ChannelCredentials channelCredentials; try { channelCredentials = createMtlsChannelCredentials(); @@ -579,23 +454,9 @@ private ManagedChannel createSingleChannel() throws IOException { throw new IOException(e); } if (channelCredentials != null) { - // Create the channel using channel credentials created via DCA. builder = Grpc.newChannelBuilder(endpoint, channelCredentials); } else { - // Could not create channel credentials via DCA. In accordance with - // https://google.aip.dev/auth/4115, if credentials not available through - // DCA, try mTLS with credentials held by the S2A (Secure Session Agent). - if (useS2A) { - channelCredentials = createS2ASecuredChannelCredentials(); - } - if (channelCredentials != null) { - // Create the channel using S2A-secured channel credentials. - // {@code endpoint} is set to mtlsEndpoint in {@link EndpointContext} when useS2A is true. - builder = Grpc.newChannelBuilder(endpoint, channelCredentials); - } else { - // Use default if we cannot initialize channel credentials via DCA or S2A. - builder = ManagedChannelBuilder.forAddress(serviceAddress, port); - } + builder = ManagedChannelBuilder.forAddress(serviceAddress, port); } } // google-c2p resolver requires service config lookup @@ -743,9 +604,7 @@ public static final class Builder { private Executor executor; private HeaderProvider headerProvider; private String endpoint; - private boolean useS2A; private EnvironmentProvider envProvider; - private SecureSessionAgent s2aConfigProvider = SecureSessionAgent.create(); private MtlsProvider mtlsProvider = new MtlsProvider(); @Nullable private GrpcInterceptorProvider interceptorProvider; @Nullable private Integer maxInboundMessageSize; @@ -773,7 +632,6 @@ private Builder(InstantiatingGrpcChannelProvider provider) { this.executor = provider.executor; this.headerProvider = provider.headerProvider; this.endpoint = provider.endpoint; - this.useS2A = provider.useS2A; this.envProvider = provider.envProvider; this.interceptorProvider = provider.interceptorProvider; this.maxInboundMessageSize = provider.maxInboundMessageSize; @@ -790,7 +648,6 @@ private Builder(InstantiatingGrpcChannelProvider provider) { this.allowNonDefaultServiceAccount = provider.allowNonDefaultServiceAccount; this.directPathServiceConfig = provider.directPathServiceConfig; this.mtlsProvider = provider.mtlsProvider; - this.s2aConfigProvider = provider.s2aConfigProvider; } /** @@ -843,23 +700,12 @@ public Builder setEndpoint(String endpoint) { return this; } - Builder setUseS2A(boolean useS2A) { - this.useS2A = useS2A; - return this; - } - @VisibleForTesting Builder setMtlsProvider(MtlsProvider mtlsProvider) { this.mtlsProvider = mtlsProvider; return this; } - @VisibleForTesting - Builder setS2AConfigProvider(SecureSessionAgent s2aConfigProvider) { - this.s2aConfigProvider = s2aConfigProvider; - return this; - } - /** * Sets the GrpcInterceptorProvider for this TransportChannelProvider. * diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java index ac88e4acec..241f90b08a 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java @@ -101,8 +101,6 @@ void setUp() throws IOException { TransportChannel transportChannel = GrpcTransportChannel.newBuilder().setManagedChannel(channel).build(); when(operationsChannelProvider.getTransportChannel()).thenReturn(transportChannel); - when(operationsChannelProvider.withUseS2A(Mockito.any(boolean.class))) - .thenReturn(operationsChannelProvider); clock = new FakeApiClock(0L); executor = RecordingScheduler.create(clock); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java index 049c34dd96..a58f9b8173 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java @@ -51,16 +51,12 @@ import com.google.auth.http.AuthHttpConstants; import com.google.auth.oauth2.CloudShellCredentials; import com.google.auth.oauth2.ComputeEngineCredentials; -import com.google.auth.oauth2.SecureSessionAgent; -import com.google.auth.oauth2.SecureSessionAgentConfig; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.truth.Truth; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; -import io.grpc.TlsChannelCredentials; import io.grpc.alts.ComputeEngineChannelBuilder; -import java.io.File; import java.io.IOException; import java.security.GeneralSecurityException; import java.time.Duration; @@ -984,120 +980,6 @@ private FixedHeaderProvider getHeaderProviderWithApiKeyHeader() { return FixedHeaderProvider.create(header); } - @Test - void createPlaintextToS2AChannelCredentials_emptyPlaintextAddress_returnsNull() { - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); - assertThat(provider.createPlaintextToS2AChannelCredentials("")).isNull(); - } - - @Test - void createPlaintextToS2AChannelCredentials_success() { - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); - assertThat(provider.createPlaintextToS2AChannelCredentials("localhost:8080")).isNotNull(); - } - - @Test - void createMtlsToS2AChannelCredentials_missingAllFiles_throws() throws IOException { - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); - assertThat(provider.createMtlsToS2AChannelCredentials(null, null, null)).isNull(); - } - - @Test - void createMtlsToS2AChannelCredentials_missingRootFile_throws() throws IOException { - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); - File privateKey = new File("src/test/resources/client_key.pem"); - File certChain = new File("src/test/resources/client_cert.pem"); - assertThat(provider.createMtlsToS2AChannelCredentials(null, privateKey, certChain)).isNull(); - } - - @Test - void createMtlsToS2AChannelCredentials_missingKeyFile_throws() throws IOException { - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); - File trustBundle = new File("src/test/resources/root_cert.pem"); - File certChain = new File("src/test/resources/client_cert.pem"); - assertThat(provider.createMtlsToS2AChannelCredentials(trustBundle, null, certChain)).isNull(); - } - - @Test - void createMtlsToS2AChannelCredentials_missingCertChainFile_throws() throws IOException { - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); - File trustBundle = new File("src/test/resources/root_cert.pem"); - File privateKey = new File("src/test/resources/client_key.pem"); - assertThat(provider.createMtlsToS2AChannelCredentials(trustBundle, privateKey, null)).isNull(); - } - - @Test - void createMtlsToS2AChannelCredentials_success() throws IOException { - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); - File trustBundle = new File("src/test/resources/root_cert.pem"); - File privateKey = new File("src/test/resources/client_key.pem"); - File certChain = new File("src/test/resources/client_cert.pem"); - assertEquals( - provider.createMtlsToS2AChannelCredentials(trustBundle, privateKey, certChain).getClass(), - TlsChannelCredentials.class); - } - - @Test - void createS2ASecuredChannelCredentials_bothS2AAddressesNull_returnsNull() { - SecureSessionAgent s2aConfigProvider = Mockito.mock(SecureSessionAgent.class); - SecureSessionAgentConfig config = SecureSessionAgentConfig.createBuilder().build(); - Mockito.when(s2aConfigProvider.getConfig()).thenReturn(config); - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder() - .setS2AConfigProvider(s2aConfigProvider) - .build(); - assertThat(provider.createS2ASecuredChannelCredentials()).isNull(); - } - - @Test - void - createS2ASecuredChannelCredentials_mtlsS2AAddressNull_returnsPlaintextToS2AS2AChannelCredentials() { - SecureSessionAgent s2aConfigProvider = Mockito.mock(SecureSessionAgent.class); - SecureSessionAgentConfig config = - SecureSessionAgentConfig.createBuilder().setPlaintextAddress("localhost:8080").build(); - Mockito.when(s2aConfigProvider.getConfig()).thenReturn(config); - FakeLogHandler logHandler = new FakeLogHandler(); - InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder() - .setS2AConfigProvider(s2aConfigProvider) - .build(); - assertThat(provider.createS2ASecuredChannelCredentials()).isNotNull(); - assertThat(logHandler.getAllMessages()) - .contains( - "Cannot establish an mTLS connection to S2A because autoconfig endpoint did not return a mtls address to reach S2A."); - InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); - } - - @Test - void createS2ASecuredChannelCredentials_returnsPlaintextToS2AS2AChannelCredentials() { - SecureSessionAgent s2aConfigProvider = Mockito.mock(SecureSessionAgent.class); - SecureSessionAgentConfig config = - SecureSessionAgentConfig.createBuilder() - .setMtlsAddress("localhost:8080") - .setPlaintextAddress("localhost:8080") - .build(); - Mockito.when(s2aConfigProvider.getConfig()).thenReturn(config); - FakeLogHandler logHandler = new FakeLogHandler(); - InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder() - .setS2AConfigProvider(s2aConfigProvider) - .build(); - assertThat(provider.createS2ASecuredChannelCredentials()).isNotNull(); - assertThat(logHandler.getAllMessages()) - .contains( - "Cannot establish an mTLS connection to S2A because MTLS to MDS credentials do not exist on filesystem, falling back to plaintext connection to S2A"); - InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); - } - private static class FakeLogHandler extends Handler { List records = new ArrayList<>(); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/LocalChannelProvider.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/LocalChannelProvider.java index 856a2850bb..5e538a06c2 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/LocalChannelProvider.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/LocalChannelProvider.java @@ -106,12 +106,6 @@ public TransportChannelProvider withEndpoint(String endpoint) { throw new UnsupportedOperationException("LocalChannelProvider doesn't need an endpoint"); } - @Override - public TransportChannelProvider withUseS2A(boolean useS2A) { - // Overriden for technical reasons. This method is a no-op for LocalChannelProvider. - return this; - } - @Override @BetaApi("The surface for customizing pool size is not stable yet and may change in the future.") public boolean acceptsPoolSize() { diff --git a/gax-java/gax-grpc/src/test/resources/README.md b/gax-java/gax-grpc/src/test/resources/README.md deleted file mode 100644 index a9a9b0efe9..0000000000 --- a/gax-java/gax-grpc/src/test/resources/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Regenerate certificates and keys for testing mTLS-S2A -Below are the commands which can be used to regenerate the certs used in tests. This is the same process -used to generate test certs for S2A client in grpc-java: https://github.com/grpc/grpc-java/blob/master/s2a/src/test/resources/README.md - -Create root CA - -``` -openssl req -x509 -sha256 -days 7305 -newkey rsa:2048 -keyout root_key.pem -out -root_cert.pem -``` - -Generate private key - -``` -openssl genrsa -out client_key.pem 2048 -``` - -Generate CSR (set Common Name to localhost, leave all -other fields blank) - -``` -openssl req -key client_key.pem -new -out client.csr -config config.cnf -``` - -Sign CSR for client - -``` -openssl x509 -req -CA root_cert.pem -CAkey root_key.pem -in client.csr -out client_cert.pem -days 7305 -``` diff --git a/gax-java/gax-grpc/src/test/resources/client_cert.pem b/gax-java/gax-grpc/src/test/resources/client_cert.pem deleted file mode 100644 index 837f8bb501..0000000000 --- a/gax-java/gax-grpc/src/test/resources/client_cert.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDPTCCAiWgAwIBAgIUaarddwSWeE4jDC9kwxEr446ehqUwDQYJKoZIhvcNAQEL -BQAwWTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MB4X -DTI0MTAwMTIxNTk1NFoXDTQ0MTAwMTIxNTk1NFowFDESMBAGA1UEAwwJbG9jYWxo -b3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxlNsldt7yAU4KRuS -2D2/FjNIE1US5olBm4HteTr++41WaELZJqNLRPPp052jEQU3aKSYNGZvUUO6buu7 -eFpz2SBNUVMyvmzzocjVAyyf4NQvDazYHWOb+/YCeUppTRWriz4V5sn47qJTQ8cd -CGrTFeLHxUjx4nh/OiqVXP/KnF3EqPEuqph0ky7+GirnJgPRe+C5ERuGkJye8dmP -yWGA2lSS6MeDe7JZTAMi08bAn7BuNpeBkOzz1msGGI9PnUanUs7GOPWTDdcQAVY8 -KMvHCuGaNMGpb4rOR2mm8LlbAbpTPz8Pkw4QtMCLkgsrz2CzXpVwnLsU7nDXJAIO -B155lQIDAQABo0IwQDAdBgNVHQ4EFgQUSZEyIHLzkIw7AwkBaUjYfIrGVR4wHwYD -VR0jBBgwFoAUcq3dtxAVA410YWyM0B4e+4umbiwwDQYJKoZIhvcNAQELBQADggEB -AAz0bZ4ayrZLhA45xn0yvdpdqiCtiWikCRtxgE7VXHg/ziZJVMpBpAhbIGO5tIyd -lttnRXHwz5DUwKiba4/bCEFe229BshQEql5qaqcbGbFfSly11WeqqnwR1N7c8Gpv -pD9sVrx22seN0rTUk87MY/S7mzCxHqAx35zm/LTW3pWcgCTMKFHy4Gt4mpTnXkNA -WkhP2OhW5RLiu6Whi0BEdb2TGG1+ctamgijKXb+gJeef5ehlHXG8eU862KF5UlEA -NeQKBm/PpQxOMe0NdpatjN8QRoczku0Itiodng+OZ1o+2iSNG988uFRb3CUSnjtE -R/HL6ULAFzo59EpIYxruU/w= ------END CERTIFICATE----- \ No newline at end of file diff --git a/gax-java/gax-grpc/src/test/resources/client_key.pem b/gax-java/gax-grpc/src/test/resources/client_key.pem deleted file mode 100644 index 38b93eb65c..0000000000 --- a/gax-java/gax-grpc/src/test/resources/client_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDGU2yV23vIBTgp -G5LYPb8WM0gTVRLmiUGbge15Ov77jVZoQtkmo0tE8+nTnaMRBTdopJg0Zm9RQ7pu -67t4WnPZIE1RUzK+bPOhyNUDLJ/g1C8NrNgdY5v79gJ5SmlNFauLPhXmyfjuolND -xx0IatMV4sfFSPHieH86KpVc/8qcXcSo8S6qmHSTLv4aKucmA9F74LkRG4aQnJ7x -2Y/JYYDaVJLox4N7sllMAyLTxsCfsG42l4GQ7PPWawYYj0+dRqdSzsY49ZMN1xAB -Vjwoy8cK4Zo0walvis5HaabwuVsBulM/Pw+TDhC0wIuSCyvPYLNelXCcuxTucNck -Ag4HXnmVAgMBAAECggEAKuW9jXaBgiS63o1jyFkmvWcPNntG0M2sfrXuRzQfFgse -vwOCk8xrSflWQNsOe+58ayp6746ekl3LdBWSIbiy6SqG/sm3pp/LXNmjVYHv/QH4 -QYV643R5t1ihdVnGiBFhXwdpVleme/tpdjYZzgnJKak5W69o/nrgzhSK5ShAy2xM -j0XXbgdqG+4JxPb5BZmjHHfXAXUfgSORMdfArkbgFBRc9wL/6JVTXjeAMy5WX9qe -5UQsSOYkwc9P2snifC/jdIhjHQOkkx59O0FgukJEFZPoagVG1duWQbnNDr7QVHCJ -jV6dg9tIT4SXD3uPSPbgNGlRUseIakCzrhHARJuA2wKBgQD/h8zoh0KaqKyViCYw -XKOFpm1pAFnp2GiDOblxNubNFAXEWnC+FlkvO/z1s0zVuYELUqfxcYMSXJFEVelK -rfjZtoC5oxqWGqLo9iCj7pa8t+ipulYcLt2SWc7eZPD4T4lzeEf1Qz77aKcz34sa -dv9lzQkDvhR/Mv1VeEGFHiq2VwKBgQDGsLcTGH5Yxs//LRSY8TigBkQEDrH5NvXu -2jtAzZhy1Yhsoa5eiZkhnnzM6+n05ovfZLcy6s7dnwP1Y+C79vs+DKMBsodtDG5z -YpsB0VrXYa6P6pCqkcz0Bz9xdo5sOhAK3AKnX6jd29XBDdeYsw/lxHLG24wProTD -cCYFqtaj8wKBgQCaqKT68DL9zK14a8lBaDCIyexaqx3AjXzkP+Hfhi03XrEG4P5v -7rLYBeTbCUSt7vMN2V9QoTWFvYUm6SCkVJvTmcRblz6WL1T+z0l+LwAJBP7LC77m -m+77j2PH8yxt/iXhP6G97o+GNxdMLDbTM8bs5KZaH4fkXQY73uc5HMMZTQKBgEZS -7blYhf+t/ph2wD+RwVUCYrh86wkmJs2veCFro3WhlnO8lhbn5Mc9bTaqmVgQ8ZjT -8POYoDdYvPHxs+1TcYF4v4kuQziZmc5FLE/sZZauADb38tQsXrpQhmgGakpsEpmF -XXsYJJDB6lo2KATn+8x7R5SSyHQUdPEnlI2U9ft5AoGBAJw0NJiM1EzRS8xq0DmO -AvQaPjo01o2hH6wghws8gDQwrj0eHraHgVi7zo0VkaHJbO7ahKPudset3N7owJhA -CUAPPRtv5wn0amAyNz77f1dz4Gys3AkcchflqhbEaQpzKYx4kX0adclur4WJ/DVm -P7DI977SHCVB4FVMbXMEkBjN ------END PRIVATE KEY----- \ No newline at end of file diff --git a/gax-java/gax-grpc/src/test/resources/root_cert.pem b/gax-java/gax-grpc/src/test/resources/root_cert.pem deleted file mode 100644 index ccd0a46bc2..0000000000 --- a/gax-java/gax-grpc/src/test/resources/root_cert.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDkzCCAnugAwIBAgIUWemeXZdfqcqkP8/Eyj74oTJtoNQwDQYJKoZIhvcNAQEL -BQAwWTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MB4X -DTI0MTAwMTIxNTkxMVoXDTQ0MTAwMTIxNTkxMVowWTELMAkGA1UEBhMCQVUxEzAR -BgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5 -IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAt3A04hy5lljv86Nu0LLQZ2hA+fcImHjt1p1Mxgcta/5oxfVLcerE -ZH+DAQLDtWzp9Up/vI57MM419GIL8Iszk7hnZRS/HWJ+2jewZJtz4i/g15dLr6+1 -uabMdPOWos60BwcLMxKEe6lJO1mV4z9d4NH4mAuMIHyM+ty0Klp9MfeDJtYEh0+z -AxJUHCixDTsnKJro7My7A3ZT7bvaMfXxS7XN6qlRgBfiCmXo/GKTFfmfBW/EZGkG -XOCxE2D79wYNhC41Q/ix0kwjEeOj2vgGFoiyblSdHdzvRXzsoQTEiZSM8lJDR2IT -ZbpgbBlknMU6efNWlS8P5damB9ZWXg3x4wIDAQABo1MwUTAdBgNVHQ4EFgQUcq3d -txAVA410YWyM0B4e+4umbiwwHwYDVR0jBBgwFoAUcq3dtxAVA410YWyM0B4e+4um -biwwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEApZvaI9y7vjX/ -RRdvwf2Db9KlTE9nuVQ3AsrmG9Ml0p2X6U5aTetxdYBo2PuaaYHheF03JOH8zjpL -UfFzvbi52DPbfFAaDw/6NIAenXlg492leNvUFNjGGRyJO9R5/aDfv40/fT3Em5G5 -DnR8SeGQ9tI1t6xBBT+d+/MilSiEKVu8IIF/p0SwvEyR4pKo6wFVZR0ZiIj2v/FZ -P5Qk0Xhb+slpmaR3Wtx/mPl9Wb3kpPD4CAwhWDqFkKJql9/n9FvMjdwlCQKQGB26 -ZDXY3C0UTdktK5biNWRgAUVJEWBX6Q2amrxQHIn2d9RJ8uxCME/KBAntK+VxZE78 -w0JOvQ4Dpw== ------END CERTIFICATE----- \ No newline at end of file diff --git a/gax-java/gax-httpjson/clirr-ignored-differences.xml b/gax-java/gax-httpjson/clirr-ignored-differences.xml new file mode 100644 index 0000000000..c4db8a60a8 --- /dev/null +++ b/gax-java/gax-httpjson/clirr-ignored-differences.xml @@ -0,0 +1,10 @@ + + + + + + 7002 + com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider + * withUseS2A(*) + + diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index 7d91f4771c..3e74f4b5c1 100644 --- a/gax-java/gax-httpjson/pom.xml +++ b/gax-java/gax-httpjson/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-httpjson - 2.58.0 + 2.59.0 jar GAX (Google Api eXtensions) for Java (HTTP JSON) Google Api eXtensions for Java (HTTP JSON) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.58.0 + 2.59.0 diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java index 170b955c2a..f92bdf299c 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java @@ -124,11 +124,6 @@ public TransportChannelProvider withEndpoint(String endpoint) { return toBuilder().setEndpoint(endpoint).build(); } - @Override - public TransportChannelProvider withUseS2A(boolean useS2A) { - return this; - } - /** @deprecated REST transport channel doesn't support channel pooling */ @Deprecated @Override diff --git a/gax-java/gax/clirr-ignored-differences.xml b/gax-java/gax/clirr-ignored-differences.xml index 6e3b3953ac..e7b4d93d29 100644 --- a/gax-java/gax/clirr-ignored-differences.xml +++ b/gax-java/gax/clirr-ignored-differences.xml @@ -106,15 +106,15 @@ com/google/api/gax/batching/Batcher * - + - 7013 - com/google/api/gax/rpc/EndpointContext - * useS2A() + 7002 + com/google/api/gax/rpc/FixedTransportChannelProvider + * withUseS2A(*) - + - 7012 + 7002 com/google/api/gax/rpc/TransportChannelProvider * withUseS2A(*) diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index b74d38adb2..6984440312 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax - 2.58.0 + 2.59.0 jar GAX (Google Api eXtensions) for Java (Core) Google Api eXtensions for Java (Core) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.58.0 + 2.59.0 diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java index 8e7c9a3090..5bce1ac6bb 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java @@ -222,7 +222,6 @@ public static ClientContext create(StubSettings settings) throws IOException { if (transportChannelProvider.needsEndpoint()) { transportChannelProvider = transportChannelProvider.withEndpoint(endpoint); } - transportChannelProvider = transportChannelProvider.withUseS2A(endpointContext.useS2A()); TransportChannel transportChannel = transportChannelProvider.getTransportChannel(); ApiCallContext defaultCallContext = diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java index 0148c07a01..dd6c199b35 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java @@ -30,7 +30,6 @@ package com.google.api.gax.rpc; import com.google.api.core.InternalApi; -import com.google.api.gax.rpc.internal.EnvironmentProvider; import com.google.api.gax.rpc.mtls.MtlsProvider; import com.google.auth.Credentials; import com.google.auth.oauth2.ComputeEngineCredentials; @@ -66,9 +65,6 @@ public abstract class EndpointContext { "The configured universe domain (%s) does not match the universe domain found in the credentials (%s). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."; public static final String UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE = "Unable to retrieve the Universe Domain from the Credentials."; - // This environment variable is a temporary measure. It will be removed when the feature is - // non-experimental. - static final String S2A_ENV_ENABLE_USE_S2A = "EXPERIMENTAL_GOOGLE_API_USE_S2A"; public static EndpointContext getDefaultInstance() { return INSTANCE; @@ -104,11 +100,6 @@ public static EndpointContext getDefaultInstance() { @Nullable public abstract String transportChannelProviderEndpoint(); - abstract boolean useS2A(); - - @Nullable - abstract EnvironmentProvider envProvider(); - @Nullable public abstract String mtlsEndpoint(); @@ -128,8 +119,7 @@ public static EndpointContext getDefaultInstance() { public static Builder newBuilder() { return new AutoValue_EndpointContext.Builder() .setSwitchToMtlsEndpointAllowed(false) - .setUsingGDCH(false) - .setEnvProvider(System::getenv); + .setUsingGDCH(false); } /** Configure the existing EndpointContext to be using GDC-H */ @@ -218,10 +208,6 @@ public abstract static class Builder { public abstract Builder setResolvedUniverseDomain(String resolvedUniverseDomain); - abstract Builder setUseS2A(boolean useS2A); - - abstract Builder setEnvProvider(EnvironmentProvider envProvider); - abstract String serviceName(); abstract String universeDomain(); @@ -230,10 +216,6 @@ public abstract static class Builder { abstract String transportChannelProviderEndpoint(); - abstract boolean useS2A(); - - abstract EnvironmentProvider envProvider(); - abstract String mtlsEndpoint(); abstract boolean switchToMtlsEndpointAllowed(); @@ -272,10 +254,6 @@ private String determineUniverseDomain() { /** Determines the fully resolved endpoint and universe domain values */ private String determineEndpoint() throws IOException { - if (shouldUseS2A()) { - return mtlsEndpoint(); - } - MtlsProvider mtlsProvider = mtlsProvider() == null ? new MtlsProvider() : mtlsProvider(); // TransportChannelProvider's endpoint will override the ClientSettings' endpoint String customEndpoint = @@ -310,32 +288,6 @@ private String determineEndpoint() throws IOException { return endpoint; } - /** Determine if S2A can be used */ - @VisibleForTesting - boolean shouldUseS2A() { - // If EXPERIMENTAL_GOOGLE_API_USE_S2A is not set to true, skip S2A. - String s2AEnv; - s2AEnv = envProvider().getenv(S2A_ENV_ENABLE_USE_S2A); - boolean s2AEnabled = Boolean.parseBoolean(s2AEnv); - if (!s2AEnabled) { - return false; - } - - // Skip S2A when using GDC-H - if (usingGDCH()) { - return false; - } - - // If a custom endpoint is being used, skip S2A. - if (!Strings.isNullOrEmpty(clientSettingsEndpoint()) - || !Strings.isNullOrEmpty(transportChannelProviderEndpoint())) { - return false; - } - - // mTLS via S2A is not supported in any universe other than googleapis.com. - return mtlsEndpoint().contains(Credentials.GOOGLE_DEFAULT_UNIVERSE); - } - // Default to port 443 for HTTPS. Using HTTP requires explicitly setting the endpoint private String buildEndpointTemplate(String serviceName, String resolvedUniverseDomain) { return serviceName + "." + resolvedUniverseDomain + ":443"; @@ -369,7 +321,6 @@ public EndpointContext build() throws IOException { // The Universe Domain is used to resolve the Endpoint. It should be resolved first setResolvedUniverseDomain(determineUniverseDomain()); setResolvedEndpoint(determineEndpoint()); - setUseS2A(shouldUseS2A()); return autoBuild(); } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java index 2f70c06b5f..0bf6205dd9 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java @@ -89,12 +89,6 @@ public TransportChannelProvider withEndpoint(String endpoint) { "FixedTransportChannelProvider doesn't need an endpoint"); } - @Override - public TransportChannelProvider withUseS2A(boolean useS2A) throws UnsupportedOperationException { - // Overriden for technical reasons. This method is a no-op for FixedTransportChannelProvider. - return this; - } - /** @deprecated FixedTransportChannelProvider doesn't support ChannelPool configuration */ @Deprecated @Override diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java index f58acffc54..21f3c31f63 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java @@ -97,11 +97,6 @@ public interface TransportChannelProvider { */ TransportChannelProvider withEndpoint(String endpoint); - /** Sets whether to use S2A when constructing a new {@link TransportChannel}. */ - default TransportChannelProvider withUseS2A(boolean useS2A) { - throw new UnsupportedOperationException("S2A is not supported"); - } - /** * Reports whether this provider allows pool size customization. * diff --git a/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties b/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties index 75b882d8a4..3ddbffe0b8 100644 --- a/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties +++ b/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties @@ -3,7 +3,8 @@ Args = --enable-url-protocols=https,http \ org.junit.platform.engine.TestTag,\ com.google.api.gax.core.GaxProperties,\ com.google.common.base.Platform,\ - com.google.common.base.Platform$JdkPatternCompiler \ + com.google.common.base.Platform$JdkPatternCompiler,\ + com.google.protobuf.RuntimeVersion \ --features=com.google.api.gax.nativeimage.OpenCensusFeature,\ com.google.api.gax.nativeimage.GoogleJsonClientFeature \ --add-modules=jdk.httpserver diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java index facc93ed86..826864a49c 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java @@ -195,17 +195,6 @@ public TransportChannelProvider withEndpoint(String endpoint) { endpoint); } - @Override - public TransportChannelProvider withUseS2A(boolean useS2A) { - return new FakeTransportProvider( - this.transport, - this.executor, - this.shouldAutoClose, - this.headers, - this.credentials, - this.endpoint); - } - @Override public boolean acceptsPoolSize() { return false; diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/EndpointContextTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/EndpointContextTest.java index 5561427dde..3276e4a73e 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/EndpointContextTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/EndpointContextTest.java @@ -33,7 +33,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.rpc.internal.EnvironmentProvider; import com.google.api.gax.rpc.mtls.MtlsProvider; import com.google.api.gax.rpc.testing.FakeMtlsProvider; import com.google.auth.Credentials; @@ -455,97 +454,4 @@ void hasValidUniverseDomain_computeEngineCredentials_noValidationOnUniverseDomai .build(); assertDoesNotThrow(() -> endpointContext.validateUniverseDomain(credentials, statusCode)); } - - @Test - void shouldUseS2A_envVarNotSet_returnsFalse() throws IOException { - EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); - Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("false"); - defaultEndpointContextBuilder = - defaultEndpointContextBuilder - .setEnvProvider(envProvider) - .setClientSettingsEndpoint("") - .setTransportChannelProviderEndpoint("") - .setUsingGDCH(false); - Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); - } - - @Test - void shouldUseS2A_UsingGDCH_returnsFalse() throws IOException { - EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); - Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); - defaultEndpointContextBuilder = - defaultEndpointContextBuilder - .setEnvProvider(envProvider) - .setClientSettingsEndpoint("") - .setTransportChannelProviderEndpoint("") - .setUsingGDCH(true); - Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); - } - - @Test - void shouldUseS2A_customEndpointSetViaClientSettings_returnsFalse() throws IOException { - EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); - Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); - defaultEndpointContextBuilder = - defaultEndpointContextBuilder - .setEnvProvider(envProvider) - .setClientSettingsEndpoint("test.endpoint.com:443") - .setTransportChannelProviderEndpoint("") - .setUsingGDCH(false); - Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); - } - - @Test - void shouldUseS2A_customEndpointSetViaTransportChannelProvider_returnsFalse() throws IOException { - EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); - Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); - defaultEndpointContextBuilder = - defaultEndpointContextBuilder - .setEnvProvider(envProvider) - .setClientSettingsEndpoint("") - .setTransportChannelProviderEndpoint("test.endpoint.com:443") - .setUsingGDCH(false); - Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); - } - - @Test - void shouldUseS2A_mtlsEndpointEmpty_returnsFalse() throws IOException { - EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); - Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); - defaultEndpointContextBuilder = - defaultEndpointContextBuilder - .setEnvProvider(envProvider) - .setClientSettingsEndpoint("") - .setTransportChannelProviderEndpoint("") - .setMtlsEndpoint("") - .setUsingGDCH(false); - Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); - } - - @Test - void shouldUseS2A_mtlsEndpointNotGoogleDefaultUniverse_returnsFalse() throws IOException { - EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); - Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); - defaultEndpointContextBuilder = - defaultEndpointContextBuilder - .setEnvProvider(envProvider) - .setClientSettingsEndpoint("") - .setTransportChannelProviderEndpoint("") - .setMtlsEndpoint("test.mtls.abcd.com:443") - .setUsingGDCH(false); - Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); - } - - @Test - void shouldUseS2A_success() throws IOException { - EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); - Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); - defaultEndpointContextBuilder = - defaultEndpointContextBuilder - .setEnvProvider(envProvider) - .setClientSettingsEndpoint("") - .setTransportChannelProviderEndpoint("") - .setUsingGDCH(false); - Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isTrue(); - } } diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 7dc3f5b209..351772044d 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,14 +4,14 @@ com.google.api gax-parent pom - 2.58.0 + 2.59.0 GAX (Google Api eXtensions) for Java (Parent) Google Api eXtensions for Java (Parent) com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.api api-common - 2.41.0 + 2.42.0 com.google.auth @@ -98,24 +98,24 @@ com.google.api gax - 2.58.0 + 2.59.0 com.google.api gax - 2.58.0 + 2.59.0 test-jar testlib com.google.api.grpc proto-google-common-protos - 2.49.0 + 2.50.0 com.google.api.grpc grpc-google-common-protos - 2.49.0 + 2.50.0 io.grpc diff --git a/generation_config.yaml b/generation_config.yaml index b6b681dc07..f143da2ea6 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,4 +1,4 @@ -googleapis_commitish: 6b5d85c66e0885b1665040f6f80b2401f60c1068 +googleapis_commitish: f17e0aa970506b47d0552574ea7f57a440aa71f2 # the libraries are ordered with respect to library name, which is # java-{library.library_name} or java-{library.api-shortname} when # library.library_name is not defined. diff --git a/hermetic_build/DEVELOPMENT.md b/hermetic_build/DEVELOPMENT.md index 1969bbcdfb..6bdb46a272 100644 --- a/hermetic_build/DEVELOPMENT.md +++ b/hermetic_build/DEVELOPMENT.md @@ -82,6 +82,21 @@ as per [POSIX env var definition](https://pubs.opengroup.org/onlinepubs/96999197 mv /path/to/jar "${HOME}/.library_generation/gapic-generator-java.jar" ``` +#### Put the protobuf compiler in its well-known location +1. Download protobuf compiler from [GitHub releases](https://github.com/protocolbuffers/protobuf/releases). +2. Move the folder into its well-know location. + + ```shell + unzip /path/to/zipfile -d "${HOME}/.library_generation/" + ``` +#### Put the GRPC plugin in its well-known location +1. Download GRPC plugin from [Maven Central](https://central.sonatype.com/artifact/io.grpc/protoc-gen-grpc-java/versions). +2. Move the folder into its well-know location. + + ```shell + mv /path/to/protoc-gen-grpc-java.exe "${HOME}/.library_generation/protoc-gen-grpc-java.exe" + ``` + #### Put the java formatter jar in its well-known location 1. Download google-java-format-{version}-all-deps.jar from [Maven Central](https://central.sonatype.com/artifact/com.google.googlejavaformat/google-java-format) @@ -197,11 +212,6 @@ python hermetic_build/library_generation/cli/entry_point.py generate \ --repository-path=/workspace \ --api-definitions-path=/workspace/apis ``` - Note that if you specify the generator version using environment variable, - `-e GENERATOR_VERSION="${LOCAL_GENERATOR_VERSION}"` in the above example, - you should not set `gapic_generator_version` and `protoc_version` in the - generation configuration because values in the generation configuration will - take precedence. # Debug the library generation container If you are working on changing the way the containers are created, you may want diff --git a/hermetic_build/README.md b/hermetic_build/README.md index 583e766bdf..74b53b1ee7 100644 --- a/hermetic_build/README.md +++ b/hermetic_build/README.md @@ -7,10 +7,6 @@ Running the docker image built from `hermetic_build/library_generation` directory, you can generate a repository containing GAPIC client libraries (a monorepo, for example, google-cloud-java) from a configuration file. -Instead of running the docker image, if you prefer running the underlying python -scripts directly, please refer to the [development guide](DEVELOPMENT.md#run-the-script) -for additional instructions. - ## Environment - OS: Linux @@ -18,20 +14,36 @@ for additional instructions. ## Prerequisites -In order to generate a version for each library, a versions.txt has to exist +### Generation configuration + +A generation configuration file is required to generate GAPIC Client Libraries. + +Please refer to [Generation configuration yaml](#generation-configuration-yaml--generation-config-path---optional) +for more information. + +### versions.txt + +In order to generate a version for each library, a `versions.txt` has to exist in `repository-path`. Please refer to [Repository path](#repository-path--repositorypath---optional) for more information. ## Parameters to generate a repository using the docker image -### Generation configuration yaml (`generation-config-path`) +### Generation configuration yaml (`generation-config-path`), optional An absolute or relative path to a configuration file containing parameters to generate the repository. Please refer to [Configuration to generate a repository](#configuration-to-generate-a-repository) for more information. +The default value is `$(pwd)/generation_config.yaml`, i.e., `generation_config.yaml` +in the current working directory. + +This will raise `FileNotFoundError` if the specified generation config does not +exist or, in case `generation-config-path` is not specified, the default +generation config does not exist. + ### Repository path (`repository-path`), optional The path to where the generated repository goes. @@ -41,8 +53,8 @@ For example, `cd google-cloud-java && python /path/to/entry_point.py ...` withou specifying the `--repository_path` option will modify the `google-cloud-java` repository the user `cd`'d into. -Note that versions.txt has to exist in `repository_path` in order to generate -right version for each library. +Note that `versions.txt` has to exist in `repository_path` in order to generate +the right version for each library. Please refer [here](go/java-client-releasing#versionstxt-manifest) for more info of versions.txt. @@ -108,13 +120,11 @@ The repository level parameters define the version of API definition (proto) and tools. They are shared by library level parameters. -| Name | Required | Notes | -|:------------------------|:--------:|:---------------------------------------------| -| gapic_generator_version | No | set through env variable if not specified | -| protoc_version | No | inferred from the generator if not specified | -| grpc_version | No | inferred from the generator if not specified | -| googleapis_commitish | Yes | | -| libraries_bom_version | No | empty string if not specified | +| Name | Required | Notes | +|:------------------------|:--------:|:------------------------------------------| +| gapic_generator_version | No | set through env variable if not specified | +| googleapis_commitish | Yes | | +| libraries_bom_version | No | empty string if not specified | ### Library level parameters @@ -162,7 +172,6 @@ The GAPIC level parameters define how to generate a GAPIC library. ```yaml gapic_generator_version: 2.34.0 -protoc_version: 25.2 googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 libraries_bom_version: 26.37.0 libraries: @@ -206,7 +215,7 @@ libraries: --quiet \ -u "$(id -u):$(id -g)" \ -v "$(pwd):/workspace" \ - -v /path/to/api_definition:/workspace \ + -v /path/to/api_definition:/workspace/apis \ gcr.io/cloud-devrel-public-resources/java-library-generation:image-tag ``` @@ -216,7 +225,7 @@ libraries: * `-v "$(pwd):/workspace"` maps the host machine's current working directory to the /workspace folder. The image is configured to perform changes in this directory. - * `-v /path/to/api_definition:/workspace` maps the host machine's API + * `-v /path/to/api_definition:/workspace/apis` maps the host machine's API definitions folder to `/workspace/apis` folder. 3. An advanced example: diff --git a/hermetic_build/common/cli/get_changed_libraries.py b/hermetic_build/common/cli/get_changed_libraries.py index cf92cf0853..f9b3d40013 100644 --- a/hermetic_build/common/cli/get_changed_libraries.py +++ b/hermetic_build/common/cli/get_changed_libraries.py @@ -72,10 +72,6 @@ def create( baseline_config=from_yaml(baseline_generation_config_path), current_config=from_yaml(current_generation_config_path), ) - changed_libraries = config_change.get_changed_libraries() - if changed_libraries is None: - print("No changed library.") - return click.echo(",".join(config_change.get_changed_libraries())) diff --git a/hermetic_build/common/model/config_change.py b/hermetic_build/common/model/config_change.py index 7ddc338448..08f9400b55 100644 --- a/hermetic_build/common/model/config_change.py +++ b/hermetic_build/common/model/config_change.py @@ -62,7 +62,6 @@ def __init__(self, commit: Commit, libraries: set[str]): class ConfigChange: - ALL_LIBRARIES_CHANGED = None def __init__( self, @@ -74,16 +73,16 @@ def __init__( self.baseline_config = baseline_config self.current_config = current_config - def get_changed_libraries(self) -> Optional[list[str]]: + def get_changed_libraries(self) -> list[str]: """ Returns a unique, sorted list of library name of changed libraries. - None if there is a repository level change, which means all libraries - in the current_config will be generated. :return: library names of change libraries. """ if ChangeType.REPO_LEVEL_CHANGE in self.change_to_libraries: - return ConfigChange.ALL_LIBRARIES_CHANGED + return [ + library.get_library_name() for library in self.current_config.libraries + ] library_names = set() for change_type, library_changes in self.change_to_libraries.items(): if change_type == ChangeType.GOOGLEAPIS_COMMIT: @@ -106,7 +105,7 @@ def get_qualified_commits( :param repo_url: the repository contains the commit history. :return: QualifiedCommit objects. """ - with tempfile.TemporaryDirectory() as tmp_dir: + with tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as tmp_dir: # we only need commit history, thus a shadow clone is enough. repo = Repo.clone_from(url=repo_url, to_path=tmp_dir, filter=["blob:none"]) commit = repo.commit(self.current_config.googleapis_commitish) @@ -122,6 +121,7 @@ def get_qualified_commits( if len(commit_parents) == 0: break commit = commit_parents[0] + repo.close() return qualified_commits def __get_library_names_from_qualified_commits(self) -> list[str]: diff --git a/hermetic_build/common/model/generation_config.py b/hermetic_build/common/model/generation_config.py index 562e20ce3f..c8aaf6b2ad 100644 --- a/hermetic_build/common/model/generation_config.py +++ b/hermetic_build/common/model/generation_config.py @@ -39,8 +39,6 @@ def __init__( libraries: list[LibraryConfig], gapic_generator_version: Optional[str] = None, libraries_bom_version: Optional[str] = None, - grpc_version: Optional[str] = None, - protoc_version: Optional[str] = None, ): self.googleapis_commitish = googleapis_commitish self.libraries_bom_version = ( @@ -50,8 +48,6 @@ def __init__( gapic_generator_version ) self.libraries = libraries - self.grpc_version = grpc_version - self.protoc_version = protoc_version # explicit set to None so that we can compute the # value in getter. self.__contains_common_protos = None @@ -172,8 +168,6 @@ def from_yaml(path_to_yaml: str) -> GenerationConfig: config, "googleapis_commitish", REPO_LEVEL_PARAMETER ), gapic_generator_version=__optional(config, GAPIC_GENERATOR_VERSION, None), - grpc_version=__optional(config, "grpc_version", None), - protoc_version=__optional(config, "protoc_version", None), libraries_bom_version=__optional(config, LIBRARIES_BOM_VERSION, None), libraries=parsed_libraries, ) diff --git a/hermetic_build/common/requirements.txt b/hermetic_build/common/requirements.txt index 9b79817c1b..ed6b65f69b 100644 --- a/hermetic_build/common/requirements.txt +++ b/hermetic_build/common/requirements.txt @@ -44,9 +44,9 @@ mypy-extensions==1.0.0 \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 # via black -packaging==24.1 \ - --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ - --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 +packaging==24.2 \ + --hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \ + --hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f # via black parameterized==0.9.0 \ --hash=sha256:4e0758e3d41bea3bbd05ec14fc2c24736723f243b28d702081aef438c9372b1b \ diff --git a/hermetic_build/common/tests/model/config_change_unit_tests.py b/hermetic_build/common/tests/model/config_change_unit_tests.py index 3abc603141..3cae76626c 100644 --- a/hermetic_build/common/tests/model/config_change_unit_tests.py +++ b/hermetic_build/common/tests/model/config_change_unit_tests.py @@ -39,10 +39,26 @@ def test_get_changed_libraries_with_repo_level_change_returns_all_libraries_chan ], }, baseline_config=ConfigChangeTest.__get_a_gen_config(), - current_config=ConfigChangeTest.__get_a_gen_config(), + current_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish="", + libraries=[ + ConfigChangeTest.__get_a_library_config( + library_name="gke-backup", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/gkebackup/v1") + ], + ), + ConfigChangeTest.__get_a_library_config( + library_name="test-library", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/gkebackup/v1") + ], + ), + ], + ), ) self.assertEqual( - ConfigChange.ALL_LIBRARIES_CHANGED, + ["gke-backup", "test-library"], config_change.get_changed_libraries(), ) @@ -293,8 +309,6 @@ def __get_a_gen_config( return GenerationConfig( gapic_generator_version="", googleapis_commitish=googleapis_commitish, - grpc_version="", - protoc_version="", libraries=libraries, ) diff --git a/hermetic_build/common/tests/model/generation_config_unit_tests.py b/hermetic_build/common/tests/model/generation_config_unit_tests.py index 94edd934a0..e769a9a723 100644 --- a/hermetic_build/common/tests/model/generation_config_unit_tests.py +++ b/hermetic_build/common/tests/model/generation_config_unit_tests.py @@ -74,7 +74,6 @@ def test_generation_config_set_generator_version_from_env(self): def test_from_yaml_succeeds(self): config = from_yaml(f"{test_config_dir}/generation_config.yaml") self.assertEqual("2.34.0", config.gapic_generator_version) - self.assertEqual(25.2, config.protoc_version) self.assertEqual( "1a45bf7393b52407188c82e63101db7dc9c72026", config.googleapis_commitish ) diff --git a/hermetic_build/common/tests/resources/test-config/generation_config.yaml b/hermetic_build/common/tests/resources/test-config/generation_config.yaml index 168c8fd9a5..94fb1c8337 100644 --- a/hermetic_build/common/tests/resources/test-config/generation_config.yaml +++ b/hermetic_build/common/tests/resources/test-config/generation_config.yaml @@ -1,5 +1,4 @@ gapic_generator_version: 2.34.0 -protoc_version: 25.2 googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 libraries_bom_version: 26.37.0 libraries: diff --git a/hermetic_build/common/tests/utils/generation_config_comparator_unit_tests.py b/hermetic_build/common/tests/utils/generation_config_comparator_unit_tests.py index 00edb511eb..4d45c6531c 100644 --- a/hermetic_build/common/tests/utils/generation_config_comparator_unit_tests.py +++ b/hermetic_build/common/tests/utils/generation_config_comparator_unit_tests.py @@ -39,15 +39,11 @@ def setUp(self) -> None: self.baseline_config = GenerationConfig( gapic_generator_version="", googleapis_commitish="", - grpc_version="", - protoc_version="", libraries=[self.baseline_library], ) self.current_config = GenerationConfig( gapic_generator_version="", googleapis_commitish="", - grpc_version="", - protoc_version="", libraries=[self.current_library], ) diff --git a/hermetic_build/library_generation/cli/entry_point.py b/hermetic_build/library_generation/cli/entry_point.py index e568f831ab..1d0e9f7de9 100644 --- a/hermetic_build/library_generation/cli/entry_point.py +++ b/hermetic_build/library_generation/cli/entry_point.py @@ -78,28 +78,18 @@ def generate( api_definitions_path: str, ): """ - Compare baseline generation config and current generation config and - generate changed libraries based on current generation config. + Generate libraries based on a generation config. - If baseline generation config is not specified but current generation - config is specified, generate all libraries if `library_names` is not - specified, based on current generation config. - - If current generation config is not specified but baseline generation - config is specified, raise FileNotFoundError because current generation - config should be the source of truth of library generation. - - If both baseline generation config and current generation config are not - specified, generate all libraries based on the default generation config, - which is generation_config.yaml in the current working directory. + If the `generation-config-path` is not specified the default generation + config, `$(pwd)/generation_config.yaml`, will be used. If `library_names` is specified, only libraries whose name can be found in - the current generation config or default generation config, if current - generation config is not specified, will be generated. Changed libraries - will be ignored even if baseline and current generation config are - specified. + the generation config will be generated; otherwise all libraries in the + generation config will be generated. - Raise FileNotFoundError if the default config does not exist. + :raise FileNotFoundError if the specified generation config does not exist + or, in case `generation-config-path` is not specified, the default + generation config does not exist. """ __generate_repo_impl( generation_config_path=generation_config_path, diff --git a/hermetic_build/library_generation/generate_composed_library.py b/hermetic_build/library_generation/generate_composed_library.py index 7cdc9c53d7..ea595a3f98 100755 --- a/hermetic_build/library_generation/generate_composed_library.py +++ b/hermetic_build/library_generation/generate_composed_library.py @@ -59,7 +59,6 @@ def generate_composed_library( :return None """ output_folder = repo_config.output_folder - base_arguments = __construct_tooling_arg(config=config) owlbot_cli_source_folder = util.sh_util("mktemp -d") os.makedirs(f"{library_path}", exist_ok=True) for gapic in library.get_sorted_gapic_configs(): @@ -81,7 +80,7 @@ def generate_composed_library( ) temp_destination_path = f"java-{gapic.proto_path.replace('/','-')}" effective_arguments = __construct_effective_arg( - base_arguments=base_arguments, + base_arguments=[], gapic=gapic, gapic_inputs=gapic_inputs, temp_destination_path=temp_destination_path, @@ -120,19 +119,6 @@ def generate_composed_library( ) -def __construct_tooling_arg(config: GenerationConfig) -> List[str]: - """ - Construct arguments of tooling versions used in generate_library.sh - :param config: the generation config - :return: arguments containing tooling versions - """ - arguments = [] - arguments += util.create_argument("grpc_version", config) - arguments += util.create_argument("protoc_version", config) - - return arguments - - def __construct_effective_arg( base_arguments: List[str], gapic: GapicConfig, diff --git a/hermetic_build/library_generation/generate_library.sh b/hermetic_build/library_generation/generate_library.sh index f5cae1ba5a..2625021ea6 100755 --- a/hermetic_build/library_generation/generate_library.sh +++ b/hermetic_build/library_generation/generate_library.sh @@ -14,14 +14,6 @@ case $key in destination_path="$2" shift ;; - --protoc_version) - protoc_version="$2" - shift - ;; - --grpc_version) - grpc_version="$2" - shift - ;; --proto_only) proto_only="$2" shift @@ -71,14 +63,6 @@ script_dir=$(dirname "$(readlink -f "$0")") source "${script_dir}"/utils/utilities.sh output_folder="$(get_output_folder)" -if [ -z "${protoc_version}" ]; then - protoc_version=$(get_protoc_version) -fi - -if [ -z "${grpc_version}" ]; then - grpc_version=$(get_grpc_version) -fi - if [ -z "${proto_only}" ]; then proto_only="false" fi @@ -171,16 +155,14 @@ case "${proto_path}" in proto_files="${proto_files//${removed_proto}/}" ;; esac -# download gapic-generator-java, protobuf and grpc plugin. -# the download_tools function will create the environment variables "protoc_path" -# and "grpc_path", to be used in the protoc calls below. -download_tools "${protoc_version}" "${grpc_version}" "${os_architecture}" + +protoc_path=$(get_protoc_location) ##################### Section 1 ##################### # generate grpc-*/ ##################################################### if [[ ! "${transport}" == "rest" ]]; then # do not need to generate grpc-* if the transport is `rest`. - "${protoc_path}"/protoc "--plugin=protoc-gen-rpc-plugin=${grpc_path}" \ + "${protoc_path}"/protoc "--plugin=protoc-gen-rpc-plugin=$(get_grpc_plugin_location)" \ "--rpc-plugin_out=:${temp_destination_path}/java_grpc.jar" \ ${proto_files} # Do not quote because this variable should not be treated as one long string. # unzip java_grpc.jar to grpc-*/src/main/java diff --git a/hermetic_build/library_generation/owlbot/synthtool/languages/java.py b/hermetic_build/library_generation/owlbot/synthtool/languages/java.py index 3b8d321937..ca1f879e32 100644 --- a/hermetic_build/library_generation/owlbot/synthtool/languages/java.py +++ b/hermetic_build/library_generation/owlbot/synthtool/languages/java.py @@ -15,7 +15,6 @@ import os import xml.etree.ElementTree as ET import re -import requests import yaml import synthtool as s import synthtool.gcp as gcp @@ -123,30 +122,6 @@ def fix_grpc_headers(grpc_root: Path, package_name: str = "unused") -> None: ) -def latest_maven_version(group_id: str, artifact_id: str) -> Optional[str]: - """Helper function to find the latest released version of a Maven artifact. - - Fetches metadata from Maven Central and parses out the latest released - version. - - Args: - group_id (str): The groupId of the Maven artifact - artifact_id (str): The artifactId of the Maven artifact - - Returns: - The latest version of the artifact as a string or None - """ - group_path = "/".join(group_id.split(".")) - url = ( - f"https://repo1.maven.org/maven2/{group_path}/{artifact_id}/maven-metadata.xml" - ) - response = requests.get(url) - if response.status_code >= 400: - return "0.0.0" - - return version_from_maven_metadata(response.text) - - def version_from_maven_metadata(metadata: str) -> Optional[str]: """Helper function to parse the latest released version from the Maven metadata XML file. @@ -200,16 +175,6 @@ def _common_template_metadata() -> Dict[str, Any]: repo_metadata = common._load_repo_metadata() if repo_metadata: metadata["repo"] = repo_metadata - group_id, artifact_id = repo_metadata["distribution_name"].split(":") - - metadata["latest_version"] = latest_maven_version( - group_id=group_id, artifact_id=artifact_id - ) - - metadata["latest_bom_version"] = latest_maven_version( - group_id="com.google.cloud", - artifact_id="libraries-bom", - ) metadata["samples"] = samples.all_samples(["samples/**/src/main/java/**/*.java"]) metadata["snippets"] = snippets.all_snippets( diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh b/hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh index 561a313040..91434688cc 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh @@ -28,11 +28,23 @@ function update_config() { sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" } +# Update an action to a new version in GitHub action. +function update_action() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + # use a different delimiter because the key_word contains "/". + sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}" +} + # The parameters of this script is: # 1. base_branch, the base branch of the result pull request. # 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java # 3. [optional] generation_config, the path to the generation configuration, # the default value is generation_config.yaml in the repository root. +# 4. [optional] workflow, the library generation workflow file, +# the default value is .github/workflows/hermetic_library_generation.yaml. while [[ $# -gt 0 ]]; do key="$1" case "${key}" in @@ -48,6 +60,10 @@ case "${key}" in generation_config="$2" shift ;; + --workflow) + workflow="$2" + shift + ;; *) echo "Invalid option: [$1]" exit 1 @@ -71,21 +87,34 @@ if [ -z "${generation_config}" ]; then echo "Use default generation config: ${generation_config}" fi +if [ -z "${workflow}" ]; then + workflow=".github/workflows/hermetic_library_generation.yaml" + echo "Use default library generation workflow file: ${workflow}" +fi + current_branch="generate-libraries-${base_branch}" title="chore: Update generation configuration at $(date)" -# try to find a open pull request associated with the branch +git checkout "${base_branch}" +# Try to find a open pull request associated with the branch pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") -# create a branch if there's no open pull request associated with the +# Create a branch if there's no open pull request associated with the # branch; otherwise checkout the pull request. if [ -z "${pr_num}" ]; then git checkout -b "${current_branch}" + # Push the current branch to remote so that we can + # compare the commits later. + git push -u origin "${current_branch}" else gh pr checkout "${pr_num}" fi +# Only allow fast-forward merging; exit with non-zero result if there's merging +# conflict. +git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" + mkdir tmp-googleapis -# use partial clone because only commit history is needed. +# Use partial clone because only commit history is needed. git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis pushd tmp-googleapis git pull @@ -94,25 +123,43 @@ popd rm -rf tmp-googleapis update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" -# update gapic-generator-java version to the latest +# Update gapic-generator-java version to the latest latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java") update_config "gapic_generator_version" "${latest_version}" "${generation_config}" -# update libraries-bom version to the latest +# Update composite action version to latest gapic-generator-java version +update_action "googleapis/sdk-platform-java/.github/scripts" \ + "${latest_version}" \ + "${workflow}" + +# Update libraries-bom version to the latest latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") update_config "libraries_bom_version" "${latest_version}" "${generation_config}" -git add "${generation_config}" +git add "${generation_config}" "${workflow}" changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then echo "The latest generation config is not changed." echo "Skip committing to the pull request." +else + git commit -m "${title}" +fi + +# There are potentially at most two commits: merge commit and change commit. +# We want to exit the script if no commit happens (otherwise this will be an +# infinite loop). +# `git cherry` is a way to find whether the local branch has commits that are +# not in the remote branch. +# If we find any such commit, push them to remote branch. +unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l) +if [[ "${unpushed_commit}" -eq 0 ]]; then + echo "No unpushed commits, exit" exit 0 fi -git commit -m "${title}" + if [ -z "${pr_num}" ]; then git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" - git fetch -q --unshallow remote_repo + git fetch -q remote_repo git push -f remote_repo "${current_branch}" gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" else diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/update_generation_config.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/update_generation_config.yaml index 0dbdc19a4a..3c5051538a 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/update_generation_config.yaml +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/update_generation_config.yaml @@ -28,6 +28,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - name: Update params in generation config to latest shell: bash diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/renovate.json b/hermetic_build/library_generation/owlbot/templates/java_library/renovate.json index cb92a78173..57929084fd 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/renovate.json +++ b/hermetic_build/library_generation/owlbot/templates/java_library/renovate.json @@ -44,16 +44,6 @@ ], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" - }, - { - "fileMatch": [ - "^.github/workflows/hermetic_library_generation.yaml$" - ], - "matchStrings": [ - "uses: googleapis/sdk-platform-java/.github/scripts@v(?.+?)\\n" - ], - "depNameTemplate": "com.google.api:gapic-generator-java", - "datasourceTemplate": "maven" } ], "packageRules": [ @@ -114,13 +104,6 @@ "^com.fasterxml.jackson.core" ], "groupName": "jackson dependencies" - }, - { - "matchPackagePatterns": [ - "^com.google.api:gapic-generator-java", - "^com.google.cloud:sdk-platform-java-config" - ], - "groupName": "SDK platform Java dependencies" } ], "semanticCommits": true, diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml b/hermetic_build/library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml index 110250d003..95c15422bf 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml +++ b/hermetic_build/library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml @@ -1,5 +1,6 @@ {% set group_id = metadata['repo']['distribution_name'].split(':')|first -%} {% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%} +{% set version = metadata['library_version'] -%} 4.0.0 @@ -31,7 +32,7 @@ {{ group_id }} {{ artifact_id }} - {{ metadata['latest_version'] }} + {{ version }} diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/samples/snapshot/pom.xml b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snapshot/pom.xml index 62a83b440e..f5bbc2554a 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/samples/snapshot/pom.xml +++ b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snapshot/pom.xml @@ -1,5 +1,6 @@ {% set group_id = metadata['repo']['distribution_name'].split(':')|first -%} {% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%} +{% set version = metadata['library_version'] -%} 4.0.0 @@ -30,7 +31,7 @@ {{ group_id }} {{ artifact_id }} - {{ metadata['latest_version'] }} + {{ version }} diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/samples/snippets/pom.xml b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snippets/pom.xml index c6b9981507..e636801f41 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/samples/snippets/pom.xml +++ b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snippets/pom.xml @@ -1,5 +1,6 @@ {% set group_id = metadata['repo']['distribution_name'].split(':')|first -%} {% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%} +{% set version = metadata['library_version'] -%} 4.0.0 @@ -30,7 +31,7 @@ {{ group_id }} {{ artifact_id }} - {{ metadata['latest_version'] }} + {{ version }} diff --git a/hermetic_build/library_generation/requirements.in b/hermetic_build/library_generation/requirements.in index 7ab992ea62..9eef0bbd74 100644 --- a/hermetic_build/library_generation/requirements.in +++ b/hermetic_build/library_generation/requirements.in @@ -2,6 +2,4 @@ attrs==24.2.0 click==8.1.7 jinja2==3.1.4 lxml==5.3.0 -PyYAML==6.0.2 -requests==2.32.3 -requests-mock==1.12.1 \ No newline at end of file +PyYAML==6.0.2 \ No newline at end of file diff --git a/hermetic_build/library_generation/requirements.txt b/hermetic_build/library_generation/requirements.txt index ef3d97bedc..4edb128302 100644 --- a/hermetic_build/library_generation/requirements.txt +++ b/hermetic_build/library_generation/requirements.txt @@ -8,125 +8,10 @@ attrs==24.2.0 \ --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 # via -r hermetic_build/library_generation/requirements.in -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 - # via requests -charset-normalizer==3.4.0 \ - --hash=sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621 \ - --hash=sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6 \ - --hash=sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8 \ - --hash=sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912 \ - --hash=sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c \ - --hash=sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b \ - --hash=sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d \ - --hash=sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d \ - --hash=sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95 \ - --hash=sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e \ - --hash=sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565 \ - --hash=sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64 \ - --hash=sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab \ - --hash=sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be \ - --hash=sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e \ - --hash=sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907 \ - --hash=sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0 \ - --hash=sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2 \ - --hash=sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62 \ - --hash=sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62 \ - --hash=sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23 \ - --hash=sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc \ - --hash=sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284 \ - --hash=sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca \ - --hash=sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455 \ - --hash=sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858 \ - --hash=sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b \ - --hash=sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594 \ - --hash=sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc \ - --hash=sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db \ - --hash=sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b \ - --hash=sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea \ - --hash=sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6 \ - --hash=sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920 \ - --hash=sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749 \ - --hash=sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7 \ - --hash=sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd \ - --hash=sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99 \ - --hash=sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242 \ - --hash=sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee \ - --hash=sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129 \ - --hash=sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2 \ - --hash=sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51 \ - --hash=sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee \ - --hash=sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8 \ - --hash=sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b \ - --hash=sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613 \ - --hash=sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742 \ - --hash=sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe \ - --hash=sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3 \ - --hash=sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5 \ - --hash=sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631 \ - --hash=sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7 \ - --hash=sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15 \ - --hash=sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c \ - --hash=sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea \ - --hash=sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417 \ - --hash=sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250 \ - --hash=sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88 \ - --hash=sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca \ - --hash=sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa \ - --hash=sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99 \ - --hash=sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149 \ - --hash=sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41 \ - --hash=sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574 \ - --hash=sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0 \ - --hash=sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f \ - --hash=sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d \ - --hash=sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654 \ - --hash=sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3 \ - --hash=sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19 \ - --hash=sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90 \ - --hash=sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578 \ - --hash=sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9 \ - --hash=sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1 \ - --hash=sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51 \ - --hash=sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719 \ - --hash=sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236 \ - --hash=sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a \ - --hash=sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c \ - --hash=sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade \ - --hash=sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944 \ - --hash=sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc \ - --hash=sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6 \ - --hash=sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6 \ - --hash=sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27 \ - --hash=sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6 \ - --hash=sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2 \ - --hash=sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12 \ - --hash=sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf \ - --hash=sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114 \ - --hash=sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7 \ - --hash=sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf \ - --hash=sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d \ - --hash=sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b \ - --hash=sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed \ - --hash=sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03 \ - --hash=sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4 \ - --hash=sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67 \ - --hash=sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365 \ - --hash=sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a \ - --hash=sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748 \ - --hash=sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b \ - --hash=sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079 \ - --hash=sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482 - # via requests click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via -r hermetic_build/library_generation/requirements.in -idna==3.10 \ - --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 - # via requests jinja2==3.1.4 \ --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d @@ -389,17 +274,3 @@ pyyaml==6.0.2 \ --hash=sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12 \ --hash=sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4 # via -r hermetic_build/library_generation/requirements.in -requests==2.32.3 \ - --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ - --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 - # via - # -r hermetic_build/library_generation/requirements.in - # requests-mock -requests-mock==1.12.1 \ - --hash=sha256:b1e37054004cdd5e56c84454cc7df12b25f90f382159087f4b6915aaeef39563 \ - --hash=sha256:e9e12e333b525156e82a3c852f22016b9158220d2f47454de9cae8a77d371401 - # via -r hermetic_build/library_generation/requirements.in -urllib3==2.2.3 \ - --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ - --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 - # via requests diff --git a/hermetic_build/library_generation/tests/generate_library_unit_tests.py b/hermetic_build/library_generation/tests/generate_library_unit_tests.py index eb2249908c..8c405dd6f8 100644 --- a/hermetic_build/library_generation/tests/generate_library_unit_tests.py +++ b/hermetic_build/library_generation/tests/generate_library_unit_tests.py @@ -39,10 +39,6 @@ def setUp(self): # in its well-known location self.simulated_home = get_bash_call_output("mktemp -d") bash_call(f"mkdir {self.simulated_home}/.library_generation") - bash_call( - f"touch {self.simulated_home}/.library_generation/gapic-generator-java.jar" - ) - # We create a per-test directory where all output files will be created into. # Each folder will be deleted after its corresponding test finishes. test_dir = get_bash_call_output("mktemp -d") @@ -76,34 +72,84 @@ def _run_command_and_get_sdout(self, command, **kwargs): command, stderr=subprocess.PIPE, **kwargs ).stdout.decode()[:-1] - def test_get_grpc_version_with_no_env_var_fails(self): - # the absence of DOCKER_GRPC_VERSION will make this function to fail - result = self._run_command("get_grpc_version") + def test_get_generator_location_with_env_returns_env(self): + os.environ["GAPIC_GENERATOR_LOCATION"] = "/gapic-generator-java" + result = self._run_command_and_get_sdout("get_gapic_generator_location") + self.assertEqual("/gapic-generator-java", result) + os.environ.pop("GAPIC_GENERATOR_LOCATION") + + def test_get_generator_location_without_env_with_local_returns_local(self): + bash_call( + f"touch {self.simulated_home}/.library_generation/gapic-generator-java.jar" + ) + result = self._run_command_and_get_sdout("get_gapic_generator_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/gapic-generator-java.jar", + result, + ) + + def test_get_generator_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_gapic_generator_location") + self.assertEqual(1, result.returncode) + self.assertRegex(result.stdout.decode(), "Can't find GAPIC generator in") + + def test_get_protoc_location_with_env_returns_env(self): + os.environ["DOCKER_PROTOC_LOCATION"] = "/protoc" + result = self._run_command_and_get_sdout("get_protoc_location") + self.assertEqual("/protoc", result) + os.environ.pop("DOCKER_PROTOC_LOCATION") + + def test_get_protoc_location_without_env_with_local_returns_local(self): + bash_call(f"mkdir -p {self.simulated_home}/.library_generation/bin") + result = self._run_command_and_get_sdout("get_protoc_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/bin", + result, + ) + + def test_get_protoc_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_protoc_location") self.assertEqual(1, result.returncode) - self.assertRegex(result.stdout.decode(), "DOCKER_GRPC_VERSION is not set") + self.assertRegex(result.stdout.decode(), "Can't find protoc in") + + def test_get_grpc_plugin_location_with_env_returns_env(self): + os.environ["DOCKER_GRPC_LOCATION"] = "/grpc" + result = self._run_command_and_get_sdout("get_grpc_plugin_location") + self.assertEqual("/grpc", result) + os.environ.pop("DOCKER_GRPC_LOCATION") - def test_get_protoc_version_with_no_env_var_fails(self): - # the absence of DOCKER_PROTOC_VERSION will make this function to fail - result = self._run_command("get_protoc_version") + def test_get_grpc_plugin_location_without_env_with_local_returns_local(self): + bash_call( + f"touch {self.simulated_home}/.library_generation/protoc-gen-grpc-java.exe" + ) + result = self._run_command_and_get_sdout("get_grpc_plugin_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/protoc-gen-grpc-java.exe", + result, + ) + + def test_get_grpc_plugin_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_grpc_plugin_location") self.assertEqual(1, result.returncode) - self.assertRegex(result.stdout.decode(), "DOCKER_PROTOC_VERSION is not set") + self.assertRegex(result.stdout.decode(), "Can't find grpc plugin in") - def test_download_tools_without_baked_generator_fails(self): - # This test has the same structure as - # download_tools_succeed_with_baked_protoc, but meant for - # gapic-generator-java. + def test_get_formatter_location_with_env_returns_env(self): + os.environ["JAVA_FORMATTER_LOCATION"] = "/java-formatter" + result = self._run_command_and_get_sdout("get_java_formatter_location") + self.assertEqual("/java-formatter", result) + os.environ.pop("JAVA_FORMATTER_LOCATION") - test_protoc_version = "1.64.0" - test_grpc_version = "1.64.0" - jar_location = ( - f"{self.simulated_home}/.library_generation/gapic-generator-java.jar" + def test_get_formatter_location_without_env_with_local_returns_local(self): + bash_call( + f"touch {self.simulated_home}/.library_generation/google-java-format.jar" ) - # we expect the function to fail because the generator jar is not found in - # its well-known location. To achieve this, we temporarily remove the fake - # generator jar - bash_call(f"rm {jar_location}") - result = self._run_command( - f"download_tools {test_protoc_version} {test_grpc_version} {self.TEST_ARCHITECTURE}" + result = self._run_command_and_get_sdout("get_java_formatter_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/google-java-format.jar", + result, ) + + def test_get_formatter_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_java_formatter_location") self.assertEqual(1, result.returncode) - self.assertRegex(result.stdout.decode(), "Please configure your environment") + self.assertRegex(result.stdout.decode(), "Can't find Java formatter in") diff --git a/hermetic_build/library_generation/tests/generate_library_unit_tests.sh b/hermetic_build/library_generation/tests/generate_library_unit_tests.sh index a3d95c1be7..68eb9ba40e 100755 --- a/hermetic_build/library_generation/tests/generate_library_unit_tests.sh +++ b/hermetic_build/library_generation/tests/generate_library_unit_tests.sh @@ -23,26 +23,6 @@ extract_folder_name_test() { assertEquals "google-cloud-aiplatform-v1-java" "${folder_name}" } -get_grpc_version_succeed_docker_env_var_test() { - local version_with_docker - local version_without_docker - export DOCKER_GRPC_VERSION="9.9.9" - # get_grpc_version should prioritize DOCKER_GRPC_VERSION - version_with_docker=$(get_grpc_version) - assertEquals "${DOCKER_GRPC_VERSION}" "${version_with_docker}" - unset DOCKER_GRPC_VERSION -} - -get_protoc_version_succeed_docker_env_var_test() { - local version_with_docker - local version_without_docker - export DOCKER_PROTOC_VERSION="9.9.9" - # get_protoc_version should prioritize DOCKER_PROTOC_VERSION - version_with_docker=$(get_protoc_version) - assertEquals "${DOCKER_PROTOC_VERSION}" "${version_with_docker}" - unset DOCKER_PROTOC_VERSION -} - get_gapic_opts_with_rest_test() { local proto_path="${script_dir}/resources/gapic_options" local transport="grpc" @@ -92,14 +72,14 @@ remove_grpc_version_test() { download_protoc_succeed_with_valid_version_linux_test() { download_protoc "23.2" "linux-x86_64" - assertFileOrDirectoryExists "protoc-23.2" - rm -rf "protoc-23.2" + assertFileOrDirectoryExists "bin" + rm -rf "bin" } download_protoc_succeed_with_valid_version_macos_test() { download_protoc "23.2" "osx-x86_64" - assertFileOrDirectoryExists "protoc-23.2" - rm -rf "protoc-23.2" "google" + assertFileOrDirectoryExists "bin" + rm -rf "bin" } download_protoc_failed_with_invalid_version_linux_test() { @@ -114,68 +94,16 @@ download_protoc_failed_with_invalid_arch_test() { assertEquals 1 $((res)) } -download_tools_succeed_with_baked_protoc() { - # This mimics a docker container scenario. - # This test consists of creating an empty /tmp/.../protoc-99.99/bin folder and map - # it to the DOCKER_PROTOC_LOCATION env var (which is treated specially in the - # `download_tools` function). If `DOCKER_PROTOC_VERSION` matches exactly as - # the version passed to `download_protoc`, then we will not download protoc - # but simply have the variable `protoc_path` pointing to DOCKER_PROTOC_LOCATION - # (which we manually created in this test) - export DOCKER_PROTOC_LOCATION=$(mktemp -d) - export DOCKER_PROTOC_VERSION="99.99" - export output_folder=$(get_output_folder) - mkdir "${output_folder}" - local protoc_bin_folder="${DOCKER_PROTOC_LOCATION}/protoc-99.99/bin" - mkdir -p "${protoc_bin_folder}" - - local test_grpc_version="1.64.0" - # we expect download_tools to decide to use DOCKER_PROTOC_LOCATION because - # the protoc version we want to download is the same as DOCKER_PROTOC_VERSION. - # Note that `protoc_bin_folder` is just the expected formatted value that - # download_tools will format using DOCKER_PROTOC_VERSION (via - # download_protoc). - download_tools "99.99" "${test_grpc_version}" "linux-x86_64" - assertEquals "${protoc_bin_folder}" "${protoc_path}" - - rm -rf "${output_folder}" - unset DOCKER_PROTOC_LOCATION - unset DOCKER_PROTOC_VERSION - unset output_folder - unset protoc_path -} - -download_tools_succeed_with_baked_grpc() { - # This test has the same structure as - # download_tools_succeed_with_baked_protoc, but meant for the grpc plugin. - export DOCKER_GRPC_LOCATION=$(mktemp -d) - export DOCKER_GRPC_VERSION="99.99" - export output_folder=$(get_output_folder) - mkdir "${output_folder}" - - local test_protoc_version="1.64.0" - # we expect download_tools to decide to use DOCKER_GRPC_LOCATION because - # the protoc version we want to download is the same as DOCKER_GRPC_VERSION - download_tools "${test_protoc_version}" "99.99" "linux-x86_64" - assertEquals "${DOCKER_GRPC_LOCATION}" "${grpc_path}" - - rm -rf "${output_folder}" - unset DOCKER_GRPC_LOCATION - unset DOCKER_GRPC_VERSION - unset output_folder - unset grpc_path -} - download_grpc_plugin_succeed_with_valid_version_linux_test() { download_grpc_plugin "1.55.1" "linux-x86_64" - assertFileOrDirectoryExists "protoc-gen-grpc-java-1.55.1-linux-x86_64.exe" - rm "protoc-gen-grpc-java-1.55.1-linux-x86_64.exe" + assertFileOrDirectoryExists "protoc-gen-grpc-java.exe" + rm "protoc-gen-grpc-java.exe" } download_grpc_plugin_succeed_with_valid_version_macos_test() { download_grpc_plugin "1.55.1" "osx-x86_64" - assertFileOrDirectoryExists "protoc-gen-grpc-java-1.55.1-osx-x86_64.exe" - rm "protoc-gen-grpc-java-1.55.1-osx-x86_64.exe" + assertFileOrDirectoryExists "protoc-gen-grpc-java.exe" + rm "protoc-gen-grpc-java.exe" } download_grpc_plugin_failed_with_invalid_version_linux_test() { @@ -283,8 +211,6 @@ get_proto_path_from_preprocessed_sources_multiple_proto_dirs_fails() { # One line per test. test_list=( extract_folder_name_test - get_grpc_version_succeed_docker_env_var_test - get_protoc_version_succeed_docker_env_var_test get_gapic_opts_with_rest_test get_gapic_opts_without_rest_test get_gapic_opts_with_non_default_test @@ -293,8 +219,6 @@ test_list=( download_protoc_succeed_with_valid_version_macos_test download_protoc_failed_with_invalid_version_linux_test download_protoc_failed_with_invalid_arch_test - download_tools_succeed_with_baked_protoc - download_tools_succeed_with_baked_grpc download_grpc_plugin_succeed_with_valid_version_linux_test download_grpc_plugin_succeed_with_valid_version_macos_test download_grpc_plugin_failed_with_invalid_version_linux_test diff --git a/hermetic_build/library_generation/tests/integration_tests.py b/hermetic_build/library_generation/tests/integration_tests.py index a940069baa..f738a92093 100644 --- a/hermetic_build/library_generation/tests/integration_tests.py +++ b/hermetic_build/library_generation/tests/integration_tests.py @@ -43,7 +43,7 @@ "google-cloud-java": "chore/test-hermetic-build", "java-bigtable": "chore/test-hermetic-build", } -current_config_name = "current_generation_config.yaml" +generation_config_name = "generation_config.yaml" googleapis_commitish = "113a378d5aad5018876ec0a8cbfd4d6a4f746809" # This variable is used to override the jar created by building the image # with our own downloaded jar in order to lock the integration test to use @@ -87,7 +87,7 @@ def test_entry_point_running_in_container(self): self.__run_entry_point_in_docker_container( repo_location=repo_location, config_location=config_location, - generation_config=current_config_name, + generation_config=generation_config_name, api_definition=api_definitions_path, ) # 4. compare generation result with golden files @@ -303,6 +303,8 @@ def __run_entry_point_in_docker_container( f"{user_id}:{group_id}", "--rm", "--quiet", + "--network", + "none", "-v", f"{repo_location}:/workspace/repo", "-v", @@ -328,7 +330,7 @@ def __get_config_files(cls, path: str) -> list[tuple[str, str]]: repo = sub_dir.name if repo in ["golden", "java-bigtable"]: continue - config = f"{sub_dir}/{current_config_name}" + config = f"{sub_dir}/{generation_config_name}" config_files.append((repo, config)) return config_files diff --git a/hermetic_build/library_generation/tests/owlbot/java_unit_tests.py b/hermetic_build/library_generation/tests/owlbot/java_unit_tests.py index 9b39d0b544..91a827725c 100644 --- a/hermetic_build/library_generation/tests/owlbot/java_unit_tests.py +++ b/hermetic_build/library_generation/tests/owlbot/java_unit_tests.py @@ -21,7 +21,6 @@ import yaml from pathlib import Path -import requests_mock from synthtool.languages import java from library_generation.tests.owlbot import util @@ -69,19 +68,6 @@ class JavaUnitTests(unittest.TestCase): def test_version_from_maven_metadata(self): self.assertEqual("3.3.0", java.version_from_maven_metadata(SAMPLE_METADATA)) - def test_latest_maven_version(self): - with requests_mock.Mocker() as m: - m.get( - "https://repo1.maven.org/maven2/com/google/cloud/libraries-bom/maven-metadata.xml", - text=SAMPLE_METADATA, - ) - self.assertEqual( - "3.3.0", - java.latest_maven_version( - group_id="com.google.cloud", artifact_id="libraries-bom" - ), - ) - @mock.patch.dict(os.environ, {"SYNTHTOOL_TEMPLATES": f"{TEMPLATES_PATH}"}) def test_working_common_templates(self): def assert_valid_xml(file): diff --git a/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/baseline_generation_config.yaml b/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/baseline_generation_config.yaml deleted file mode 100644 index 9a27dd381d..0000000000 --- a/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/baseline_generation_config.yaml +++ /dev/null @@ -1,45 +0,0 @@ -gapic_generator_version: 2.38.1 -protoc_version: 25.2 -googleapis_commitish: a17d4caf184b050d50cacf2b0d579ce72c31ce74 -libraries_bom_version: 26.37.0 -libraries: - - api_shortname: apigeeconnect - name_pretty: Apigee Connect - product_documentation: "https://cloud.google.com/apigee/docs/hybrid/v1.3/apigee-connect/" - api_description: "allows the Apigee hybrid management plane to connect securely to the MART service in the runtime plane without requiring you to expose the MART endpoint on the internet." - release_level: "stable" - library_name: "apigee-connect" - GAPICs: - - proto_path: google/cloud/apigeeconnect/v1 - - - api_shortname: alloydb - name_pretty: AlloyDB - product_documentation: https://cloud.google.com/alloydb/ - api_description: AlloyDB is a fully managed, PostgreSQL-compatible database service - with industry-leading performance, availability, and scale. - rest_documentation: https://cloud.google.com/alloydb/docs/reference/rest - GAPICs: - - proto_path: google/cloud/alloydb/v1 - - proto_path: google/cloud/alloydb/v1alpha - - proto_path: google/cloud/alloydb/v1beta - - - api_shortname: alloydb - name_pretty: AlloyDB connectors - product_documentation: https://cloud.google.com/alloydb/docs - api_description: AlloyDB is a fully-managed, PostgreSQL-compatible database for - demanding transactional workloads. It provides enterprise-grade performance and - availability while maintaining 100% compatibility with open-source PostgreSQL. - library_name: alloydb-connectors - rest_documentation: https://cloud.google.com/alloydb/docs/reference/rest - GAPICs: - - proto_path: google/cloud/alloydb/connectors/v1 - - proto_path: google/cloud/alloydb/connectors/v1alpha - - proto_path: google/cloud/alloydb/connectors/v1beta - - - api_shortname: cloudcontrolspartner - name_pretty: Cloud Controls Partner API - product_documentation: https://cloud.google.com/sovereign-controls-by-partners/docs/sovereign-partners - api_description: Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering. - GAPICs: - - proto_path: google/cloud/cloudcontrolspartner/v1 - - proto_path: google/cloud/cloudcontrolspartner/v1beta diff --git a/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/current_generation_config.yaml b/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/generation_config.yaml similarity index 99% rename from hermetic_build/library_generation/tests/resources/integration/google-cloud-java/current_generation_config.yaml rename to hermetic_build/library_generation/tests/resources/integration/google-cloud-java/generation_config.yaml index adc1d170d6..d71f3863ec 100644 --- a/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/current_generation_config.yaml +++ b/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/generation_config.yaml @@ -1,5 +1,4 @@ gapic_generator_version: 2.38.1 -protoc_version: 25.2 googleapis_commitish: 4ce0ff67a3d4509be641cbe47a35844ddc1268fc libraries_bom_version: 26.37.0 libraries: diff --git a/hermetic_build/library_generation/tests/utilities_unit_tests.py b/hermetic_build/library_generation/tests/utilities_unit_tests.py index eae0e91fcf..a6796b706d 100644 --- a/hermetic_build/library_generation/tests/utilities_unit_tests.py +++ b/hermetic_build/library_generation/tests/utilities_unit_tests.py @@ -302,14 +302,6 @@ def test_prepare_repo_split_repo_success(self): self.assertEqual(["misc"], library_path) shutil.rmtree(repo_config.output_folder) - def test_get_java_generator_location_success(self): - location = util.sh_util("get_gapic_generator_location") - self.assertRegex(location, r"/.library_generation/gapic-generator-java.jar$") - - def test_get_java_formatter_location_success(self): - location = util.sh_util("get_java_formatter_location") - self.assertRegex(location, r"/.library_generation/google-java-format.jar$") - def __setup_postprocessing_prerequisite_files( self, combination: int, diff --git a/hermetic_build/library_generation/utils/utilities.sh b/hermetic_build/library_generation/utils/utilities.sh index a6112070a3..863834f508 100755 --- a/hermetic_build/library_generation/utils/utilities.sh +++ b/hermetic_build/library_generation/utils/utilities.sh @@ -2,9 +2,6 @@ set -eo pipefail utilities_script_dir=$(dirname "$(realpath "${BASH_SOURCE[0]}")") -# The $HOME variable is always set in the OS env as per POSIX specification. -GAPIC_GENERATOR_LOCATION="${HOME}/.library_generation/gapic-generator-java.jar" -JAVA_FORMATTER_LOCATION="${HOME}/.library_generation/google-java-format.jar" # Utility functions used in `generate_library.sh` and showcase generation. extract_folder_name() { @@ -100,115 +97,27 @@ remove_grpc_version() { sed -i.bak 's/value = \"by gRPC proto compiler.*/value = \"by gRPC proto compiler\",/g' {} \; -exec rm {}.bak \; } -# This function returns the version of the grpc plugin to generate the libraries. If -# DOCKER_GRPC_VERSION is set, this will be the version. Otherwise, the script -# will exit since this is a necessary env var -get_grpc_version() { - local grpc_version - if [[ -n "${DOCKER_GRPC_VERSION}" ]]; then - >&2 echo "Using grpc version baked into the container: ${DOCKER_GRPC_VERSION}" - echo "${DOCKER_GRPC_VERSION}" - return - else - >&2 echo "Cannot infer grpc version because DOCKER_GRPC_VERSION is not set" - exit 1 - fi -} - -# This function returns the version of protoc to generate the libraries. If -# DOCKER_PROTOC_VERSION is set, this will be the version. Otherwise, the script -# will exit since this is a necessary env var -get_protoc_version() { - local protoc_version - if [[ -n "${DOCKER_PROTOC_VERSION}" ]]; then - >&2 echo "Using protoc version baked into the container: ${DOCKER_PROTOC_VERSION}" - echo "${DOCKER_PROTOC_VERSION}" - return - else - >&2 echo "Cannot infer protoc version because DOCKER_PROTOC_VERSION is not set" - exit 1 - fi -} - -# Given the versions of the gapic generator, protoc and the protoc-grpc plugin, -# this function will download each one of the tools and create the environment -# variables "protoc_path" and "grpc_path" which are expected upstream. Note that -# if the specified versions of protoc and grpc match DOCKER_PROTOC_VERSION and -# DOCKER_GRPC_VERSION respectively, this function will instead set "protoc_path" -# and "grpc_path" to DOCKER_PROTOC_PATH and DOCKER_GRPC_PATH respectively (no -# download), since the docker image will have downloaded these tools beforehand. -# -# For the case of generator and formatter, no env var will be exported for the -# upstream flow. -# Instead, the jar must be located in the well-known location -# (${HOME}/.library_generation/). -# More information in `library_generation/DEVELOPMENT.md`. -download_tools() { - local protoc_version=$1 - local grpc_version=$2 - local os_architecture=$3 - pushd "${output_folder}" - - # the variable protoc_path is used in generate_library.sh. It is explicitly - # exported to make clear that it is used outside this utilities file. - if [[ "${DOCKER_PROTOC_VERSION}" == "${protoc_version}" ]]; then - # if the specified protoc_version matches the one baked in the docker - # container, we just point protoc_path to its location. - export protoc_path="${DOCKER_PROTOC_LOCATION}/protoc-${protoc_version}/bin" - else - export protoc_path=$(download_protoc "${protoc_version}" "${os_architecture}") - fi - - # similar case with grpc - if [[ "${DOCKER_GRPC_VERSION}" == "${grpc_version}" ]]; then - # if the specified grpc_version matches the one baked in the docker - # container, we just point grpc_path to its location. - export grpc_path="${DOCKER_GRPC_LOCATION}" - else - export grpc_path=$(download_grpc_plugin "${grpc_version}" "${os_architecture}") - fi - - # Here we check whether required tools is stored in the expected location. - # The docker image will prepare jar files in this location. - # This check is meant to ensure integrity of the downstream workflow. - error_if_not_exists "${GAPIC_GENERATOR_LOCATION}" - error_if_not_exists "${JAVA_FORMATTER_LOCATION}" - popd -} - download_protoc() { local protoc_version=$1 local os_architecture=$2 - local protoc_path="${output_folder}/protoc-${protoc_version}/bin" - - if [ ! -d "${protoc_path}" ]; then - # pull proto files and protoc from protobuf repository as maven central - # doesn't have proto files - download_from \ - "https://github.com/protocolbuffers/protobuf/releases/download/v${protoc_version}/protoc-${protoc_version}-${os_architecture}.zip" \ - "protoc-${protoc_version}.zip" \ - "GitHub" - unzip -o -q "protoc-${protoc_version}.zip" -d "protoc-${protoc_version}" - cp -r "protoc-${protoc_version}/include/google" . - rm "protoc-${protoc_version}.zip" - fi - echo "${protoc_path}" - + download_from \ + "https://github.com/protocolbuffers/protobuf/releases/download/v${protoc_version}/protoc-${protoc_version}-${os_architecture}.zip" \ + "protoc-${protoc_version}.zip" \ + "GitHub" + unzip -o -q "protoc-${protoc_version}.zip" + rm "protoc-${protoc_version}.zip" "readme.txt" } download_grpc_plugin() { local grpc_version=$1 local os_architecture=$2 - grpc_filename="protoc-gen-grpc-java-${grpc_version}-${os_architecture}.exe" - if [ ! -f "${grpc_filename}" ]; then - # download protoc-gen-grpc-java plugin from Google maven central mirror. - download_from \ - "https://maven-central.storage-download.googleapis.com/maven2/io/grpc/protoc-gen-grpc-java/${grpc_version}/${grpc_filename}" \ - "${grpc_filename}" - chmod +x "${grpc_filename}" - fi - echo "$(pwd)/${grpc_filename}" + grpc_filename="protoc-gen-grpc-java.exe" + # download protoc-gen-grpc-java plugin from Google maven central mirror. + download_from \ + "https://maven-central.storage-download.googleapis.com/maven2/io/grpc/protoc-gen-grpc-java/${grpc_version}/protoc-gen-grpc-java-${grpc_version}-${os_architecture}.exe" \ + "${grpc_filename}" + chmod +x "${grpc_filename}" } download_from() { @@ -284,8 +193,10 @@ get_proto_path_from_preprocessed_sources() { set -e local sources=$1 pushd "${sources}" > /dev/null - local proto_library=$(find . -maxdepth 1 -type d -name 'proto-*' | sed 's/\.\///') - local found_libraries=$(echo "${proto_library}" | wc -l) + local proto_library + proto_library=$(find . -maxdepth 1 -type d -name 'proto-*' | sed 's/\.\///') + local found_libraries + found_libraries=$(echo "${proto_library}" | wc -l) if [[ -z ${proto_library} ]]; then echo "no proto libraries found in the supplied sources path" exit 1 @@ -359,25 +270,56 @@ py_util() { python3 "${utilities_script_dir}/utilities.py" "$@" } -download_googleapis_files_and_folders() { - local output_folder=$1 - local googleapis_commitish=$2 - # checkout the master branch of googleapis/google (proto files) and WORKSPACE - echo "Checking out googlapis repository..." - # sparse_clone will remove folder contents first, so we have to checkout googleapis - # only once. - sparse_clone https://github.com/googleapis/googleapis.git "google grafeas" "${googleapis_commitish}" - pushd googleapis - cp -r google "${output_folder}" - cp -r grafeas "${output_folder}" +get_gapic_generator_location() { + local generator_location + generator_location="${HOME}/.library_generation/gapic-generator-java.jar" + if [[ -n "${GAPIC_GENERATOR_LOCATION}" ]]; then + echo "${GAPIC_GENERATOR_LOCATION}" + elif [[ -f "${generator_location}" ]]; then + echo "${generator_location}" + else + echo "Can't find GAPIC generator in ${generator_location}." + exit 1 + fi } -get_gapic_generator_location() { - echo "${GAPIC_GENERATOR_LOCATION}" +get_protoc_location() { + local protoc_location + protoc_location="${HOME}/.library_generation/bin" + if [[ -n "${DOCKER_PROTOC_LOCATION}" ]]; then + echo "${DOCKER_PROTOC_LOCATION}" + elif [[ -d "${protoc_location}" ]]; then + echo "${protoc_location}" + else + echo "Can't find protoc in ${protoc_location}." + exit 1 + fi +} + +get_grpc_plugin_location() { + local grpc_location + grpc_location="${HOME}/.library_generation/protoc-gen-grpc-java.exe" + if [[ -n "${DOCKER_GRPC_LOCATION}" ]]; then + echo "${DOCKER_GRPC_LOCATION}" + elif [[ -f "${grpc_location}" ]]; then + echo "${grpc_location}" + else + echo "Can't find grpc plugin in ${grpc_location}." + exit 1 + fi } get_java_formatter_location() { - echo "${JAVA_FORMATTER_LOCATION}" + local formatter_location + formatter_location="${HOME}/.library_generation/google-java-format.jar" + if [[ -n "${JAVA_FORMATTER_LOCATION}" ]]; then + echo "${JAVA_FORMATTER_LOCATION}" + elif [[ -f "${formatter_location}" ]]; then + echo "${formatter_location}" + else + echo "Can't find Java formatter in ${formatter_location}." + exit 1 + fi } error_if_not_exists() { diff --git a/hermetic_build/release_note_generation/generate_pr_description.py b/hermetic_build/release_note_generation/generate_pr_description.py index d544268092..f47985ad82 100755 --- a/hermetic_build/release_note_generation/generate_pr_description.py +++ b/hermetic_build/release_note_generation/generate_pr_description.py @@ -115,7 +115,8 @@ def get_repo_level_commit_messages( f"current_commit ({current_commit_sha[:7]}, committed on " f"{current_commit_time}) should be newer than or equal to " f"baseline_commit ({baseline_commit_sha[:7]}, committed on " - f"{baseline_commit_time})." + f"{baseline_commit_time}) (is this branch up to date with " + f"the base branch?)." ) qualified_commits = {} commit = current_commit diff --git a/java-common-protos/grpc-google-common-protos/pom.xml b/java-common-protos/grpc-google-common-protos/pom.xml index 37479f71b4..d119b2f284 100644 --- a/java-common-protos/grpc-google-common-protos/pom.xml +++ b/java-common-protos/grpc-google-common-protos/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-common-protos - 2.49.0 + 2.50.0 grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.49.0 + 2.50.0 diff --git a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java index 060b81a5f4..a99c9d0937 100644 --- a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java +++ b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java @@ -23,12 +23,12 @@ *
  * Manages long-running operations with an API service.
  * When an API method normally takes long time to complete, it can be designed
- * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
- * interface to receive the real response asynchronously by polling the
- * operation resource, or pass the operation resource to another API (such as
- * Google Cloud Pub/Sub API) to receive the response.  Any API service that
- * returns long-running operations should implement the `Operations` interface
- * so developers can have a consistent client experience.
+ * to return [Operation][google.longrunning.Operation] to the client, and the
+ * client can use this interface to receive the real response asynchronously by
+ * polling the operation resource, or pass the operation resource to another API
+ * (such as Pub/Sub API) to receive the response.  Any API service that returns
+ * long-running operations should implement the `Operations` interface so
+ * developers can have a consistent client experience.
  * 
*/ @javax.annotation.Generated( @@ -296,12 +296,12 @@ public OperationsFutureStub newStub( *
    * Manages long-running operations with an API service.
    * When an API method normally takes long time to complete, it can be designed
-   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
-   * interface to receive the real response asynchronously by polling the
-   * operation resource, or pass the operation resource to another API (such as
-   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
-   * returns long-running operations should implement the `Operations` interface
-   * so developers can have a consistent client experience.
+   * to return [Operation][google.longrunning.Operation] to the client, and the
+   * client can use this interface to receive the real response asynchronously by
+   * polling the operation resource, or pass the operation resource to another API
+   * (such as Pub/Sub API) to receive the response.  Any API service that returns
+   * long-running operations should implement the `Operations` interface so
+   * developers can have a consistent client experience.
    * 
*/ public interface AsyncService { @@ -312,13 +312,6 @@ public interface AsyncService { *
      * Lists operations that match the specified filter in the request. If the
      * server doesn't support this method, it returns `UNIMPLEMENTED`.
-     * NOTE: the `name` binding allows API services to override the binding
-     * to use different resource name schemes, such as `users/*/operations`. To
-     * override the binding, API services can add a binding such as
-     * `"/v1/{name=users/*}/operations"` to their service configuration.
-     * For backwards compatibility, the default name includes the operations
-     * collection id, however overriding users must ensure the name binding
-     * is the parent resource, without the operations collection id.
      * 
*/ default void listOperations( @@ -374,8 +367,9 @@ default void deleteOperation( * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. * */ default void cancelOperation( @@ -414,12 +408,12 @@ default void waitOperation( *
    * Manages long-running operations with an API service.
    * When an API method normally takes long time to complete, it can be designed
-   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
-   * interface to receive the real response asynchronously by polling the
-   * operation resource, or pass the operation resource to another API (such as
-   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
-   * returns long-running operations should implement the `Operations` interface
-   * so developers can have a consistent client experience.
+   * to return [Operation][google.longrunning.Operation] to the client, and the
+   * client can use this interface to receive the real response asynchronously by
+   * polling the operation resource, or pass the operation resource to another API
+   * (such as Pub/Sub API) to receive the response.  Any API service that returns
+   * long-running operations should implement the `Operations` interface so
+   * developers can have a consistent client experience.
    * 
*/ public abstract static class OperationsImplBase implements io.grpc.BindableService, AsyncService { @@ -436,12 +430,12 @@ public final io.grpc.ServerServiceDefinition bindService() { *
    * Manages long-running operations with an API service.
    * When an API method normally takes long time to complete, it can be designed
-   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
-   * interface to receive the real response asynchronously by polling the
-   * operation resource, or pass the operation resource to another API (such as
-   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
-   * returns long-running operations should implement the `Operations` interface
-   * so developers can have a consistent client experience.
+   * to return [Operation][google.longrunning.Operation] to the client, and the
+   * client can use this interface to receive the real response asynchronously by
+   * polling the operation resource, or pass the operation resource to another API
+   * (such as Pub/Sub API) to receive the response.  Any API service that returns
+   * long-running operations should implement the `Operations` interface so
+   * developers can have a consistent client experience.
    * 
*/ public static final class OperationsStub extends io.grpc.stub.AbstractAsyncStub { @@ -460,13 +454,6 @@ protected OperationsStub build(io.grpc.Channel channel, io.grpc.CallOptions call *
      * Lists operations that match the specified filter in the request. If the
      * server doesn't support this method, it returns `UNIMPLEMENTED`.
-     * NOTE: the `name` binding allows API services to override the binding
-     * to use different resource name schemes, such as `users/*/operations`. To
-     * override the binding, API services can add a binding such as
-     * `"/v1/{name=users/*}/operations"` to their service configuration.
-     * For backwards compatibility, the default name includes the operations
-     * collection id, however overriding users must ensure the name binding
-     * is the parent resource, without the operations collection id.
      * 
*/ public void listOperations( @@ -528,8 +515,9 @@ public void deleteOperation( * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. * */ public void cancelOperation( @@ -572,12 +560,12 @@ public void waitOperation( *
    * Manages long-running operations with an API service.
    * When an API method normally takes long time to complete, it can be designed
-   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
-   * interface to receive the real response asynchronously by polling the
-   * operation resource, or pass the operation resource to another API (such as
-   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
-   * returns long-running operations should implement the `Operations` interface
-   * so developers can have a consistent client experience.
+   * to return [Operation][google.longrunning.Operation] to the client, and the
+   * client can use this interface to receive the real response asynchronously by
+   * polling the operation resource, or pass the operation resource to another API
+   * (such as Pub/Sub API) to receive the response.  Any API service that returns
+   * long-running operations should implement the `Operations` interface so
+   * developers can have a consistent client experience.
    * 
*/ public static final class OperationsBlockingStub @@ -598,13 +586,6 @@ protected OperationsBlockingStub build( *
      * Lists operations that match the specified filter in the request. If the
      * server doesn't support this method, it returns `UNIMPLEMENTED`.
-     * NOTE: the `name` binding allows API services to override the binding
-     * to use different resource name schemes, such as `users/*/operations`. To
-     * override the binding, API services can add a binding such as
-     * `"/v1/{name=users/*}/operations"` to their service configuration.
-     * For backwards compatibility, the default name includes the operations
-     * collection id, however overriding users must ensure the name binding
-     * is the parent resource, without the operations collection id.
      * 
*/ public com.google.longrunning.ListOperationsResponse listOperations( @@ -656,8 +637,9 @@ public com.google.protobuf.Empty deleteOperation( * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. * */ public com.google.protobuf.Empty cancelOperation( @@ -694,12 +676,12 @@ public com.google.longrunning.Operation waitOperation( *
    * Manages long-running operations with an API service.
    * When an API method normally takes long time to complete, it can be designed
-   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
-   * interface to receive the real response asynchronously by polling the
-   * operation resource, or pass the operation resource to another API (such as
-   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
-   * returns long-running operations should implement the `Operations` interface
-   * so developers can have a consistent client experience.
+   * to return [Operation][google.longrunning.Operation] to the client, and the
+   * client can use this interface to receive the real response asynchronously by
+   * polling the operation resource, or pass the operation resource to another API
+   * (such as Pub/Sub API) to receive the response.  Any API service that returns
+   * long-running operations should implement the `Operations` interface so
+   * developers can have a consistent client experience.
    * 
*/ public static final class OperationsFutureStub @@ -719,13 +701,6 @@ protected OperationsFutureStub build(io.grpc.Channel channel, io.grpc.CallOption *
      * Lists operations that match the specified filter in the request. If the
      * server doesn't support this method, it returns `UNIMPLEMENTED`.
-     * NOTE: the `name` binding allows API services to override the binding
-     * to use different resource name schemes, such as `users/*/operations`. To
-     * override the binding, API services can add a binding such as
-     * `"/v1/{name=users/*}/operations"` to their service configuration.
-     * For backwards compatibility, the default name includes the operations
-     * collection id, however overriding users must ensure the name binding
-     * is the parent resource, without the operations collection id.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -778,8 +753,9 @@ protected OperationsFutureStub build(io.grpc.Channel channel, io.grpc.CallOption * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. * */ public com.google.common.util.concurrent.ListenableFuture diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index a9153be9e2..8f2005dce2 100644 --- a/java-common-protos/pom.xml +++ b/java-common-protos/pom.xml @@ -4,7 +4,7 @@ com.google.api.grpc google-common-protos-parent pom - 2.49.0 + 2.50.0 Google Common Protos Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent @@ -61,7 +61,7 @@ com.google.cloud third-party-dependencies - 3.40.0 + 3.41.0 pom import @@ -75,7 +75,7 @@ com.google.api.grpc grpc-google-common-protos - 2.49.0 + 2.50.0 io.grpc @@ -87,7 +87,7 @@ com.google.api.grpc proto-google-common-protos - 2.49.0 + 2.50.0 com.google.guava @@ -119,7 +119,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.7.0 + 3.8.0 diff --git a/java-common-protos/proto-google-common-protos/pom.xml b/java-common-protos/proto-google-common-protos/pom.xml index 998b861576..92e495867b 100644 --- a/java-common-protos/proto-google-common-protos/pom.xml +++ b/java-common-protos/proto-google-common-protos/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-common-protos - 2.49.0 + 2.50.0 proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.49.0 + 2.50.0 diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java index 86a8da410d..4a46de43ed 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java @@ -231,6 +231,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_api_GoSettings_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_api_GoSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_GoSettings_RenamedServicesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MethodSettings_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -313,33 +317,36 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "enamedResourcesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val" + "ue\030\002 \001(\t:\0028\001\"B\n\014RubySettings\0222\n\006common\030\001" + " \001(\0132\".google.api.CommonLanguageSettings" - + "\"@\n\nGoSettings\0222\n\006common\030\001 \001(\0132\".google." - + "api.CommonLanguageSettings\"\317\002\n\016MethodSet" - + "tings\022\020\n\010selector\030\001 \001(\t\022<\n\014long_running\030" - + "\002 \001(\0132&.google.api.MethodSettings.LongRu" - + "nning\022\035\n\025auto_populated_fields\030\003 \003(\t\032\315\001\n" - + "\013LongRunning\0225\n\022initial_poll_delay\030\001 \001(\013" - + "2\031.google.protobuf.Duration\022\035\n\025poll_dela" - + "y_multiplier\030\002 \001(\002\0221\n\016max_poll_delay\030\003 \001" - + "(\0132\031.google.protobuf.Duration\0225\n\022total_p" - + "oll_timeout\030\004 \001(\0132\031.google.protobuf.Dura" - + "tion\"+\n\030SelectiveGapicGeneration\022\017\n\007meth" - + "ods\030\001 \003(\t*\243\001\n\031ClientLibraryOrganization\022" - + "+\n\'CLIENT_LIBRARY_ORGANIZATION_UNSPECIFI" - + "ED\020\000\022\t\n\005CLOUD\020\001\022\007\n\003ADS\020\002\022\n\n\006PHOTOS\020\003\022\017\n\013" - + "STREET_VIEW\020\004\022\014\n\010SHOPPING\020\005\022\007\n\003GEO\020\006\022\021\n\r" - + "GENERATIVE_AI\020\007*g\n\030ClientLibraryDestinat" - + "ion\022*\n&CLIENT_LIBRARY_DESTINATION_UNSPEC" - + "IFIED\020\000\022\n\n\006GITHUB\020\n\022\023\n\017PACKAGE_MANAGER\020\024" - + ":9\n\020method_signature\022\036.google.protobuf.M" - + "ethodOptions\030\233\010 \003(\t:6\n\014default_host\022\037.go" - + "ogle.protobuf.ServiceOptions\030\231\010 \001(\t:6\n\014o" - + "auth_scopes\022\037.google.protobuf.ServiceOpt" - + "ions\030\232\010 \001(\t:8\n\013api_version\022\037.google.prot" - + "obuf.ServiceOptions\030\301\272\253\372\001 \001(\tBi\n\016com.goo" - + "gle.apiB\013ClientProtoP\001ZAgoogle.golang.or" - + "g/genproto/googleapis/api/annotations;an" - + "notations\242\002\004GAPIb\006proto3" + + "\"\277\001\n\nGoSettings\0222\n\006common\030\001 \001(\0132\".google" + + ".api.CommonLanguageSettings\022E\n\020renamed_s" + + "ervices\030\002 \003(\0132+.google.api.GoSettings.Re" + + "namedServicesEntry\0326\n\024RenamedServicesEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\317\002\n\016M" + + "ethodSettings\022\020\n\010selector\030\001 \001(\t\022<\n\014long_" + + "running\030\002 \001(\0132&.google.api.MethodSetting" + + "s.LongRunning\022\035\n\025auto_populated_fields\030\003" + + " \003(\t\032\315\001\n\013LongRunning\0225\n\022initial_poll_del" + + "ay\030\001 \001(\0132\031.google.protobuf.Duration\022\035\n\025p" + + "oll_delay_multiplier\030\002 \001(\002\0221\n\016max_poll_d" + + "elay\030\003 \001(\0132\031.google.protobuf.Duration\0225\n" + + "\022total_poll_timeout\030\004 \001(\0132\031.google.proto" + + "buf.Duration\"+\n\030SelectiveGapicGeneration" + + "\022\017\n\007methods\030\001 \003(\t*\243\001\n\031ClientLibraryOrgan" + + "ization\022+\n\'CLIENT_LIBRARY_ORGANIZATION_U" + + "NSPECIFIED\020\000\022\t\n\005CLOUD\020\001\022\007\n\003ADS\020\002\022\n\n\006PHOT" + + "OS\020\003\022\017\n\013STREET_VIEW\020\004\022\014\n\010SHOPPING\020\005\022\007\n\003G" + + "EO\020\006\022\021\n\rGENERATIVE_AI\020\007*g\n\030ClientLibrary" + + "Destination\022*\n&CLIENT_LIBRARY_DESTINATIO" + + "N_UNSPECIFIED\020\000\022\n\n\006GITHUB\020\n\022\023\n\017PACKAGE_M" + + "ANAGER\020\024:9\n\020method_signature\022\036.google.pr" + + "otobuf.MethodOptions\030\233\010 \003(\t:6\n\014default_h" + + "ost\022\037.google.protobuf.ServiceOptions\030\231\010 " + + "\001(\t:6\n\014oauth_scopes\022\037.google.protobuf.Se" + + "rviceOptions\030\232\010 \001(\t:8\n\013api_version\022\037.goo" + + "gle.protobuf.ServiceOptions\030\301\272\253\372\001 \001(\tBi\n" + + "\016com.google.apiB\013ClientProtoP\001ZAgoogle.g" + + "olang.org/genproto/googleapis/api/annota" + + "tions;annotations\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -483,7 +490,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_api_GoSettings_descriptor, new java.lang.String[] { - "Common", + "Common", "RenamedServices", + }); + internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor = + internal_static_google_api_GoSettings_descriptor.getNestedTypes().get(0); + internal_static_google_api_GoSettings_RenamedServicesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", }); internal_static_google_api_MethodSettings_descriptor = getDescriptor().getMessageTypes().get(11); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java index 28f61d751b..cb52352790 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java @@ -50,6 +50,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_GoSettings_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetRenamedServices(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -105,6 +117,138 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + public static final int RENAMED_SERVICES_FIELD_NUMBER = 2; + + private static final class RenamedServicesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.ClientProto + .internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField renamedServices_; + + private com.google.protobuf.MapField + internalGetRenamedServices() { + if (renamedServices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + return renamedServices_; + } + + public int getRenamedServicesCount() { + return internalGetRenamedServices().getMap().size(); + } + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public boolean containsRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRenamedServices().getMap().containsKey(key); + } + /** Use {@link #getRenamedServicesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRenamedServices() { + return getRenamedServicesMap(); + } + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.util.Map getRenamedServicesMap() { + return internalGetRenamedServices().getMap(); + } + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.lang.String getRenamedServicesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -122,6 +266,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCommon()); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetRenamedServices(), RenamedServicesDefaultEntryHolder.defaultEntry, 2); getUnknownFields().writeTo(output); } @@ -134,6 +280,16 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); } + for (java.util.Map.Entry entry : + internalGetRenamedServices().getMap().entrySet()) { + com.google.protobuf.MapEntry renamedServices__ = + RenamedServicesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, renamedServices__); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -153,6 +309,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCommon()) { if (!getCommon().equals(other.getCommon())) return false; } + if (!internalGetRenamedServices().equals(other.internalGetRenamedServices())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -168,6 +325,10 @@ public int hashCode() { hash = (37 * hash) + COMMON_FIELD_NUMBER; hash = (53 * hash) + getCommon().hashCode(); } + if (!internalGetRenamedServices().getMap().isEmpty()) { + hash = (37 * hash) + RENAMED_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + internalGetRenamedServices().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -284,6 +445,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_GoSettings_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetRenamedServices(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableRenamedServices(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -317,6 +500,7 @@ public Builder clear() { commonBuilder_.dispose(); commonBuilder_ = null; } + internalGetMutableRenamedServices().clear(); return this; } @@ -356,6 +540,10 @@ private void buildPartial0(com.google.api.GoSettings result) { result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.renamedServices_ = internalGetRenamedServices(); + result.renamedServices_.makeImmutable(); + } result.bitField0_ |= to_bitField0_; } @@ -407,6 +595,8 @@ public Builder mergeFrom(com.google.api.GoSettings other) { if (other.hasCommon()) { mergeCommon(other.getCommon()); } + internalGetMutableRenamedServices().mergeFrom(other.internalGetRenamedServices()); + bitField0_ |= 0x00000002; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -439,6 +629,18 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 18: + { + com.google.protobuf.MapEntry renamedServices__ = + input.readMessage( + RenamedServicesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableRenamedServices() + .getMutableMap() + .put(renamedServices__.getKey(), renamedServices__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -643,6 +845,222 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } + private com.google.protobuf.MapField renamedServices_; + + private com.google.protobuf.MapField + internalGetRenamedServices() { + if (renamedServices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + return renamedServices_; + } + + private com.google.protobuf.MapField + internalGetMutableRenamedServices() { + if (renamedServices_ == null) { + renamedServices_ = + com.google.protobuf.MapField.newMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + if (!renamedServices_.isMutable()) { + renamedServices_ = renamedServices_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return renamedServices_; + } + + public int getRenamedServicesCount() { + return internalGetRenamedServices().getMap().size(); + } + /** + * + * + *
+     * Map of service names to renamed services. Keys are the package relative
+     * service names and values are the name to be used for the service client
+     * and call options.
+     *
+     * publishing:
+     *   go_settings:
+     *     renamed_services:
+     *       Publisher: TopicAdmin
+     * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public boolean containsRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRenamedServices().getMap().containsKey(key); + } + /** Use {@link #getRenamedServicesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRenamedServices() { + return getRenamedServicesMap(); + } + /** + * + * + *
+     * Map of service names to renamed services. Keys are the package relative
+     * service names and values are the name to be used for the service client
+     * and call options.
+     *
+     * publishing:
+     *   go_settings:
+     *     renamed_services:
+     *       Publisher: TopicAdmin
+     * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.util.Map getRenamedServicesMap() { + return internalGetRenamedServices().getMap(); + } + /** + * + * + *
+     * Map of service names to renamed services. Keys are the package relative
+     * service names and values are the name to be used for the service client
+     * and call options.
+     *
+     * publishing:
+     *   go_settings:
+     *     renamed_services:
+     *       Publisher: TopicAdmin
+     * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Map of service names to renamed services. Keys are the package relative
+     * service names and values are the name to be used for the service client
+     * and call options.
+     *
+     * publishing:
+     *   go_settings:
+     *     renamed_services:
+     *       Publisher: TopicAdmin
+     * 
+ * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.lang.String getRenamedServicesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRenamedServices() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableRenamedServices().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Map of service names to renamed services. Keys are the package relative
+     * service names and values are the name to be used for the service client
+     * and call options.
+     *
+     * publishing:
+     *   go_settings:
+     *     renamed_services:
+     *       Publisher: TopicAdmin
+     * 
+ * + * map<string, string> renamed_services = 2; + */ + public Builder removeRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableRenamedServices().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableRenamedServices() { + bitField0_ |= 0x00000002; + return internalGetMutableRenamedServices().getMutableMap(); + } + /** + * + * + *
+     * Map of service names to renamed services. Keys are the package relative
+     * service names and values are the name to be used for the service client
+     * and call options.
+     *
+     * publishing:
+     *   go_settings:
+     *     renamed_services:
+     *       Publisher: TopicAdmin
+     * 
+ * + * map<string, string> renamed_services = 2; + */ + public Builder putRenamedServices(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableRenamedServices().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * Map of service names to renamed services. Keys are the package relative
+     * service names and values are the name to be used for the service client
+     * and call options.
+     *
+     * publishing:
+     *   go_settings:
+     *     renamed_services:
+     *       Publisher: TopicAdmin
+     * 
+ * + * map<string, string> renamed_services = 2; + */ + public Builder putAllRenamedServices(java.util.Map values) { + internalGetMutableRenamedServices().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java index defcc2997f..60d1fe7376 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java @@ -58,4 +58,97 @@ public interface GoSettingsOrBuilder * .google.api.CommonLanguageSettings common = 1; */ com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder(); + + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + int getRenamedServicesCount(); + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + boolean containsRenamedServices(java.lang.String key); + /** Use {@link #getRenamedServicesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getRenamedServices(); + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + java.util.Map getRenamedServicesMap(); + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + /* nullable */ + java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Map of service names to renamed services. Keys are the package relative
+   * service names and values are the name to be used for the service client
+   * and call options.
+   *
+   * publishing:
+   *   go_settings:
+   *     renamed_services:
+   *       Publisher: TopicAdmin
+   * 
+ * + * map<string, string> renamed_services = 2; + */ + java.lang.String getRenamedServicesOrThrow(java.lang.String key); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java index 1971847cc7..7049fa2bcc 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java @@ -23,7 +23,8 @@ * * *
- * The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
+ * The request message for
+ * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
  * 
* * Protobuf type {@code google.longrunning.CancelOperationRequest} @@ -277,7 +278,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
+   * The request message for
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
    * 
* * Protobuf type {@code google.longrunning.CancelOperationRequest} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java index 66ad2ee922..a7c80538fe 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java @@ -23,7 +23,8 @@ * * *
- * The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
+ * The request message for
+ * [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
  * 
* * Protobuf type {@code google.longrunning.DeleteOperationRequest} @@ -277,7 +278,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
+   * The request message for
+   * [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
    * 
* * Protobuf type {@code google.longrunning.DeleteOperationRequest} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java index c08917dbc6..2d6b93be06 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java @@ -23,7 +23,8 @@ * * *
- * The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
+ * The request message for
+ * [Operations.GetOperation][google.longrunning.Operations.GetOperation].
  * 
* * Protobuf type {@code google.longrunning.GetOperationRequest} @@ -277,7 +278,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
+   * The request message for
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation].
    * 
* * Protobuf type {@code google.longrunning.GetOperationRequest} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java index 3a1d957cc9..79efbfe46e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java @@ -23,7 +23,8 @@ * * *
- * The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
+ * The request message for
+ * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
  * 
* * Protobuf type {@code google.longrunning.ListOperationsRequest} @@ -426,7 +427,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
+   * The request message for
+   * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
    * 
* * Protobuf type {@code google.longrunning.ListOperationsRequest} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java index 19a7eaa90e..8a60b2769f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java @@ -23,7 +23,8 @@ * * *
- * The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
+ * The response message for
+ * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
  * 
* * Protobuf type {@code google.longrunning.ListOperationsResponse} @@ -360,7 +361,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
+   * The response message for
+   * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
    * 
* * Protobuf type {@code google.longrunning.ListOperationsResponse} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java index 7e0378de7e..e64657bda1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java @@ -299,7 +299,7 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { * * *
-   * The normal response of the operation in case of success.  If the original
+   * The normal, successful response of the operation.  If the original
    * method returns no data on success, such as `Delete`, the response is
    * `google.protobuf.Empty`.  If the original method is standard
    * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -321,7 +321,7 @@ public boolean hasResponse() {
    *
    *
    * 
-   * The normal response of the operation in case of success.  If the original
+   * The normal, successful response of the operation.  If the original
    * method returns no data on success, such as `Delete`, the response is
    * `google.protobuf.Empty`.  If the original method is standard
    * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -346,7 +346,7 @@ public com.google.protobuf.Any getResponse() {
    *
    *
    * 
-   * The normal response of the operation in case of success.  If the original
+   * The normal, successful response of the operation.  If the original
    * method returns no data on success, such as `Delete`, the response is
    * `google.protobuf.Empty`.  If the original method is standard
    * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1462,7 +1462,7 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1484,7 +1484,7 @@ public boolean hasResponse() {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1516,7 +1516,7 @@ public com.google.protobuf.Any getResponse() {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1545,7 +1545,7 @@ public Builder setResponse(com.google.protobuf.Any value) {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1571,7 +1571,7 @@ public Builder setResponse(com.google.protobuf.Any.Builder builderForValue) {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1608,7 +1608,7 @@ public Builder mergeResponse(com.google.protobuf.Any value) {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1640,7 +1640,7 @@ public Builder clearResponse() {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1659,7 +1659,7 @@ public com.google.protobuf.Any.Builder getResponseBuilder() {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -1686,7 +1686,7 @@ public com.google.protobuf.AnyOrBuilder getResponseOrBuilder() {
      *
      *
      * 
-     * The normal response of the operation in case of success.  If the original
+     * The normal, successful response of the operation.  If the original
      * method returns no data on success, such as `Delete`, the response is
      * `google.protobuf.Empty`.  If the original method is standard
      * `Get`/`Create`/`Update`, the response should be the resource.  For other
diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java
index ec1e9a0c42..780d173edd 100644
--- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java
+++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java
@@ -27,13 +27,12 @@
  *
  * Example:
  *
- *   rpc LongRunningRecognize(LongRunningRecognizeRequest)
- *       returns (google.longrunning.Operation) {
- *     option (google.longrunning.operation_info) = {
- *       response_type: "LongRunningRecognizeResponse"
- *       metadata_type: "LongRunningRecognizeMetadata"
- *     };
- *   }
+ *     rpc Export(ExportRequest) returns (google.longrunning.Operation) {
+ *       option (google.longrunning.operation_info) = {
+ *         response_type: "ExportResponse"
+ *         metadata_type: "ExportMetadata"
+ *       };
+ *     }
  * 
* * Protobuf type {@code google.longrunning.OperationInfo} @@ -376,13 +375,12 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Example: * - * rpc LongRunningRecognize(LongRunningRecognizeRequest) - * returns (google.longrunning.Operation) { - * option (google.longrunning.operation_info) = { - * response_type: "LongRunningRecognizeResponse" - * metadata_type: "LongRunningRecognizeMetadata" - * }; - * } + * rpc Export(ExportRequest) returns (google.longrunning.Operation) { + * option (google.longrunning.operation_info) = { + * response_type: "ExportResponse" + * metadata_type: "ExportMetadata" + * }; + * } *
* * Protobuf type {@code google.longrunning.OperationInfo} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java index b4edfc4783..2be5f22612 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java @@ -151,7 +151,7 @@ public interface OperationOrBuilder * * *
-   * The normal response of the operation in case of success.  If the original
+   * The normal, successful response of the operation.  If the original
    * method returns no data on success, such as `Delete`, the response is
    * `google.protobuf.Empty`.  If the original method is standard
    * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -170,7 +170,7 @@ public interface OperationOrBuilder
    *
    *
    * 
-   * The normal response of the operation in case of success.  If the original
+   * The normal, successful response of the operation.  If the original
    * method returns no data on success, such as `Delete`, the response is
    * `google.protobuf.Empty`.  If the original method is standard
    * `Get`/`Create`/`Update`, the response should be the resource.  For other
@@ -189,7 +189,7 @@ public interface OperationOrBuilder
    *
    *
    * 
-   * The normal response of the operation in case of success.  If the original
+   * The normal, successful response of the operation.  If the original
    * method returns no data on success, such as `Delete`, the response is
    * `google.protobuf.Empty`.  If the original method is standard
    * `Get`/`Create`/`Update`, the response should be the resource.  For other
diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java
index 3d02ac5688..502eec4452 100644
--- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java
+++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java
@@ -96,10 +96,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
       "\n#google/longrunning/operations.proto\022\022g"
           + "oogle.longrunning\032\034google/api/annotation"
           + "s.proto\032\027google/api/client.proto\032\031google"
-          + "/protobuf/any.proto\032\036google/protobuf/dur"
-          + "ation.proto\032\033google/protobuf/empty.proto"
-          + "\032\027google/rpc/status.proto\032 google/protob"
-          + "uf/descriptor.proto\"\250\001\n\tOperation\022\014\n\004nam"
+          + "/protobuf/any.proto\032 google/protobuf/des"
+          + "criptor.proto\032\036google/protobuf/duration."
+          + "proto\032\033google/protobuf/empty.proto\032\027goog"
+          + "le/rpc/status.proto\"\250\001\n\tOperation\022\014\n\004nam"
           + "e\030\001 \001(\t\022&\n\010metadata\030\002 \001(\0132\024.google.proto"
           + "buf.Any\022\014\n\004done\030\003 \001(\010\022#\n\005error\030\004 \001(\0132\022.g"
           + "oogle.rpc.StatusH\000\022(\n\010response\030\005 \001(\0132\024.g"
@@ -134,11 +134,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "ongrunning.Operation\"\000\032\035\312A\032longrunning.g"
           + "oogleapis.com:Z\n\016operation_info\022\036.google"
           + ".protobuf.MethodOptions\030\231\010 \001(\0132!.google."
-          + "longrunning.OperationInfoB\235\001\n\026com.google"
+          + "longrunning.OperationInfoB\245\001\n\026com.google"
           + ".longrunningB\017OperationsProtoP\001ZCcloud.g"
           + "oogle.com/go/longrunning/autogen/longrun"
-          + "ningpb;longrunningpb\370\001\001\252\002\022Google.LongRun"
-          + "ning\312\002\022Google\\LongRunningb\006proto3"
+          + "ningpb;longrunningpb\370\001\001\242\002\005GLRUN\252\002\022Google"
+          + ".LongRunning\312\002\022Google\\LongRunningb\006proto"
+          + "3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -147,10 +148,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               com.google.api.AnnotationsProto.getDescriptor(),
               com.google.api.ClientProto.getDescriptor(),
               com.google.protobuf.AnyProto.getDescriptor(),
+              com.google.protobuf.DescriptorProtos.getDescriptor(),
               com.google.protobuf.DurationProto.getDescriptor(),
               com.google.protobuf.EmptyProto.getDescriptor(),
               com.google.rpc.StatusProto.getDescriptor(),
-              com.google.protobuf.DescriptorProtos.getDescriptor(),
             });
     internal_static_google_longrunning_Operation_descriptor =
         getDescriptor().getMessageTypes().get(0);
@@ -227,10 +228,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
     com.google.api.AnnotationsProto.getDescriptor();
     com.google.api.ClientProto.getDescriptor();
     com.google.protobuf.AnyProto.getDescriptor();
+    com.google.protobuf.DescriptorProtos.getDescriptor();
     com.google.protobuf.DurationProto.getDescriptor();
     com.google.protobuf.EmptyProto.getDescriptor();
     com.google.rpc.StatusProto.getDescriptor();
-    com.google.protobuf.DescriptorProtos.getDescriptor();
   }
 
   // @@protoc_insertion_point(outer_class_scope)
diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java
index 7e7b2bd76f..c3d41a8079 100644
--- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java
+++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java
@@ -23,7 +23,8 @@
  *
  *
  * 
- * The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
+ * The request message for
+ * [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
  * 
* * Protobuf type {@code google.longrunning.WaitOperationRequest} @@ -344,7 +345,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
+   * The request message for
+   * [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
    * 
* * Protobuf type {@code google.longrunning.WaitOperationRequest} diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto index 6003be5307..7e3e66e9ed 100644 --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto @@ -342,6 +342,16 @@ message RubySettings { message GoSettings { // Some settings. CommonLanguageSettings common = 1; + + // Map of service names to renamed services. Keys are the package relative + // service names and values are the name to be used for the service client + // and call options. + // + // publishing: + // go_settings: + // renamed_services: + // Publisher: TopicAdmin + map renamed_services = 2; } // Describes the generator configuration for a method. diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto index be8880b3f7..bb42620b73 100644 --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto @@ -19,10 +19,10 @@ package google.longrunning; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/rpc/status.proto"; -import "google/protobuf/descriptor.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.LongRunning"; @@ -30,6 +30,7 @@ option go_package = "cloud.google.com/go/longrunning/autogen/longrunningpb;longr option java_multiple_files = true; option java_outer_classname = "OperationsProto"; option java_package = "com.google.longrunning"; +option objc_class_prefix = "GLRUN"; option php_namespace = "Google\\LongRunning"; extend google.protobuf.MethodOptions { @@ -45,25 +46,17 @@ extend google.protobuf.MethodOptions { // Manages long-running operations with an API service. // // When an API method normally takes long time to complete, it can be designed -// to return [Operation][google.longrunning.Operation] to the client, and the client can use this -// interface to receive the real response asynchronously by polling the -// operation resource, or pass the operation resource to another API (such as -// Google Cloud Pub/Sub API) to receive the response. Any API service that -// returns long-running operations should implement the `Operations` interface -// so developers can have a consistent client experience. +// to return [Operation][google.longrunning.Operation] to the client, and the +// client can use this interface to receive the real response asynchronously by +// polling the operation resource, or pass the operation resource to another API +// (such as Pub/Sub API) to receive the response. Any API service that returns +// long-running operations should implement the `Operations` interface so +// developers can have a consistent client experience. service Operations { option (google.api.default_host) = "longrunning.googleapis.com"; // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. - // - // NOTE: the `name` binding allows API services to override the binding - // to use different resource name schemes, such as `users/*/operations`. To - // override the binding, API services can add a binding such as - // `"/v1/{name=users/*}/operations"` to their service configuration. - // For backwards compatibility, the default name includes the operations - // collection id, however overriding users must ensure the name binding - // is the parent resource, without the operations collection id. rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { option (google.api.http) = { get: "/v1/{name=operations}" @@ -100,8 +93,9 @@ service Operations { // other methods to check whether the cancellation succeeded or whether the // operation completed despite cancellation. On successful cancellation, // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + // `Code.CANCELLED`. rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v1/{name=operations/**}:cancel" @@ -119,8 +113,7 @@ service Operations { // Note that this method is on a best-effort basis. It may return the latest // state before the specified timeout (including immediately), meaning even an // immediate response is no guarantee that the operation is done. - rpc WaitOperation(WaitOperationRequest) returns (Operation) { - } + rpc WaitOperation(WaitOperationRequest) returns (Operation) {} } // This resource represents a long-running operation that is the result of a @@ -144,12 +137,13 @@ message Operation { // The operation result, which can be either an `error` or a valid `response`. // If `done` == `false`, neither `error` nor `response` is set. - // If `done` == `true`, exactly one of `error` or `response` is set. + // If `done` == `true`, exactly one of `error` or `response` can be set. + // Some services might not provide the result. oneof result { // The error result of the operation in case of failure or cancellation. google.rpc.Status error = 4; - // The normal response of the operation in case of success. If the original + // The normal, successful response of the operation. If the original // method returns no data on success, such as `Delete`, the response is // `google.protobuf.Empty`. If the original method is standard // `Get`/`Create`/`Update`, the response should be the resource. For other @@ -161,13 +155,15 @@ message Operation { } } -// The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. +// The request message for +// [Operations.GetOperation][google.longrunning.Operations.GetOperation]. message GetOperationRequest { // The name of the operation resource. string name = 1; } -// The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. +// The request message for +// [Operations.ListOperations][google.longrunning.Operations.ListOperations]. message ListOperationsRequest { // The name of the operation's parent resource. string name = 4; @@ -182,7 +178,8 @@ message ListOperationsRequest { string page_token = 3; } -// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. +// The response message for +// [Operations.ListOperations][google.longrunning.Operations.ListOperations]. message ListOperationsResponse { // A list of operations that matches the specified filter in the request. repeated Operation operations = 1; @@ -191,19 +188,22 @@ message ListOperationsResponse { string next_page_token = 2; } -// The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. +// The request message for +// [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. message CancelOperationRequest { // The name of the operation resource to be cancelled. string name = 1; } -// The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. +// The request message for +// [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. message DeleteOperationRequest { // The name of the operation resource to be deleted. string name = 1; } -// The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. +// The request message for +// [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. message WaitOperationRequest { // The name of the operation resource to wait on. string name = 1; @@ -218,13 +218,12 @@ message WaitOperationRequest { // // Example: // -// rpc LongRunningRecognize(LongRunningRecognizeRequest) -// returns (google.longrunning.Operation) { -// option (google.longrunning.operation_info) = { -// response_type: "LongRunningRecognizeResponse" -// metadata_type: "LongRunningRecognizeMetadata" -// }; -// } +// rpc Export(ExportRequest) returns (google.longrunning.Operation) { +// option (google.longrunning.operation_info) = { +// response_type: "ExportResponse" +// metadata_type: "ExportMetadata" +// }; +// } message OperationInfo { // Required. The message name of the primary return type for this // long-running operation. diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml index 708fb0136c..dd6e9afac6 100644 --- a/java-core/google-cloud-core-bom/pom.xml +++ b/java-core/google-cloud-core-bom/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.cloud google-cloud-core-bom - 2.48.0 + 2.49.0 pom com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../../gapic-generator-java-pom-parent @@ -23,17 +23,17 @@ com.google.cloud google-cloud-core - 2.48.0 + 2.49.0 com.google.cloud google-cloud-core-grpc - 2.48.0 + 2.49.0 com.google.cloud google-cloud-core-http - 2.48.0 + 2.49.0 diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index 9d2477b1a4..fd7999c313 100644 --- a/java-core/google-cloud-core-grpc/pom.xml +++ b/java-core/google-cloud-core-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-grpc - 2.48.0 + 2.49.0 jar Google Cloud Core gRPC @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.48.0 + 2.49.0 google-cloud-core-grpc diff --git a/java-core/google-cloud-core-http/pom.xml b/java-core/google-cloud-core-http/pom.xml index 91ff87efcf..03764e6526 100644 --- a/java-core/google-cloud-core-http/pom.xml +++ b/java-core/google-cloud-core-http/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-http - 2.48.0 + 2.49.0 jar Google Cloud Core HTTP @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.48.0 + 2.49.0 google-cloud-core-http diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index bcdcb6bd45..ec49cc98d8 100644 --- a/java-core/google-cloud-core/pom.xml +++ b/java-core/google-cloud-core/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core - 2.48.0 + 2.49.0 jar Google Cloud Core @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.48.0 + 2.49.0 google-cloud-core diff --git a/java-core/pom.xml b/java-core/pom.xml index 88c5e0d6a9..43b8088169 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.48.0 + 2.49.0 Google Cloud Core Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent @@ -33,7 +33,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.40.0 + 3.41.0 pom import @@ -53,7 +53,7 @@ org.easymock easymock - 5.4.0 + 5.5.0 test diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index 780e4a4189..cd6860e9a6 100644 --- a/java-iam/grpc-google-iam-v1/pom.xml +++ b/java-iam/grpc-google-iam-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v1 - 1.44.0 + 1.45.0 grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.44.0 + 1.45.0 diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml index 212586e1da..306860628a 100644 --- a/java-iam/grpc-google-iam-v2/pom.xml +++ b/java-iam/grpc-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2 - 1.44.0 + 1.45.0 grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.44.0 + 1.45.0 diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml index e5cb529a72..8646ebb51c 100644 --- a/java-iam/grpc-google-iam-v2beta/pom.xml +++ b/java-iam/grpc-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2beta - 1.44.0 + 1.45.0 grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.44.0 + 1.45.0 diff --git a/java-iam/pom.xml b/java-iam/pom.xml index ceed036363..9db0954aec 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.44.0 + 1.45.0 Google IAM Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent @@ -60,7 +60,7 @@ com.google.cloud third-party-dependencies - 3.40.0 + 3.41.0 pom import @@ -88,44 +88,44 @@ com.google.api gax-bom - 2.58.0 + 2.59.0 pom import com.google.api.grpc proto-google-iam-v2 - 1.44.0 + 1.45.0 com.google.api.grpc grpc-google-iam-v2 - 1.44.0 + 1.45.0 com.google.api.grpc proto-google-common-protos - 2.49.0 + 2.50.0 com.google.api.grpc proto-google-iam-v2beta - 1.44.0 + 1.45.0 com.google.api.grpc grpc-google-iam-v1 - 1.44.0 + 1.45.0 com.google.api.grpc grpc-google-iam-v2beta - 1.44.0 + 1.45.0 com.google.api.grpc proto-google-iam-v1 - 1.44.0 + 1.45.0 javax.annotation @@ -156,7 +156,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.7.0 + 3.8.0 diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index 8bc53119b9..004caf6fc4 100644 --- a/java-iam/proto-google-iam-v1/pom.xml +++ b/java-iam/proto-google-iam-v1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v1 - 1.44.0 + 1.45.0 proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.44.0 + 1.45.0 diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMember.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMember.java new file mode 100644 index 0000000000..7f8ee8d3ca --- /dev/null +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMember.java @@ -0,0 +1,901 @@ +/* + * Copyright 2024 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v1/resource_policy_member.proto + +// Protobuf Java Version: 3.25.5 +package com.google.iam.v1; + +/** + * + * + *
+ * Output-only policy member strings of a Google Cloud resource's built-in
+ * identity.
+ * 
+ * + * Protobuf type {@code google.iam.v1.ResourcePolicyMember} + */ +public final class ResourcePolicyMember extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v1.ResourcePolicyMember) + ResourcePolicyMemberOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourcePolicyMember.newBuilder() to construct. + private ResourcePolicyMember(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourcePolicyMember() { + iamPolicyNamePrincipal_ = ""; + iamPolicyUidPrincipal_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourcePolicyMember(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v1.ResourcePolicyMember.class, + com.google.iam.v1.ResourcePolicyMember.Builder.class); + } + + public static final int IAM_POLICY_NAME_PRINCIPAL_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object iamPolicyNamePrincipal_ = ""; + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+   * and recreated with the same name, the binding will be applicable to the new
+   * resource.
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+   * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyNamePrincipal. + */ + @java.lang.Override + public java.lang.String getIamPolicyNamePrincipal() { + java.lang.Object ref = iamPolicyNamePrincipal_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamPolicyNamePrincipal_ = s; + return s; + } + } + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+   * and recreated with the same name, the binding will be applicable to the new
+   * resource.
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+   * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyNamePrincipal. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIamPolicyNamePrincipalBytes() { + java.lang.Object ref = iamPolicyNamePrincipal_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyNamePrincipal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IAM_POLICY_UID_PRINCIPAL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object iamPolicyUidPrincipal_ = ""; + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+   * resource is deleted and recreated with the same name, the binding will not
+   * be applicable to the new resource
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+   * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyUidPrincipal. + */ + @java.lang.Override + public java.lang.String getIamPolicyUidPrincipal() { + java.lang.Object ref = iamPolicyUidPrincipal_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamPolicyUidPrincipal_ = s; + return s; + } + } + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+   * resource is deleted and recreated with the same name, the binding will not
+   * be applicable to the new resource
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+   * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyUidPrincipal. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIamPolicyUidPrincipalBytes() { + java.lang.Object ref = iamPolicyUidPrincipal_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyUidPrincipal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(iamPolicyNamePrincipal_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, iamPolicyNamePrincipal_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(iamPolicyUidPrincipal_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, iamPolicyUidPrincipal_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(iamPolicyNamePrincipal_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, iamPolicyNamePrincipal_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(iamPolicyUidPrincipal_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, iamPolicyUidPrincipal_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v1.ResourcePolicyMember)) { + return super.equals(obj); + } + com.google.iam.v1.ResourcePolicyMember other = (com.google.iam.v1.ResourcePolicyMember) obj; + + if (!getIamPolicyNamePrincipal().equals(other.getIamPolicyNamePrincipal())) return false; + if (!getIamPolicyUidPrincipal().equals(other.getIamPolicyUidPrincipal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IAM_POLICY_NAME_PRINCIPAL_FIELD_NUMBER; + hash = (53 * hash) + getIamPolicyNamePrincipal().hashCode(); + hash = (37 * hash) + IAM_POLICY_UID_PRINCIPAL_FIELD_NUMBER; + hash = (53 * hash) + getIamPolicyUidPrincipal().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v1.ResourcePolicyMember parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v1.ResourcePolicyMember prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Output-only policy member strings of a Google Cloud resource's built-in
+   * identity.
+   * 
+ * + * Protobuf type {@code google.iam.v1.ResourcePolicyMember} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v1.ResourcePolicyMember) + com.google.iam.v1.ResourcePolicyMemberOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v1.ResourcePolicyMember.class, + com.google.iam.v1.ResourcePolicyMember.Builder.class); + } + + // Construct using com.google.iam.v1.ResourcePolicyMember.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + iamPolicyNamePrincipal_ = ""; + iamPolicyUidPrincipal_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_descriptor; + } + + @java.lang.Override + public com.google.iam.v1.ResourcePolicyMember getDefaultInstanceForType() { + return com.google.iam.v1.ResourcePolicyMember.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v1.ResourcePolicyMember build() { + com.google.iam.v1.ResourcePolicyMember result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v1.ResourcePolicyMember buildPartial() { + com.google.iam.v1.ResourcePolicyMember result = + new com.google.iam.v1.ResourcePolicyMember(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v1.ResourcePolicyMember result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.iamPolicyNamePrincipal_ = iamPolicyNamePrincipal_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.iamPolicyUidPrincipal_ = iamPolicyUidPrincipal_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v1.ResourcePolicyMember) { + return mergeFrom((com.google.iam.v1.ResourcePolicyMember) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v1.ResourcePolicyMember other) { + if (other == com.google.iam.v1.ResourcePolicyMember.getDefaultInstance()) return this; + if (!other.getIamPolicyNamePrincipal().isEmpty()) { + iamPolicyNamePrincipal_ = other.iamPolicyNamePrincipal_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getIamPolicyUidPrincipal().isEmpty()) { + iamPolicyUidPrincipal_ = other.iamPolicyUidPrincipal_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + iamPolicyNamePrincipal_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + iamPolicyUidPrincipal_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object iamPolicyNamePrincipal_ = ""; + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+     * and recreated with the same name, the binding will be applicable to the new
+     * resource.
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+     * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The iamPolicyNamePrincipal. + */ + public java.lang.String getIamPolicyNamePrincipal() { + java.lang.Object ref = iamPolicyNamePrincipal_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamPolicyNamePrincipal_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+     * and recreated with the same name, the binding will be applicable to the new
+     * resource.
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+     * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for iamPolicyNamePrincipal. + */ + public com.google.protobuf.ByteString getIamPolicyNamePrincipalBytes() { + java.lang.Object ref = iamPolicyNamePrincipal_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyNamePrincipal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+     * and recreated with the same name, the binding will be applicable to the new
+     * resource.
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+     * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The iamPolicyNamePrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyNamePrincipal(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + iamPolicyNamePrincipal_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+     * and recreated with the same name, the binding will be applicable to the new
+     * resource.
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+     * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearIamPolicyNamePrincipal() { + iamPolicyNamePrincipal_ = getDefaultInstance().getIamPolicyNamePrincipal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+     * and recreated with the same name, the binding will be applicable to the new
+     * resource.
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+     * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for iamPolicyNamePrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyNamePrincipalBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + iamPolicyNamePrincipal_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object iamPolicyUidPrincipal_ = ""; + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+     * resource is deleted and recreated with the same name, the binding will not
+     * be applicable to the new resource
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+     * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The iamPolicyUidPrincipal. + */ + public java.lang.String getIamPolicyUidPrincipal() { + java.lang.Object ref = iamPolicyUidPrincipal_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamPolicyUidPrincipal_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+     * resource is deleted and recreated with the same name, the binding will not
+     * be applicable to the new resource
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+     * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for iamPolicyUidPrincipal. + */ + public com.google.protobuf.ByteString getIamPolicyUidPrincipalBytes() { + java.lang.Object ref = iamPolicyUidPrincipal_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyUidPrincipal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+     * resource is deleted and recreated with the same name, the binding will not
+     * be applicable to the new resource
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+     * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The iamPolicyUidPrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyUidPrincipal(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + iamPolicyUidPrincipal_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+     * resource is deleted and recreated with the same name, the binding will not
+     * be applicable to the new resource
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+     * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearIamPolicyUidPrincipal() { + iamPolicyUidPrincipal_ = getDefaultInstance().getIamPolicyUidPrincipal(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * IAM policy binding member referring to a Google Cloud resource by
+     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+     * resource is deleted and recreated with the same name, the binding will not
+     * be applicable to the new resource
+     *
+     * Example:
+     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+     * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for iamPolicyUidPrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyUidPrincipalBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + iamPolicyUidPrincipal_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v1.ResourcePolicyMember) + } + + // @@protoc_insertion_point(class_scope:google.iam.v1.ResourcePolicyMember) + private static final com.google.iam.v1.ResourcePolicyMember DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v1.ResourcePolicyMember(); + } + + public static com.google.iam.v1.ResourcePolicyMember getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourcePolicyMember parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v1.ResourcePolicyMember getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberOrBuilder.java new file mode 100644 index 0000000000..b1c9e29e53 --- /dev/null +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v1/resource_policy_member.proto + +// Protobuf Java Version: 3.25.5 +package com.google.iam.v1; + +public interface ResourcePolicyMemberOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v1.ResourcePolicyMember) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+   * and recreated with the same name, the binding will be applicable to the new
+   * resource.
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+   * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyNamePrincipal. + */ + java.lang.String getIamPolicyNamePrincipal(); + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
+   * and recreated with the same name, the binding will be applicable to the new
+   * resource.
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
+   * 
+ * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyNamePrincipal. + */ + com.google.protobuf.ByteString getIamPolicyNamePrincipalBytes(); + + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+   * resource is deleted and recreated with the same name, the binding will not
+   * be applicable to the new resource
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+   * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyUidPrincipal. + */ + java.lang.String getIamPolicyUidPrincipal(); + /** + * + * + *
+   * IAM policy binding member referring to a Google Cloud resource by
+   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
+   * resource is deleted and recreated with the same name, the binding will not
+   * be applicable to the new resource
+   *
+   * Example:
+   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
+   * 
+ * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyUidPrincipal. + */ + com.google.protobuf.ByteString getIamPolicyUidPrincipalBytes(); +} diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberProto.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberProto.java new file mode 100644 index 0000000000..28627cdb58 --- /dev/null +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberProto.java @@ -0,0 +1,77 @@ +/* + * Copyright 2024 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v1/resource_policy_member.proto + +// Protobuf Java Version: 3.25.5 +package com.google.iam.v1; + +public final class ResourcePolicyMemberProto { + private ResourcePolicyMemberProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v1_ResourcePolicyMember_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v1_ResourcePolicyMember_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n*google/iam/v1/resource_policy_member.p" + + "roto\022\rgoogle.iam.v1\032\037google/api/field_be" + + "havior.proto\"e\n\024ResourcePolicyMember\022&\n\031" + + "iam_policy_name_principal\030\001 \001(\tB\003\340A\003\022%\n\030" + + "iam_policy_uid_principal\030\002 \001(\tB\003\340A\003B\207\001\n\021" + + "com.google.iam.v1B\031ResourcePolicyMemberP" + + "rotoP\001Z)cloud.google.com/go/iam/apiv1/ia" + + "mpb;iampb\252\002\023Google.Cloud.Iam.V1\312\002\023Google" + + "\\Cloud\\Iam\\V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_iam_v1_ResourcePolicyMember_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v1_ResourcePolicyMember_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v1_ResourcePolicyMember_descriptor, + new java.lang.String[] { + "IamPolicyNamePrincipal", "IamPolicyUidPrincipal", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v1/src/main/proto/google/iam/v1/resource_policy_member.proto b/java-iam/proto-google-iam-v1/src/main/proto/google/iam/v1/resource_policy_member.proto new file mode 100644 index 0000000000..8f9aae60d4 --- /dev/null +++ b/java-iam/proto-google-iam-v1/src/main/proto/google/iam/v1/resource_policy_member.proto @@ -0,0 +1,50 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.iam.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V1"; +option go_package = "cloud.google.com/go/iam/apiv1/iampb;iampb"; +option php_namespace = "Google\\Cloud\\Iam\\V1"; +option java_multiple_files = true; +option java_outer_classname = "ResourcePolicyMemberProto"; +option java_package = "com.google.iam.v1"; + +// Output-only policy member strings of a Google Cloud resource's built-in +// identity. +message ResourcePolicyMember { + // IAM policy binding member referring to a Google Cloud resource by + // user-assigned name (https://google.aip.dev/122). If a resource is deleted + // and recreated with the same name, the binding will be applicable to the new + // resource. + // + // Example: + // `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + string iam_policy_name_principal = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // IAM policy binding member referring to a Google Cloud resource by + // system-assigned unique identifier (https://google.aip.dev/148#uid). If a + // resource is deleted and recreated with the same name, the binding will not + // be applicable to the new resource + // + // Example: + // `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + string iam_policy_uid_principal = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index a3a38e386a..0ca0a5dbce 100644 --- a/java-iam/proto-google-iam-v2/pom.xml +++ b/java-iam/proto-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2 - 1.44.0 + 1.45.0 proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.44.0 + 1.45.0 diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml index b6318afbeb..49d4c66ecb 100644 --- a/java-iam/proto-google-iam-v2beta/pom.xml +++ b/java-iam/proto-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2beta - 1.44.0 + 1.45.0 proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.44.0 + 1.45.0 diff --git a/java-shared-dependencies/README.md b/java-shared-dependencies/README.md index 42bdb3913b..647c6946b2 100644 --- a/java-shared-dependencies/README.md +++ b/java-shared-dependencies/README.md @@ -14,7 +14,7 @@ If you are using Maven, add this to the `dependencyManagement` section. com.google.cloud google-cloud-shared-dependencies - 3.40.0 + 3.41.0 pom import diff --git a/java-shared-dependencies/dependency-analyzer/pom.xml b/java-shared-dependencies/dependency-analyzer/pom.xml index fb2aa307ac..b1f878fbd2 100644 --- a/java-shared-dependencies/dependency-analyzer/pom.xml +++ b/java-shared-dependencies/dependency-analyzer/pom.xml @@ -18,7 +18,7 @@ org.codehaus.mojo exec-maven-plugin - 3.4.1 + 3.5.0 @@ -41,7 +41,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.0 + 3.5.2 + 3.41.0 Dependency convergence test for certain artifacts in Google Cloud Shared Dependencies An dependency convergence test case for the shared dependencies BOM. A failure of this test case means diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml index c5154208ad..0f3d282b4a 100644 --- a/java-shared-dependencies/first-party-dependencies/pom.xml +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud first-party-dependencies pom - 3.40.0 + 3.41.0 Google Cloud First-party Shared Dependencies Shared first-party dependencies for Google Cloud Java libraries. @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.12.0 + 1.12.2 @@ -24,7 +24,7 @@ ${project.artifactId} 1.6.1 1.36.0 - 2.7.0 + 2.7.1
@@ -33,7 +33,7 @@ com.google.api gapic-generator-java-bom - 2.50.0 + 2.51.0 pom import @@ -45,7 +45,7 @@ com.google.cloud google-cloud-core-bom - 2.48.0 + 2.49.0 pom import @@ -69,13 +69,13 @@ com.google.cloud google-cloud-core - 2.48.0 + 2.49.0 test-jar com.google.cloud google-cloud-core - 2.48.0 + 2.49.0 tests diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml index 28bfe46b38..3487100fed 100644 --- a/java-shared-dependencies/pom.xml +++ b/java-shared-dependencies/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-shared-dependencies pom - 3.40.0 + 3.41.0 first-party-dependencies third-party-dependencies @@ -17,7 +17,7 @@ com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../gapic-generator-java-pom-parent @@ -31,14 +31,14 @@ com.google.cloud first-party-dependencies - 3.40.0 + 3.41.0 pom import com.google.cloud third-party-dependencies - 3.40.0 + 3.41.0 pom import diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index 92ebd9eb19..190cbc4faa 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud third-party-dependencies pom - 3.40.0 + 3.41.0 Google Cloud Third-party Shared Dependencies Shared third-party dependencies for Google Cloud Java libraries. @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.50.0 + 2.51.0 ../../gapic-generator-java-pom-parent @@ -27,21 +27,21 @@ 1.24 0.31.1 3.0.2 - 2.18.0 - 2.35.1 + 2.18.2 + 2.36.0 1.17.1 4.4.16 4.5.14 - 3.47.0 + 3.48.3 0.27.0 3.0.0 - 0.32.0 + 0.33.0 2.1.0-alpha 1.26.0-alpha 0.8 15.0.2 - 0.7.1 + 0.6.0 1.15.0
diff --git a/java-shared-dependencies/unmanaged-dependency-check/pom.xml b/java-shared-dependencies/unmanaged-dependency-check/pom.xml index 80574b2410..f9b5d031d7 100644 --- a/java-shared-dependencies/unmanaged-dependency-check/pom.xml +++ b/java-shared-dependencies/unmanaged-dependency-check/pom.xml @@ -22,7 +22,7 @@ org.codehaus.mojo exec-maven-plugin - 3.4.1 + 3.5.0 diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index cc7edda551..5a39e3d3c4 100644 --- a/java-shared-dependencies/upper-bound-check/pom.xml +++ b/java-shared-dependencies/upper-bound-check/pom.xml @@ -4,7 +4,7 @@ com.google.cloud shared-dependencies-upper-bound-test pom - 3.40.0 + 3.41.0 Upper bound test for Google Cloud Shared Dependencies An upper bound test case for the shared dependencies BOM. A failure of this test case means @@ -16,7 +16,7 @@ com.google.cloud google-cloud-shared-config - 1.12.0 + 1.12.2 @@ -30,7 +30,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.40.0 + 3.41.0 pom import diff --git a/renovate.json b/renovate.json index f9db6a2237..02a90af7ad 100644 --- a/renovate.json +++ b/renovate.json @@ -6,7 +6,9 @@ "ignoreDeps": [ "rules_pkg" ], - "ignorePaths": ["^library_generation/requirements\\.txt$"], + "ignorePaths": [ + "^library_generation/requirements\\.txt$" + ], "customManagers": [ { "customType": "regex", @@ -44,9 +46,13 @@ }, { "customType": "regex", - "fileMatch": ["^.kokoro/presubmit/graalvm-native.*.cfg$"], - "matchStrings": ["value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm:(?.*?)\"", - "value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm17:(?.*?)\""], + "fileMatch": [ + "^.kokoro/presubmit/graalvm-native.*.cfg$" + ], + "matchStrings": [ + "value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm:(?.*?)\"", + "value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm17:(?.*?)\"" + ], "depNameTemplate": "ghcr.io/graalvm/graalvm-ce", "datasourceTemplate": "docker" }, @@ -60,11 +66,26 @@ ], "depNameTemplate": "com.google.cloud:google-cloud-shared-config", "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^.cloudbuild/library_generation/library_generation.Dockerfile$" + ], + "matchStrings": [ + "OWLBOT_CLI_COMMITTISH=(?.*?)\\n" + ], + "currentValueTemplate": "main", + "depNameTemplate": "repo-automation-bots", + "packageNameTemplate": "https://github.com/googleapis/repo-automation-bots", + "datasourceTemplate": "git-refs" } ], "packageRules": [ { - "matchPackageNames": ["com.google.cloud:google-cloud-shared-config"], + "matchPackageNames": [ + "com.google.cloud:google-cloud-shared-config" + ], "registryUrls": [ "https://repo.maven.apache.org/maven2/", "https://repo1.maven.org/maven2" @@ -74,114 +95,114 @@ "matchUpdateTypes": [ "major" ], - "matchPackagePatterns": [ + "enabled": false, + "matchPackageNames": [ "*" - ], - "enabled": false + ] }, { - "matchPackagePatterns": [ - "^com.google.protobuf:" - ], - "enabled": false + "enabled": false, + "matchPackageNames": [ + "/^com.google.protobuf:/" + ] }, { - "matchPackagePatterns": [ - "^com.google.guava:" - ], - "versioning": "docker" + "versioning": "docker", + "matchPackageNames": [ + "/^com.google.guava:/" + ] }, { - "matchPackagePatterns": [ - "*" - ], "semanticCommitType": "deps", - "semanticCommitScope": null + "semanticCommitScope": null, + "matchPackageNames": [ + "*" + ] }, { - "matchPackagePatterns": [ - "^org.apache.maven", - "^org.jacoco:", - "^org.codehaus.mojo:", - "^org.sonatype.plugins:", - "^com.coveo:", - "^com.google.cloud:google-cloud-shared-config" - ], "semanticCommitType": "build", "semanticCommitScope": "deps", - "enabled": true + "enabled": true, + "matchPackageNames": [ + "/^org.apache.maven/", + "/^org.jacoco:/", + "/^org.codehaus.mojo:/", + "/^org.sonatype.plugins:/", + "/^com.coveo:/", + "/^com.google.cloud:google-cloud-shared-config/" + ] }, { - "matchPackagePatterns": [ - "^{{metadata['repo']['distribution_name']}}", - "^com.google.cloud:libraries-bom", - "^com.google.cloud.samples:shared-configuration" - ], "semanticCommitType": "chore", - "semanticCommitScope": "deps" + "semanticCommitScope": "deps", + "matchPackageNames": [ + "/^{{metadata['repo']['distribution_name']}}/", + "/^com.google.cloud:libraries-bom/", + "/^com.google.cloud.samples:shared-configuration/" + ] }, { - "matchPackagePatterns": [ - "^junit:junit", - "^com.google.truth:truth", - "^org.mockito:mockito-core", - "^org.objenesis:objenesis", - "^com.google.cloud:google-cloud-conformance-tests" - ], "semanticCommitType": "test", - "semanticCommitScope": "deps" + "semanticCommitScope": "deps", + "matchPackageNames": [ + "/^junit:junit/", + "/^com.google.truth:truth/", + "/^org.mockito:mockito-core/", + "/^org.objenesis:objenesis/", + "/^com.google.cloud:google-cloud-conformance-tests/" + ] }, { - "matchPackagePatterns": [ - "^com.google.cloud:google-cloud-" - ], - "ignoreUnstable": false + "ignoreUnstable": false, + "matchPackageNames": [ + "/^com.google.cloud:google-cloud-/" + ] }, { - "matchPackagePatterns": [ - "^com.fasterxml.jackson.core" - ], - "groupName": "jackson dependencies" + "groupName": "jackson dependencies", + "matchPackageNames": [ + "/^com.fasterxml.jackson.core/" + ] }, { - "matchPackagePatterns": [ - "^io.grpc" - ], - "groupName": "gRPC dependencies" + "groupName": "gRPC dependencies", + "matchPackageNames": [ + "/^io.grpc/" + ] }, { - "matchPackagePatterns": [ - "^com.google.auth" - ], - "groupName": "Google Auth Library dependencies" + "groupName": "Google Auth Library dependencies", + "matchPackageNames": [ + "/^com.google.auth/" + ] }, { - "matchPackagePatterns": [ - "com.google.api.grpc:grpc-google-common-protos", - "com.google.api.grpc:grpc-google-iam-v1", - "com.google.api.grpc:proto-google-common-protos", - "com.google.api.grpc:proto-google-iam-v1", - "com.google.api:api-common" - ], - "groupName": "Google API dependencies" + "groupName": "Google API dependencies", + "matchPackageNames": [ + "/com.google.api.grpc:grpc-google-common-protos/", + "/com.google.api.grpc:grpc-google-iam-v1/", + "/com.google.api.grpc:proto-google-common-protos/", + "/com.google.api.grpc:proto-google-iam-v1/", + "/com.google.api:api-common/" + ] }, { - "matchPackagePatterns": [ - "^com.google.http-client" - ], - "groupName": "Google HTTP Client dependencies" + "groupName": "Google HTTP Client dependencies", + "matchPackageNames": [ + "/^com.google.http-client/" + ] }, { - "matchPackagePatterns": [ - "^io.opencensus" - ], - "groupName": "OpenCensus dependencies" + "groupName": "OpenCensus dependencies", + "matchPackageNames": [ + "/^io.opencensus/" + ] }, { - "matchPackagePatterns": [ - "^io.netty" - ], - "groupName": "Netty dependencies" + "groupName": "Netty dependencies", + "matchPackageNames": [ + "/^io.netty/" + ] } ] } diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index ee692e1aaf..e33069139a 100644 --- a/sdk-platform-java-config/pom.xml +++ b/sdk-platform-java-config/pom.xml @@ -4,7 +4,7 @@ com.google.cloud sdk-platform-java-config pom - 3.40.0 + 3.41.0 SDK Platform For Java Configurations Shared build configuration for Google Cloud Java libraries. @@ -13,10 +13,10 @@ com.google.cloud google-cloud-shared-config - 1.12.0 + 1.12.2 - 3.40.0 + 3.41.0 \ No newline at end of file diff --git a/showcase/pom.xml b/showcase/pom.xml index dc1676bb31..8ee69366da 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.12.0 + 1.12.2 @@ -34,7 +34,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.40.0 + 3.41.0 pom import @@ -56,7 +56,7 @@ org.junit junit-bom - 5.11.2 + 5.11.3 pom import @@ -108,7 +108,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.0 + 3.5.2 sponge_log ${skipUnitTests} @@ -141,7 +141,7 @@ org.codehaus.mojo exec-maven-plugin - 3.4.1 + 3.5.0 false @@ -169,7 +169,7 @@ org.codehaus.mojo exec-maven-plugin - 3.4.1 + 3.5.0 false diff --git a/showcase/scripts/generate_showcase.sh b/showcase/scripts/generate_showcase.sh index cfb3c713ae..0c6cfe4eaf 100755 --- a/showcase/scripts/generate_showcase.sh +++ b/showcase/scripts/generate_showcase.sh @@ -96,7 +96,11 @@ gapic_additional_protos="google/iam/v1/iam_policy.proto google/cloud/location/lo path_to_generator_parent_pom="${SCRIPT_DIR}/../../gapic-generator-java-pom-parent/pom.xml" protoc_version=$(get_version_from_pom "${path_to_generator_parent_pom}" "protobuf.version" \ | cut -d. -f2-) +download_protoc "${protoc_version}" "linux-x86_64" +mv "bin" "include" "${well_known_folder}" grpc_version=$(get_version_from_pom "${path_to_generator_parent_pom}" "grpc.version") +download_grpc_plugin "${grpc_version}" "linux-x86_64" +mv "protoc-gen-grpc-java.exe" "${well_known_folder}" rest_numeric_enums="false" transport="grpc+rest" gapic_yaml="" @@ -107,8 +111,6 @@ rm -rdf output/showcase-output mkdir output/showcase-output set +e bash "${SCRIPT_DIR}/../../hermetic_build/library_generation/generate_library.sh" \ - --protoc_version "${protoc_version}" \ - --grpc_version "${grpc_version}" \ --proto_path "schema/google/showcase/v1beta1" \ --destination_path "showcase-output" \ --gapic_additional_protos "${gapic_additional_protos}" \ diff --git a/versions.txt b/versions.txt index 6302c33d86..c4160e3414 100644 --- a/versions.txt +++ b/versions.txt @@ -1,19 +1,19 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.50.0:2.50.0 -api-common:2.41.0:2.41.0 -gax:2.58.0:2.58.0 -gax-grpc:2.58.0:2.58.0 -gax-httpjson:0.143.0:0.143.0 -proto-google-common-protos:2.49.0:2.49.0 -grpc-google-common-protos:2.49.0:2.49.0 -proto-google-iam-v1:1.44.0:1.44.0 -grpc-google-iam-v1:1.44.0:1.44.0 -proto-google-iam-v2beta:1.44.0:1.44.0 -grpc-google-iam-v2beta:1.44.0:1.44.0 -google-iam-policy:1.44.0:1.44.0 -proto-google-iam-v2:1.44.0:1.44.0 -grpc-google-iam-v2:1.44.0:1.44.0 -google-cloud-core:2.48.0:2.48.0 -google-cloud-shared-dependencies:3.40.0:3.40.0 +gapic-generator-java:2.51.0:2.51.0 +api-common:2.42.0:2.42.0 +gax:2.59.0:2.59.0 +gax-grpc:2.59.0:2.59.0 +gax-httpjson:0.144.0:0.144.0 +proto-google-common-protos:2.50.0:2.50.0 +grpc-google-common-protos:2.50.0:2.50.0 +proto-google-iam-v1:1.45.0:1.45.0 +grpc-google-iam-v1:1.45.0:1.45.0 +proto-google-iam-v2beta:1.45.0:1.45.0 +grpc-google-iam-v2beta:1.45.0:1.45.0 +google-iam-policy:1.45.0:1.45.0 +proto-google-iam-v2:1.45.0:1.45.0 +grpc-google-iam-v2:1.45.0:1.45.0 +google-cloud-core:2.49.0:2.49.0 +google-cloud-shared-dependencies:3.41.0:3.41.0