From 34bce16887e17ab5f41bec0d5125dad085a2bc22 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 20:46:28 +0000 Subject: [PATCH 01/17] chore(main): release 2.53.1-SNAPSHOT (#3627) :robot: I have created a release *beep* *boop* ---
2.53.1-SNAPSHOT ### Updating meta-information for bleeding-edge SNAPSHOT release.
--- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .cloudbuild/graalvm/cloudbuild-test-a.yaml | 2 +- .cloudbuild/graalvm/cloudbuild-test-b.yaml | 2 +- .cloudbuild/graalvm/cloudbuild.yaml | 2 +- .../cloudbuild-library-generation-push.yaml | 2 +- .../library_generation.Dockerfile | 2 +- .../library_generation_airlock.Dockerfile | 2 +- WORKSPACE | 2 +- api-common-java/pom.xml | 4 +-- coverage-report/pom.xml | 8 ++--- gapic-generator-java-bom/pom.xml | 26 +++++++-------- gapic-generator-java-pom-parent/pom.xml | 2 +- gapic-generator-java/pom.xml | 6 ++-- gax-java/dependencies.properties | 8 ++--- gax-java/gax-bom/pom.xml | 20 ++++++------ gax-java/gax-grpc/pom.xml | 4 +-- gax-java/gax-httpjson/pom.xml | 4 +-- gax-java/gax/pom.xml | 4 +-- gax-java/pom.xml | 14 ++++---- .../grpc-google-common-protos/pom.xml | 4 +-- java-common-protos/pom.xml | 10 +++--- .../proto-google-common-protos/pom.xml | 4 +-- java-core/google-cloud-core-bom/pom.xml | 10 +++--- java-core/google-cloud-core-grpc/pom.xml | 4 +-- java-core/google-cloud-core-http/pom.xml | 4 +-- java-core/google-cloud-core/pom.xml | 4 +-- java-core/pom.xml | 6 ++-- java-iam/grpc-google-iam-v1/pom.xml | 4 +-- java-iam/grpc-google-iam-v2/pom.xml | 4 +-- java-iam/grpc-google-iam-v2beta/pom.xml | 4 +-- java-iam/pom.xml | 22 ++++++------- java-iam/proto-google-iam-v1/pom.xml | 4 +-- java-iam/proto-google-iam-v2/pom.xml | 4 +-- java-iam/proto-google-iam-v2beta/pom.xml | 4 +-- .../dependency-convergence-check/pom.xml | 2 +- .../first-party-dependencies/pom.xml | 10 +++--- java-shared-dependencies/pom.xml | 8 ++--- .../third-party-dependencies/pom.xml | 4 +-- .../upper-bound-check/pom.xml | 4 +-- sdk-platform-java-config/pom.xml | 4 +-- showcase/pom.xml | 2 +- versions.txt | 32 +++++++++---------- 41 files changed, 136 insertions(+), 136 deletions(-) diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml index 53e97f96b1..02a9fca76c 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.43.0' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.14.2' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml index 0bcc84a318..655eb6a174 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.43.0' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.14.2' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml index 505444efbf..96ad7f7f42 100644 --- a/.cloudbuild/graalvm/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.43.0' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.14.2' steps: # GraalVM A build diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml index bb29b24bbc..1f7c9df729 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _GAPIC_GENERATOR_JAVA_VERSION: '2.53.0' # {x-version-update:gapic-generator-java:current} + _GAPIC_GENERATOR_JAVA_VERSION: '2.53.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current} _PRIVATE_IMAGE_NAME: "us-docker.pkg.dev/java-hermetic-build-prod/private-resources/java-library-generation" _PRIVATE_SHA_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:${COMMIT_SHA}" _PRIVATE_LATEST_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:latest" diff --git a/.cloudbuild/library_generation/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile index 6956400de7..c1a9bfce79 100644 --- a/.cloudbuild/library_generation/library_generation.Dockerfile +++ b/.cloudbuild/library_generation/library_generation.Dockerfile @@ -20,7 +20,7 @@ FROM docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine@sha256:456f60c1643c WORKDIR /sdk-platform-java COPY . . # {x-version-update-start:gapic-generator-java:current} -ENV DOCKER_GAPIC_GENERATOR_VERSION="2.53.0" +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.53.1-SNAPSHOT" # {x-version-update-end} RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip diff --git a/.cloudbuild/library_generation/library_generation_airlock.Dockerfile b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile index 6391b6ad99..b9162f977d 100644 --- a/.cloudbuild/library_generation/library_generation_airlock.Dockerfile +++ b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile @@ -21,7 +21,7 @@ FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/maven@sha256:d3f0 WORKDIR /sdk-platform-java COPY . . # {x-version-update-start:gapic-generator-java:current} -ENV DOCKER_GAPIC_GENERATOR_VERSION="2.53.0" +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.53.1-SNAPSHOT" # {x-version-update-end} RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip diff --git a/WORKSPACE b/WORKSPACE index 856a2dc8e2..2a6449b6f7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -58,7 +58,7 @@ 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.53.0" # {x-version-update:gapic-generator-java:current} +_gapic_generator_java_version = "2.53.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current} maven_install( artifacts = [ diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index d76216e990..479d7f4a80 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,14 +5,14 @@ com.google.api api-common jar - 2.44.0 + 2.44.1-SNAPSHOT API Common Common utilities for Google APIs in Java com.google.api gapic-generator-java-pom-parent - 2.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 2adbf97f5e..eb06248bf3 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -31,22 +31,22 @@ com.google.api gax - 2.61.0 + 2.61.1-SNAPSHOT com.google.api gax-grpc - 2.61.0 + 2.61.1-SNAPSHOT com.google.api gax-httpjson - 2.61.0 + 2.61.1-SNAPSHOT com.google.api api-common - 2.44.0 + 2.44.1-SNAPSHOT diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index 7fc95dda14..280463a887 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.53.0 + 2.53.1-SNAPSHOT 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.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -75,61 +75,61 @@ com.google.api api-common - 2.44.0 + 2.44.1-SNAPSHOT com.google.api gax-bom - 2.61.0 + 2.61.1-SNAPSHOT pom import com.google.api gapic-generator-java - 2.53.0 + 2.53.1-SNAPSHOT com.google.api.grpc grpc-google-common-protos - 2.52.0 + 2.52.1-SNAPSHOT com.google.api.grpc proto-google-common-protos - 2.52.0 + 2.52.1-SNAPSHOT com.google.api.grpc proto-google-iam-v1 - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc proto-google-iam-v2 - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc proto-google-iam-v2beta - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v1 - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2 - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2beta - 1.47.0 + 1.47.1-SNAPSHOT diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index f772893804..1fbe68dc71 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.53.0 + 2.53.1-SNAPSHOT pom GAPIC Generator Java POM Parent https://github.com/googleapis/sdk-platform-java diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 7c4f55b242..4b08253e11 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.53.0 + 2.53.1-SNAPSHOT GAPIC Generator Java GAPIC generator Java @@ -22,7 +22,7 @@ com.google.api gapic-generator-java-pom-parent - 2.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -31,7 +31,7 @@ com.google.api gapic-generator-java-bom - 2.53.0 + 2.53.1-SNAPSHOT pom import diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 10fa132d66..18246ca45a 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.61.0 +version.gax=2.61.1-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.61.0 +version.gax_grpc=2.61.1-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.61.0 +version.gax_bom=2.61.1-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_httpjson=2.61.0 +version.gax_httpjson=2.61.1-SNAPSHOT # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 95e37612f4..039144c644 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.61.0 + 2.61.1-SNAPSHOT pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -43,55 +43,55 @@ com.google.api gax - 2.61.0 + 2.61.1-SNAPSHOT com.google.api gax - 2.61.0 + 2.61.1-SNAPSHOT test-jar testlib com.google.api gax - 2.61.0 + 2.61.1-SNAPSHOT testlib com.google.api gax-grpc - 2.61.0 + 2.61.1-SNAPSHOT com.google.api gax-grpc - 2.61.0 + 2.61.1-SNAPSHOT test-jar testlib com.google.api gax-grpc - 2.61.0 + 2.61.1-SNAPSHOT testlib com.google.api gax-httpjson - 2.61.0 + 2.61.1-SNAPSHOT com.google.api gax-httpjson - 2.61.0 + 2.61.1-SNAPSHOT test-jar testlib com.google.api gax-httpjson - 2.61.0 + 2.61.1-SNAPSHOT testlib diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index 53249d5f51..01a62345ef 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.61.0 + 2.61.1-SNAPSHOT jar GAX (Google Api eXtensions) for Java (gRPC) Google Api eXtensions for Java (gRPC) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.61.0 + 2.61.1-SNAPSHOT diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index 449634a09b..268f5e1bdc 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.61.0 + 2.61.1-SNAPSHOT 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.61.0 + 2.61.1-SNAPSHOT diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index e1dec7f4d7..4c2fa5f694 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax - 2.61.0 + 2.61.1-SNAPSHOT jar GAX (Google Api eXtensions) for Java (Core) Google Api eXtensions for Java (Core) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.61.0 + 2.61.1-SNAPSHOT diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 3e83baf531..72b31f7070 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,14 +4,14 @@ com.google.api gax-parent pom - 2.61.0 + 2.61.1-SNAPSHOT GAX (Google Api eXtensions) for Java (Parent) Google Api eXtensions for Java (Parent) com.google.api gapic-generator-java-pom-parent - 2.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.api api-common - 2.44.0 + 2.44.1-SNAPSHOT com.google.auth @@ -98,24 +98,24 @@ com.google.api gax - 2.61.0 + 2.61.1-SNAPSHOT com.google.api gax - 2.61.0 + 2.61.1-SNAPSHOT test-jar testlib com.google.api.grpc proto-google-common-protos - 2.52.0 + 2.52.1-SNAPSHOT com.google.api.grpc grpc-google-common-protos - 2.52.0 + 2.52.1-SNAPSHOT io.grpc diff --git a/java-common-protos/grpc-google-common-protos/pom.xml b/java-common-protos/grpc-google-common-protos/pom.xml index 9ea288a2f1..e996ebe3f7 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.52.0 + 2.52.1-SNAPSHOT grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.52.0 + 2.52.1-SNAPSHOT diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index e2e1c67747..37301dcd02 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.52.0 + 2.52.1-SNAPSHOT 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.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -51,7 +51,7 @@ com.google.cloud third-party-dependencies - 3.43.0 + 3.43.1-SNAPSHOT pom import @@ -65,7 +65,7 @@ com.google.api.grpc grpc-google-common-protos - 2.52.0 + 2.52.1-SNAPSHOT io.grpc @@ -77,7 +77,7 @@ com.google.api.grpc proto-google-common-protos - 2.52.0 + 2.52.1-SNAPSHOT com.google.guava diff --git a/java-common-protos/proto-google-common-protos/pom.xml b/java-common-protos/proto-google-common-protos/pom.xml index 330e016a87..505093f004 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.52.0 + 2.52.1-SNAPSHOT proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.52.0 + 2.52.1-SNAPSHOT diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml index 9c154e70b9..3897effd06 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.51.0 + 2.51.1-SNAPSHOT pom com.google.api gapic-generator-java-pom-parent - 2.53.0 + 2.53.1-SNAPSHOT ../../gapic-generator-java-pom-parent @@ -23,17 +23,17 @@ com.google.cloud google-cloud-core - 2.51.0 + 2.51.1-SNAPSHOT com.google.cloud google-cloud-core-grpc - 2.51.0 + 2.51.1-SNAPSHOT com.google.cloud google-cloud-core-http - 2.51.0 + 2.51.1-SNAPSHOT diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index ee4273f387..3825901deb 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.51.0 + 2.51.1-SNAPSHOT jar Google Cloud Core gRPC @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.51.0 + 2.51.1-SNAPSHOT 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 835ef2367b..2c7eb9f1fa 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.51.0 + 2.51.1-SNAPSHOT jar Google Cloud Core HTTP @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.51.0 + 2.51.1-SNAPSHOT google-cloud-core-http diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index 700b15a92a..069c499f68 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.51.0 + 2.51.1-SNAPSHOT jar Google Cloud Core @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.51.0 + 2.51.1-SNAPSHOT google-cloud-core diff --git a/java-core/pom.xml b/java-core/pom.xml index cf557816ac..0a681e80a7 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.51.0 + 2.51.1-SNAPSHOT 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.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -33,7 +33,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.43.0 + 3.43.1-SNAPSHOT pom import diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index 8946e468cf..7215872a8f 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.47.0 + 1.47.1-SNAPSHOT grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.47.0 + 1.47.1-SNAPSHOT diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml index ceb1f2bc82..9b55bedb2c 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.47.0 + 1.47.1-SNAPSHOT grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.47.0 + 1.47.1-SNAPSHOT diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml index f4907c95ff..33ed491c6a 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.47.0 + 1.47.1-SNAPSHOT grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.0 + 1.47.1-SNAPSHOT diff --git a/java-iam/pom.xml b/java-iam/pom.xml index 7f65a9e8a6..f53c001933 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.47.0 + 1.47.1-SNAPSHOT Google IAM Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.cloud third-party-dependencies - 3.43.0 + 3.43.1-SNAPSHOT pom import @@ -78,44 +78,44 @@ com.google.api gax-bom - 2.61.0 + 2.61.1-SNAPSHOT pom import com.google.api.grpc proto-google-iam-v2 - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2 - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc proto-google-common-protos - 2.52.0 + 2.52.1-SNAPSHOT com.google.api.grpc proto-google-iam-v2beta - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v1 - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2beta - 1.47.0 + 1.47.1-SNAPSHOT com.google.api.grpc proto-google-iam-v1 - 1.47.0 + 1.47.1-SNAPSHOT javax.annotation diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index 3a1adeaac8..f33b239f78 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.47.0 + 1.47.1-SNAPSHOT proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.0 + 1.47.1-SNAPSHOT diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index 994e0a5a26..79165f484f 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.47.0 + 1.47.1-SNAPSHOT proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.0 + 1.47.1-SNAPSHOT diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml index 185d36705a..2b3b1f2014 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.47.0 + 1.47.1-SNAPSHOT proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.0 + 1.47.1-SNAPSHOT diff --git a/java-shared-dependencies/dependency-convergence-check/pom.xml b/java-shared-dependencies/dependency-convergence-check/pom.xml index df1a41e374..485d2b121a 100644 --- a/java-shared-dependencies/dependency-convergence-check/pom.xml +++ b/java-shared-dependencies/dependency-convergence-check/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud shared-dependencies-dependency-convergence-test - 3.43.0 + 3.43.1-SNAPSHOT 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 6e6078440d..3ea05cfec8 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.43.0 + 3.43.1-SNAPSHOT Google Cloud First-party Shared Dependencies Shared first-party dependencies for Google Cloud Java libraries. @@ -33,7 +33,7 @@ com.google.api gapic-generator-java-bom - 2.53.0 + 2.53.1-SNAPSHOT pom import @@ -45,7 +45,7 @@ com.google.cloud google-cloud-core-bom - 2.51.0 + 2.51.1-SNAPSHOT pom import @@ -69,13 +69,13 @@ com.google.cloud google-cloud-core - 2.51.0 + 2.51.1-SNAPSHOT test-jar com.google.cloud google-cloud-core - 2.51.0 + 2.51.1-SNAPSHOT tests diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml index 68e957c309..f4f756f489 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.43.0 + 3.43.1-SNAPSHOT first-party-dependencies third-party-dependencies @@ -17,7 +17,7 @@ com.google.api gapic-generator-java-pom-parent - 2.53.0 + 2.53.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -31,14 +31,14 @@ com.google.cloud first-party-dependencies - 3.43.0 + 3.43.1-SNAPSHOT pom import com.google.cloud third-party-dependencies - 3.43.0 + 3.43.1-SNAPSHOT pom import diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index 86ebc603ae..1945a729ab 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.43.0 + 3.43.1-SNAPSHOT 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.53.0 + 2.53.1-SNAPSHOT ../../gapic-generator-java-pom-parent diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index 8273dd5281..90cad644fd 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.43.0 + 3.43.1-SNAPSHOT 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 @@ -30,7 +30,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.43.0 + 3.43.1-SNAPSHOT pom import diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index 4a76365ec0..879f15151f 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.43.0 + 3.43.1-SNAPSHOT SDK Platform For Java Configurations Shared build configuration for Google Cloud Java libraries. @@ -17,6 +17,6 @@ - 3.43.0 + 3.43.1-SNAPSHOT \ No newline at end of file diff --git a/showcase/pom.xml b/showcase/pom.xml index 6449c9a794..436d52d359 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -34,7 +34,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.43.0 + 3.43.1-SNAPSHOT pom import diff --git a/versions.txt b/versions.txt index de032f3f3e..bafc3eee6c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,19 +1,19 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.53.0:2.53.0 -api-common:2.44.0:2.44.0 -gax:2.61.0:2.61.0 -gax-grpc:2.61.0:2.61.0 -gax-httpjson:0.146.0:0.146.0 -proto-google-common-protos:2.52.0:2.52.0 -grpc-google-common-protos:2.52.0:2.52.0 -proto-google-iam-v1:1.47.0:1.47.0 -grpc-google-iam-v1:1.47.0:1.47.0 -proto-google-iam-v2beta:1.47.0:1.47.0 -grpc-google-iam-v2beta:1.47.0:1.47.0 -google-iam-policy:1.47.0:1.47.0 -proto-google-iam-v2:1.47.0:1.47.0 -grpc-google-iam-v2:1.47.0:1.47.0 -google-cloud-core:2.51.0:2.51.0 -google-cloud-shared-dependencies:3.43.0:3.43.0 +gapic-generator-java:2.53.0:2.53.1-SNAPSHOT +api-common:2.44.0:2.44.1-SNAPSHOT +gax:2.61.0:2.61.1-SNAPSHOT +gax-grpc:2.61.0:2.61.1-SNAPSHOT +gax-httpjson:0.146.0:0.146.1-SNAPSHOT +proto-google-common-protos:2.52.0:2.52.1-SNAPSHOT +grpc-google-common-protos:2.52.0:2.52.1-SNAPSHOT +proto-google-iam-v1:1.47.0:1.47.1-SNAPSHOT +grpc-google-iam-v1:1.47.0:1.47.1-SNAPSHOT +proto-google-iam-v2beta:1.47.0:1.47.1-SNAPSHOT +grpc-google-iam-v2beta:1.47.0:1.47.1-SNAPSHOT +google-iam-policy:1.47.0:1.47.1-SNAPSHOT +proto-google-iam-v2:1.47.0:1.47.1-SNAPSHOT +grpc-google-iam-v2:1.47.0:1.47.1-SNAPSHOT +google-cloud-core:2.51.0:2.51.1-SNAPSHOT +google-cloud-shared-dependencies:3.43.0:3.43.1-SNAPSHOT From a96bdc56be2b3d80efb4bab4956c78709afc9a9d Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Tue, 11 Feb 2025 11:57:03 -0500 Subject: [PATCH 02/17] chore: Update DEVELOPMENT.md according to WORKSPACE (#3628) removed line from [WORKSPACE](https://github.com/googleapis/googleapis/blob/d383e2fe6661b29ea0def03c3900080ba953dd26/WORKSPACE#L292-L304) a while ago. --- gapic-generator-java/DEVELOPMENT.md | 1 - 1 file changed, 1 deletion(-) diff --git a/gapic-generator-java/DEVELOPMENT.md b/gapic-generator-java/DEVELOPMENT.md index b1fd40c2dc..b00d7b8ee7 100644 --- a/gapic-generator-java/DEVELOPMENT.md +++ b/gapic-generator-java/DEVELOPMENT.md @@ -142,7 +142,6 @@ To generate a production GAPIC API: ] + PROTOBUF_MAVEN_ARTIFACTS + IO_GRPC_GRPC_JAVA_ARTIFACTS, generate_compat_repositories = True, - override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS, #Update this False for local development fail_on_missing_checksum = True, repositories = [ From 49ac09d263daad8ceb2e14a623db242339880670 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 11 Feb 2025 15:39:15 -0500 Subject: [PATCH 03/17] deps: Update opentelemetry-semconv to v1.29.0-alpha (#3635) Discovered as part of CI error in https://github.com/googleapis/google-cloud-java/pull/11426 ``` Error: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce) on project google-cloud-notification: Error: Rule 2: org.apache.maven.enforcer.rules.dependency.RequireUpperBoundDeps failed with message: Error: Failed while enforcing RequireUpperBoundDeps. The error(s) are [ Error: Require upper bound dependencies error for io.opentelemetry.semconv:opentelemetry-semconv:1.26.0-alpha paths to dependency are: Error: +-com.google.cloud:google-cloud-notification:0.176.0-beta-SNAPSHOT Error: +-com.google.cloud:google-cloud-storage:2.48.1 Error: +-io.opentelemetry.semconv:opentelemetry-semconv:1.26.0-alpha (managed) <-- io.opentelemetry.semconv:opentelemetry-semconv:1.27.0-alpha Error: ] ``` --- java-shared-dependencies/third-party-dependencies/pom.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index 1945a729ab..a04b8348be 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -38,7 +38,7 @@ 3.0.0 0.33.0 2.1.0-alpha - 1.26.0-alpha + 1.29.0-alpha 0.8 15.0.2 0.6.0 @@ -144,10 +144,12 @@ opentelemetry-semconv ${opentelemetry-semconv.version} + + io.opentelemetry opentelemetry-semconv - ${opentelemetry-semconv.version} + 1.26.0-alpha com.google.cloud.opentelemetry From b2aa64399248122af45141a0112573cbd7508595 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Fri, 14 Feb 2025 15:42:17 -0500 Subject: [PATCH 04/17] test: remove wildcard in test class import (#3634) --- .../java/com/google/api/gax/grpc/GrpcTransportChannelTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportChannelTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportChannelTest.java index 337f054c42..f762c3899e 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportChannelTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportChannelTest.java @@ -30,7 +30,7 @@ package com.google.api.gax.grpc; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertFalse; import io.grpc.ManagedChannel; import org.junit.jupiter.api.Test; From ad26cf98548e325c99edb263baf8fe1a7696e634 Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Tue, 18 Feb 2025 18:19:49 +0000 Subject: [PATCH 05/17] deps: update grpc to 1.70.0 (#3641) This manual update is to sync grpc versions with google-http-java-client before cutting LTS release --- .cloudbuild/library_generation/library_generation.Dockerfile | 2 +- gapic-generator-java-pom-parent/pom.xml | 2 +- gax-java/dependencies.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.cloudbuild/library_generation/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile index c1a9bfce79..79d424de2a 100644 --- a/.cloudbuild/library_generation/library_generation.Dockerfile +++ b/.cloudbuild/library_generation/library_generation.Dockerfile @@ -51,7 +51,7 @@ FROM docker.io/library/python:3.13.2-alpine3.20@sha256:816feb29731cdee64b15b0ae9 ARG OWLBOT_CLI_COMMITTISH=3a68a9c0de318784b3aefadcc502a6521b3f1bc5 ARG PROTOC_VERSION=25.5 -ARG GRPC_VERSION=1.69.0 +ARG GRPC_VERSION=1.69.1 ARG JAVA_FORMAT_VERSION=1.7 ENV HOME=/home ENV OS_ARCHITECTURE="linux-x86_64" diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 1fbe68dc71..a426cb9ee9 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -26,7 +26,7 @@ 1.3.2 - 1.69.0 + 1.69.1 1.32.1 1.46.1 2.12.1 diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 18246ca45a..4d09063fbb 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -28,7 +28,7 @@ version.gax_httpjson=2.61.1-SNAPSHOT version.com_google_protobuf=3.25.5 version.google_java_format=1.15.0 -version.io_grpc=1.69.0 +version.io_grpc=1.70.0 # Maven artifacts. # Note, the actual name of each property matters (bazel build scripts depend on it). From fe002fab1ab65b29eeb5510d1ba1ef72fa3441b0 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Mon, 24 Feb 2025 12:03:17 -0500 Subject: [PATCH 06/17] feat: add client side logging with slf4j (#3403) Changes to introduce client logging debug feature to Gax. Guide on usage will be added separately to README file. - Brings in `slf4j-api` as optional dependency to gax-java - `LoggingUtils`, `LogData` and `LoggerProvider` are public because access are needed from gax-grpc and gax-httpjson packages - `LoggingUtils` handles logic to enable/disable from env var, and contains shared utility methods for record data for logging and record logs (abstracting away any need for SLF4J classes). - `Slf4jUtils` any logic interacting with SLF4J classes. - `LoggerProvider` provides the SLF4J Logger. This is so that Logger interceptor classes do not declare Logger directly. - This feature is guarded by env var GOOGLE_SDK_JAVA_LOGGING, only turned on if true. - By default it is off, user app should act as before (usual tests behaves as usual) __Tests added:__ - Unit tests in Gax that need either GOOGLE_SDK_JAVA_LOGGING unset, or do not depend on env var - LoggingEnabledTest: test for logger correctly setups when GOOGLE_SDK_JAVA_LOGGING = true. This is added to existing `envVarTest` profile - Showcase tests: - ITLoggingDisabled: test no logging event should record when env var is turned off. - ITLogging: test logging event with slf4j2.x+logback - ITLogging1x: test logging event with slf4j1.x+logback These tests may not compile depending on the logging dependency brought in. Set up profiles to control test compile and run: - Slf4j2_logback, slf4j1_logback, disabledLogging: brings in logging dependencies and setup compile config exclusions - Do not include `it/logging` folder for compile by default, or `enable-golden-tests`. `native` is also excluded for now. __Notable changes since last reviewed:__ - Changes related to get slf4j-api deps as optional - Logics to switch logging behavior based on slf4j major version - Moved helper methods into Gax - Revamped test setup - use Protobuf utils to serialize message __Context:__ [go/java-client-logging-design](http://goto.google.com/java-client-logging-design) TODO: - add rules for renovate bot to bypass some versions for testing --- .github/workflows/ci.yaml | 31 ++ gapic-generator-java-pom-parent/pom.xml | 1 + gax-java/dependencies.properties | 2 + gax-java/gax-grpc/pom.xml | 6 + .../api/gax/grpc/GrpcLoggingInterceptor.java | 136 +++++++ .../InstantiatingGrpcChannelProvider.java | 1 + .../gax/grpc/GrpcLoggingInterceptorTest.java | 104 +++++ gax-java/gax-httpjson/pom.xml | 6 + .../httpjson/HttpJsonLoggingInterceptor.java | 116 ++++++ .../InstantiatingHttpJsonChannelProvider.java | 1 + .../gax/httpjson/ManagedHttpJsonChannel.java | 4 + .../HttpJsonLoggingInterceptorTest.java | 48 +++ ...tantiatingHttpJsonChannelProviderTest.java | 19 +- gax-java/gax/BUILD.bazel | 4 +- gax-java/gax/pom.xml | 15 +- .../com/google/api/gax/logging/LogData.java | 153 ++++++++ .../api/gax/logging/LoggerProvider.java | 56 +++ .../google/api/gax/logging/LoggingUtils.java | 141 +++++++ .../api/gax/logging/Slf4jLoggingHelpers.java | 155 ++++++++ .../google/api/gax/logging/Slf4jUtils.java | 166 ++++++++ .../google/api/gax/logging/LogDataTest.java | 86 ++++ .../api/gax/logging/LoggerProviderTest.java | 62 +++ .../api/gax/logging/LoggingEnabledTest.java | 73 ++++ .../api/gax/logging/LoggingUtilsTest.java | 80 ++++ .../api/gax/logging/Slf4jUtilsTest.java | 367 ++++++++++++++++++ .../google/api/gax/logging/TestLogger.java | 301 ++++++++++++++ .../api/gax/logging/TestMDCAdapter.java | 86 ++++ .../api/gax/logging/TestServiceProvider.java | 73 ++++ .../org.slf4j.spi.SLF4JServiceProvider | 1 + gax-java/pom.xml | 8 +- showcase/gapic-showcase/pom.xml | 139 +++++++ .../v1beta1/it/logging/ITLogging.java | 257 ++++++++++++ .../v1beta1/it/logging/ITLogging1x.java | 217 +++++++++++ .../v1beta1/it/logging/ITLoggingDisabled.java | 78 ++++ .../v1beta1/it/logging/TestAppender.java | 41 ++ showcase/pom.xml | 65 ++++ 36 files changed, 3090 insertions(+), 9 deletions(-) create mode 100644 gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcLoggingInterceptor.java create mode 100644 gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLoggingInterceptorTest.java create mode 100644 gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptor.java create mode 100644 gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptorTest.java create mode 100644 gax-java/gax/src/main/java/com/google/api/gax/logging/LogData.java create mode 100644 gax-java/gax/src/main/java/com/google/api/gax/logging/LoggerProvider.java create mode 100644 gax-java/gax/src/main/java/com/google/api/gax/logging/LoggingUtils.java create mode 100644 gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jLoggingHelpers.java create mode 100644 gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jUtils.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/LogDataTest.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/LoggerProviderTest.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingEnabledTest.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingUtilsTest.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/Slf4jUtilsTest.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/TestLogger.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/TestMDCAdapter.java create mode 100644 gax-java/gax/src/test/java/com/google/api/gax/logging/TestServiceProvider.java create mode 100644 gax-java/gax/src/test/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java create mode 100644 showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 854f633d24..801ed4c977 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,6 +31,7 @@ jobs: env: GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true + GOOGLE_SDK_JAVA_LOGGING: true - run: bazelisk version - name: Install Maven modules run: | @@ -82,6 +83,7 @@ jobs: env: GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true + GOOGLE_SDK_JAVA_LOGGING: true - run: bazelisk version - name: Install Maven modules run: | @@ -133,6 +135,7 @@ jobs: env: GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true + GOOGLE_SDK_JAVA_LOGGING: true build-java8-gapic-generator-java: name: "build(8) for gapic-generator-java" @@ -255,6 +258,34 @@ jobs: -P enable-integration-tests \ --batch-mode \ --no-transfer-progress + # The `slf4j2_logback` profile brings logging dependency and compiles logging tests, require env var to be set + - name: Showcase integration tests - Logging SLF4J 2.x + working-directory: showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' \ + --batch-mode \ + --no-transfer-progress + # Set the Env Var for this step only + env: + GOOGLE_SDK_JAVA_LOGGING: true + # The `slf4j1_logback` profile brings logging dependency and compiles logging tests, require env var to be set + - name: Showcase integration tests - Logging SLF4J 1.x + working-directory: showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback' \ + --batch-mode \ + --no-transfer-progress + # Set the Env Var for this step only + env: + GOOGLE_SDK_JAVA_LOGGING: true + # The `disabledLogging` profile tests logging disabled when logging dependency present, + # do not set env var for this step + - name: Showcase integration tests - Logging disabed + working-directory: showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' \ + --batch-mode \ + --no-transfer-progress showcase-clirr: if: ${{ github.base_ref != '' }} # Only execute on pull_request trigger event diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index a426cb9ee9..bb87b52553 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -38,6 +38,7 @@ 3.0.0 1.7.0 5.11.4 + 2.0.16 diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 4d09063fbb..9dcb8c805d 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -76,6 +76,8 @@ maven.com_google_http_client_google_http_client_gson=com.google.http-client:goog 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:nativeimage:24.1.2 +maven.org_slf4j_slf4j_api=org.slf4j:slf4j-api:2.0.16 +maven.com_google_protobuf_protobuf_java_util=com.google.protobuf:protobuf-java-util:3.25.5 # Testing maven artifacts maven.junit_junit=junit:junit:4.13.2 diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index 01a62345ef..cb33a3dae3 100644 --- a/gax-java/gax-grpc/pom.xml +++ b/gax-java/gax-grpc/pom.xml @@ -92,6 +92,12 @@ auto-value-annotations provided + + + org.slf4j + slf4j-api + true + diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcLoggingInterceptor.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcLoggingInterceptor.java new file mode 100644 index 0000000000..9c305261cb --- /dev/null +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcLoggingInterceptor.java @@ -0,0 +1,136 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.grpc; + +import static com.google.api.gax.logging.LoggingUtils.executeWithTryCatch; +import static com.google.api.gax.logging.LoggingUtils.logRequest; +import static com.google.api.gax.logging.LoggingUtils.logResponse; +import static com.google.api.gax.logging.LoggingUtils.recordResponseHeaders; +import static com.google.api.gax.logging.LoggingUtils.recordResponsePayload; +import static com.google.api.gax.logging.LoggingUtils.recordServiceRpcAndRequestHeaders; + +import com.google.api.core.InternalApi; +import com.google.api.gax.logging.LogData; +import com.google.api.gax.logging.LoggerProvider; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.util.HashMap; +import java.util.Map; + +@InternalApi +public class GrpcLoggingInterceptor implements ClientInterceptor { + + private static final LoggerProvider LOGGER_PROVIDER = + LoggerProvider.forClazz(GrpcLoggingInterceptor.class); + + ClientCall.Listener currentListener; // expose for test setup + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + LogData.Builder logDataBuilder = LogData.builder(); + + @Override + public void start(Listener responseListener, Metadata headers) { + recordServiceRpcAndRequestHeaders( + method.getServiceName(), + method.getFullMethodName(), + null, // endpoint is for http request only + metadataHeadersToMap(headers), + logDataBuilder, + LOGGER_PROVIDER); + SimpleForwardingClientCallListener responseLoggingListener = + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onHeaders(Metadata headers) { + recordResponseHeaders( + metadataHeadersToMap(headers), logDataBuilder, LOGGER_PROVIDER); + super.onHeaders(headers); + } + + @Override + public void onMessage(RespT message) { + recordResponsePayload(message, logDataBuilder, LOGGER_PROVIDER); + super.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + logResponse(status.getCode().toString(), logDataBuilder, LOGGER_PROVIDER); + super.onClose(status, trailers); + } + }; + currentListener = responseLoggingListener; + super.start(responseLoggingListener, headers); + } + + @Override + public void sendMessage(ReqT message) { + logRequest(message, logDataBuilder, LOGGER_PROVIDER); + super.sendMessage(message); + } + }; + } + + // Helper methods for logging + private static Map metadataHeadersToMap(Metadata headers) { + + Map headersMap = new HashMap<>(); + executeWithTryCatch( + () -> { + for (String key : headers.keys()) { + // grpc header values can be either ASCII strings or binary + // https://grpc.io/docs/guides/metadata/#overview + // this condition identified binary headers and skip for logging + if (key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { + continue; + } + Metadata.Key metadataKey = + Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + String headerValue = headers.get(metadataKey); + + headersMap.put(key, headerValue); + } + }); + + return headersMap; + } +} 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 b75ba746f9..2b00ade341 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 @@ -681,6 +681,7 @@ private ManagedChannel createSingleChannel() throws IOException { builder = builder .intercept(new GrpcChannelUUIDInterceptor()) + .intercept(new GrpcLoggingInterceptor()) .intercept(headerInterceptor) .intercept(metadataHandlerInterceptor) .userAgent(headerInterceptor.getUserAgentHeader()) diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLoggingInterceptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLoggingInterceptorTest.java new file mode 100644 index 0000000000..fad4cd468b --- /dev/null +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLoggingInterceptorTest.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.grpc; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.api.gax.grpc.testing.FakeMethodDescriptor; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptors; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class GrpcLoggingInterceptorTest { + @Mock private Channel channel; + + @Mock private ClientCall call; + + private static final MethodDescriptor method = FakeMethodDescriptor.create(); + + @Test + void testInterceptor_basic() { + when(channel.newCall(Mockito.>any(), any(CallOptions.class))) + .thenReturn(call); + GrpcLoggingInterceptor interceptor = new GrpcLoggingInterceptor(); + Channel intercepted = ClientInterceptors.intercept(channel, interceptor); + @SuppressWarnings("unchecked") + ClientCall.Listener listener = mock(ClientCall.Listener.class); + ClientCall interceptedCall = intercepted.newCall(method, CallOptions.DEFAULT); + // Simulate starting the call + interceptedCall.start(listener, new Metadata()); + // Verify that the underlying call's start() method is invoked + verify(call).start(any(ClientCall.Listener.class), any(Metadata.class)); + + // Simulate sending a message + String requestMessage = "test request"; + interceptedCall.sendMessage(requestMessage); + // Verify that the underlying call's sendMessage() method is invoked + verify(call).sendMessage(requestMessage); + } + + @Test + void testInterceptor_responseListener() { + when(channel.newCall(Mockito.>any(), any(CallOptions.class))) + .thenReturn(call); + GrpcLoggingInterceptor interceptor = spy(new GrpcLoggingInterceptor()); + Channel intercepted = ClientInterceptors.intercept(channel, interceptor); + @SuppressWarnings("unchecked") + ClientCall.Listener listener = mock(ClientCall.Listener.class); + ClientCall interceptedCall = intercepted.newCall(method, CallOptions.DEFAULT); + interceptedCall.start(listener, new Metadata()); + + // Simulate respond interceptor calls + Metadata responseHeaders = new Metadata(); + responseHeaders.put( + Metadata.Key.of("test-header", Metadata.ASCII_STRING_MARSHALLER), "header-value"); + interceptor.currentListener.onHeaders(responseHeaders); + + interceptor.currentListener.onMessage(null); + + Status status = Status.OK; + interceptor.currentListener.onClose(status, new Metadata()); + } +} diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index 268f5e1bdc..30e1389b80 100644 --- a/gax-java/gax-httpjson/pom.xml +++ b/gax-java/gax-httpjson/pom.xml @@ -78,6 +78,12 @@ auto-value-annotations provided + + + org.slf4j + slf4j-api + true + diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptor.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptor.java new file mode 100644 index 0000000000..5a1b1b8c2b --- /dev/null +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptor.java @@ -0,0 +1,116 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.httpjson; + +import static com.google.api.gax.logging.LoggingUtils.logRequest; +import static com.google.api.gax.logging.LoggingUtils.logResponse; +import static com.google.api.gax.logging.LoggingUtils.recordResponseHeaders; +import static com.google.api.gax.logging.LoggingUtils.recordResponsePayload; +import static com.google.api.gax.logging.LoggingUtils.recordServiceRpcAndRequestHeaders; + +import com.google.api.core.InternalApi; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener; +import com.google.api.gax.logging.LogData; +import com.google.api.gax.logging.LoggerProvider; +import java.util.HashMap; +import java.util.Map; + +@InternalApi +public class HttpJsonLoggingInterceptor implements HttpJsonClientInterceptor { + + private static final LoggerProvider LOGGER_PROVIDER = + LoggerProvider.forClazz(HttpJsonLoggingInterceptor.class); + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + + String endpoint = ((ManagedHttpJsonChannel) next).getEndpoint(); + + return new SimpleForwardingHttpJsonClientCall(next.newCall(method, callOptions)) { + + LogData.Builder logDataBuilder = LogData.builder(); + + @Override + public void start( + HttpJsonClientCall.Listener responseListener, HttpJsonMetadata headers) { + recordServiceRpcAndRequestHeaders( + null, // service name is not available for http requests + method.getFullMethodName(), + endpoint, + httpJsonMetadataToMap(headers), + logDataBuilder, + LOGGER_PROVIDER); + + Listener forwardingResponseListener = + new SimpleForwardingHttpJsonClientCallListener(responseListener) { + + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + recordResponseHeaders( + httpJsonMetadataToMap(responseHeaders), logDataBuilder, LOGGER_PROVIDER); + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(RespT message) { + recordResponsePayload(message, logDataBuilder, LOGGER_PROVIDER); + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + logResponse(String.valueOf(statusCode), logDataBuilder, LOGGER_PROVIDER); + super.onClose(statusCode, trailers); + } + }; + super.start(forwardingResponseListener, headers); + } + + @Override + public void sendMessage(ReqT message) { + logRequest(message, logDataBuilder, LOGGER_PROVIDER); + super.sendMessage(message); + } + }; + } + + // Helper methods for logging, + + private static Map httpJsonMetadataToMap(HttpJsonMetadata headers) { + Map headersMap = new HashMap<>(); + headers.getHeaders().forEach((key, value) -> headersMap.put(key, value.toString())); + return headersMap; + } +} 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 f92bdf299c..1912bc5e29 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 @@ -196,6 +196,7 @@ private HttpJsonTransportChannel createChannel() throws IOException, GeneralSecu HttpJsonClientInterceptor headerInterceptor = new HttpJsonHeaderInterceptor(headerProvider.getHeaders()); + channel = new ManagedHttpJsonInterceptorChannel(channel, new HttpJsonLoggingInterceptor()); channel = new ManagedHttpJsonInterceptorChannel(channel, headerInterceptor); if (interceptorProvider != null && interceptorProvider.getInterceptors() != null) { for (HttpJsonClientInterceptor interceptor : interceptorProvider.getInterceptors()) { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java index 7a2e7a2f26..bd3bed8556 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java @@ -57,6 +57,10 @@ protected ManagedHttpJsonChannel() { this(null, true, null, null); } + String getEndpoint() { + return endpoint; + } + private ManagedHttpJsonChannel( Executor executor, boolean usingDefaultExecutor, diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptorTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptorTest.java new file mode 100644 index 0000000000..c7e134b5ce --- /dev/null +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptorTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.httpjson; + +import static org.mockito.Mockito.mock; + +import com.google.api.gax.httpjson.ApiMethodDescriptor.MethodType; + +class HttpJsonLoggingInterceptorTest { + + @SuppressWarnings("unchecked") + private static final ApiMethodDescriptor method = + ApiMethodDescriptor.newBuilder() + .setType(MethodType.UNARY) + .setRequestFormatter(mock(HttpRequestFormatter.class)) + .setRequestFormatter(mock(HttpRequestFormatter.class)) + .setFullMethodName("FakeClient/fake-method") + .setResponseParser(mock(HttpResponseParser.class)) + .build(); +} diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProviderTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProviderTest.java index 2e46157534..3e6b2d56d1 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProviderTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProviderTest.java @@ -118,8 +118,12 @@ void managedChannelUsesDefaultChannelExecutor() throws IOException { // By default, the channel will be wrapped with ManagedHttpJsonInterceptorChannel ManagedHttpJsonInterceptorChannel interceptorChannel = (ManagedHttpJsonInterceptorChannel) httpJsonTransportChannel.getManagedChannel(); - ManagedHttpJsonChannel managedHttpJsonChannel = interceptorChannel.getChannel(); - assertThat(managedHttpJsonChannel.getExecutor()).isNotNull(); + // call getChannel() twice because interceptors are chained in layers by recursive construction + // inside com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.createChannel + ManagedHttpJsonInterceptorChannel managedHttpJsonChannel = + (ManagedHttpJsonInterceptorChannel) interceptorChannel.getChannel(); + ManagedHttpJsonChannel channel = managedHttpJsonChannel.getChannel(); + assertThat(channel.getExecutor()).isNotNull(); // Clean up the resources (executor, deadlineScheduler, httpTransport) instantiatingHttpJsonChannelProvider.getTransportChannel().shutdownNow(); @@ -146,9 +150,14 @@ void managedChannelUsesCustomExecutor() throws IOException { // By default, the channel will be wrapped with ManagedHttpJsonInterceptorChannel ManagedHttpJsonInterceptorChannel interceptorChannel = (ManagedHttpJsonInterceptorChannel) httpJsonTransportChannel.getManagedChannel(); - ManagedHttpJsonChannel managedHttpJsonChannel = interceptorChannel.getChannel(); - assertThat(managedHttpJsonChannel.getExecutor()).isNotNull(); - assertThat(managedHttpJsonChannel.getExecutor()).isEqualTo(executor); + // call getChannel() twice because interceptors are chained in layers by recursive construction + // inside com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.createChannel + ManagedHttpJsonInterceptorChannel managedHttpJsonChannel = + (ManagedHttpJsonInterceptorChannel) interceptorChannel.getChannel(); + ManagedHttpJsonChannel channel = managedHttpJsonChannel.getChannel(); + + assertThat(channel.getExecutor()).isNotNull(); + assertThat(channel.getExecutor()).isEqualTo(executor); // Clean up the resources (executor, deadlineScheduler, httpTransport) instantiatingHttpJsonChannelProvider.getTransportChannel().shutdownNow(); diff --git a/gax-java/gax/BUILD.bazel b/gax-java/gax/BUILD.bazel index 5dd3ff96bd..80b26ad785 100644 --- a/gax-java/gax/BUILD.bazel +++ b/gax-java/gax/BUILD.bazel @@ -28,7 +28,9 @@ _COMPILE_DEPS = [ "@com_google_code_gson_gson//jar", "@com_google_guava_failureaccess//jar", "@javax_annotation_javax_annotation_api//jar", - "@org_graalvm_sdk//jar" + "@org_graalvm_sdk//jar", + "@org_slf4j_slf4j_api//jar", + "@com_google_protobuf_protobuf_java_util//jar" ] _TEST_COMPILE_DEPS = [ diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index 4c2fa5f694..7323e6315e 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -38,6 +38,10 @@ com.google.protobuf protobuf-java + + com.google.protobuf + protobuf-java-util + org.threeten threetenbp @@ -69,6 +73,12 @@ opentelemetry-api true + + + org.slf4j + slf4j-api + true + @@ -112,7 +122,7 @@ @{argLine} -Djava.util.logging.SimpleFormatter.format="%1$tY %1$tl:%1$tM:%1$tS.%1$tL %2$s %4$s: %5$s%6$s%n" - !EndpointContextTest#endpointContextBuild_universeDomainEnvVarSet+endpointContextBuild_multipleUniverseDomainConfigurations_clientSettingsHasPriority + !EndpointContextTest#endpointContextBuild_universeDomainEnvVarSet+endpointContextBuild_multipleUniverseDomainConfigurations_clientSettingsHasPriority,!LoggingEnabledTest @@ -127,11 +137,12 @@ org.apache.maven.plugins maven-surefire-plugin - EndpointContextTest#endpointContextBuild_universeDomainEnvVarSet+endpointContextBuild_multipleUniverseDomainConfigurations_clientSettingsHasPriority + EndpointContextTest#endpointContextBuild_universeDomainEnvVarSet+endpointContextBuild_multipleUniverseDomainConfigurations_clientSettingsHasPriority,LoggingEnabledTest + \ No newline at end of file diff --git a/gax-java/gax/src/main/java/com/google/api/gax/logging/LogData.java b/gax-java/gax/src/main/java/com/google/api/gax/logging/LogData.java new file mode 100644 index 0000000000..368800dba0 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/logging/LogData.java @@ -0,0 +1,153 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.gson.Gson; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +@InternalApi +@AutoValue +public abstract class LogData { + private static final Gson gson = new Gson(); + + @Nullable + public abstract String serviceName(); + + @Nullable + public abstract String rpcName(); + + @Nullable + public abstract String requestId(); + + @Nullable + public abstract Map requestHeaders(); + + @Nullable + public abstract Map requestPayload(); + + @Nullable + public abstract String responseStatus(); + + @Nullable + public abstract Map responseHeaders(); + + @Nullable + public abstract Map responsePayload(); + + @Nullable + public abstract String httpMethod(); + + @Nullable + public abstract String httpUrl(); + + public static Builder builder() { + return new AutoValue_LogData.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder serviceName(String serviceName); + + public abstract Builder rpcName(String rpcName); + + public abstract Builder requestId(String requestId); + + public abstract Builder requestHeaders(Map requestHeaders); + + public abstract Builder requestPayload(Map requestPayload); + + public abstract Builder responseStatus(String responseStatus); + + public abstract Builder responseHeaders(Map responseHeaders); + + public abstract Builder responsePayload(Map responsePayload); + + public abstract Builder httpMethod(String httpMethod); + + public abstract Builder httpUrl(String httpUrl); + + public abstract LogData build(); + } + + // helper functions to convert to map for logging + public Map toMapRequest() { + Map map = new HashMap<>(); + if (serviceName() != null) { + map.put("serviceName", serviceName()); + } + if (rpcName() != null) { + map.put("rpcName", rpcName()); + } + if (requestId() != null) { + map.put("requestId", requestId()); + } + if (requestHeaders() != null) { + map.put("request.headers", requestHeaders()); + } + if (requestPayload() != null) { + map.put("request.payload", requestPayload()); + } + if (httpMethod() != null) { + map.put("request.method", httpMethod()); + } + if (httpUrl() != null) { + map.put("request.url", httpUrl()); + } + return map; + } + + public Map toMapResponse() { + Map map = new HashMap<>(); + if (serviceName() != null) { + map.put("serviceName", serviceName()); + } + if (rpcName() != null) { + map.put("rpcName", rpcName()); + } + if (requestId() != null) { + map.put("requestId", requestId()); + } + if (responseStatus() != null) { + map.put("response.status", responseStatus()); + } + if (responseHeaders() != null) { + map.put("response.headers", responseHeaders()); + } + if (responsePayload() != null) { + map.put("response.payload", responsePayload()); + } + return map; + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/logging/LoggerProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/logging/LoggerProvider.java new file mode 100644 index 0000000000..24745ee01e --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/logging/LoggerProvider.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import com.google.api.core.InternalApi; +import org.slf4j.Logger; + +@InternalApi +public class LoggerProvider { + + private Logger logger; + private final Class clazz; + + private LoggerProvider(Class clazz) { + this.clazz = clazz; + } + + public static LoggerProvider forClazz(Class clazz) { + return new LoggerProvider(clazz); + } + + public Logger getLogger() { + if (logger == null) { + this.logger = Slf4jUtils.getLogger(clazz); + } + return logger; + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/logging/LoggingUtils.java b/gax-java/gax/src/main/java/com/google/api/gax/logging/LoggingUtils.java new file mode 100644 index 0000000000..43b9254041 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/logging/LoggingUtils.java @@ -0,0 +1,141 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import com.google.api.core.InternalApi; +import java.util.Map; + +@InternalApi +public class LoggingUtils { + + private static boolean loggingEnabled = isLoggingEnabled(); + static final String GOOGLE_SDK_JAVA_LOGGING = "GOOGLE_SDK_JAVA_LOGGING"; + + static boolean isLoggingEnabled() { + String enableLogging = System.getenv(GOOGLE_SDK_JAVA_LOGGING); + return "true".equalsIgnoreCase(enableLogging); + } + + /** + * Sets logDataBuilder with service name, rpc name, endpoint and request headers based on logging + * level + * + * @param serviceName + * @param rpcName + * @param endpoint + * @param requestHeaders + * @param logDataBuilder + * @param loggerProvider + */ + public static void recordServiceRpcAndRequestHeaders( + String serviceName, + String rpcName, + String endpoint, + Map requestHeaders, + LogData.Builder logDataBuilder, + LoggerProvider loggerProvider) { + if (loggingEnabled) { + Slf4jLoggingHelpers.recordServiceRpcAndRequestHeaders( + serviceName, rpcName, endpoint, requestHeaders, logDataBuilder, loggerProvider); + } + } + + /** + * Sets logDataBuilder with response headers based on logging level + * + * @param headers + * @param logDataBuilder + * @param loggerProvider + */ + public static void recordResponseHeaders( + Map headers, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + if (loggingEnabled) { + Slf4jLoggingHelpers.recordResponseHeaders(headers, logDataBuilder, loggerProvider); + } + } + + /** + * Sets logDataBuilder with respond payload based on logging level + * + * @param message + * @param logDataBuilder + * @param loggerProvider + * @param + */ + public static void recordResponsePayload( + RespT message, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + if (loggingEnabled) { + Slf4jLoggingHelpers.recordResponsePayload(message, logDataBuilder, loggerProvider); + } + } + + /** + * Log response based on logging level configured + * + * @param status + * @param logDataBuilder + * @param loggerProvider + */ + public static void logResponse( + String status, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + if (loggingEnabled) { + Slf4jLoggingHelpers.logResponse(status, logDataBuilder, loggerProvider); + } + } + + /** + * Log request based on logging level configured + * + * @param message + * @param logDataBuilder + * @param loggerProvider + * @param + */ + public static void logRequest( + RespT message, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + if (loggingEnabled) { + Slf4jLoggingHelpers.logRequest(message, logDataBuilder, loggerProvider); + } + } + + public static void executeWithTryCatch(ThrowingRunnable action) { + try { + action.run(); + } catch (Throwable t) { + // let logging exceptions fail silently + } + } + + @FunctionalInterface + public interface ThrowingRunnable { + void run() throws Throwable; + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jLoggingHelpers.java b/gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jLoggingHelpers.java new file mode 100644 index 0000000000..2a914f4bf6 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jLoggingHelpers.java @@ -0,0 +1,155 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import com.google.api.core.InternalApi; +import com.google.common.base.Strings; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Message; +import com.google.protobuf.util.JsonFormat; +import java.util.Map; +import java.util.function.Consumer; +import org.slf4j.Logger; +import org.slf4j.event.Level; + +/** Contains helper methods to log requests and responses */ +@InternalApi +class Slf4jLoggingHelpers { + + static final Gson gson = new Gson(); + + static Map messageToMapWithGson(Message message) + throws InvalidProtocolBufferException { + String json = JsonFormat.printer().print(message); + return gson.fromJson(json, new TypeToken>() {}.getType()); + } + + static void recordServiceRpcAndRequestHeaders( + String serviceName, + String rpcName, + String endpoint, + Map requestHeaders, + LogData.Builder logDataBuilder, + LoggerProvider loggerProvider) { + LoggingUtils.executeWithTryCatch( + () -> { + Logger logger = loggerProvider.getLogger(); + if (logger.isInfoEnabled()) { + addIfNotEmpty(logDataBuilder::serviceName, serviceName); + addIfNotEmpty(logDataBuilder::rpcName, rpcName); + addIfNotEmpty(logDataBuilder::httpUrl, endpoint); + } + if (logger.isDebugEnabled()) { + logDataBuilder.requestHeaders(requestHeaders); + } + }); + } + + private static void addIfNotEmpty(Consumer setter, String value) { + if (!Strings.isNullOrEmpty(value)) { + setter.accept(value); + } + } + + static void recordResponseHeaders( + Map headers, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + LoggingUtils.executeWithTryCatch( + () -> { + Logger logger = loggerProvider.getLogger(); + if (logger.isDebugEnabled()) { + logDataBuilder.responseHeaders(headers); + } + }); + } + + static void recordResponsePayload( + RespT message, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + LoggingUtils.executeWithTryCatch( + () -> { + Logger logger = loggerProvider.getLogger(); + if (logger.isDebugEnabled()) { + if (!(message instanceof Message)) { + // expect RespT to be Message type, otherwise do nothing and return + return; + } + Map messageToMapWithGson = messageToMapWithGson((Message) message); + + logDataBuilder.responsePayload(messageToMapWithGson); + } + }); + } + + static void logResponse( + String status, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + LoggingUtils.executeWithTryCatch( + () -> { + Logger logger = loggerProvider.getLogger(); + if (logger.isInfoEnabled()) { + logDataBuilder.responseStatus(status); + } + if (logger.isInfoEnabled() && !logger.isDebugEnabled()) { + Map responseData = logDataBuilder.build().toMapResponse(); + Slf4jUtils.log(logger, Level.INFO, responseData, "Received response"); + } + if (logger.isDebugEnabled()) { + Map responsedDetailsMap = logDataBuilder.build().toMapResponse(); + Slf4jUtils.log(logger, Level.DEBUG, responsedDetailsMap, "Received response"); + } + }); + } + + static void logRequest( + RespT message, LogData.Builder logDataBuilder, LoggerProvider loggerProvider) { + LoggingUtils.executeWithTryCatch( + () -> { + Logger logger = loggerProvider.getLogger(); + if (logger.isInfoEnabled() && !logger.isDebugEnabled()) { + Slf4jUtils.log( + logger, Level.INFO, logDataBuilder.build().toMapRequest(), "Sending request"); + } + if (logger.isDebugEnabled()) { + if (!(message instanceof Message)) { + // expect RespT to be Message type, otherwise do nothing and return + return; + } + Map messageToMapWithGson = messageToMapWithGson((Message) message); + + logDataBuilder.requestPayload(messageToMapWithGson); + Map requestDetailsMap = logDataBuilder.build().toMapRequest(); + Slf4jUtils.log(logger, Level.DEBUG, requestDetailsMap, "Sending request"); + } + }); + } + + private Slf4jLoggingHelpers() {} +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jUtils.java b/gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jUtils.java new file mode 100644 index 0000000000..e9bce1101d --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/logging/Slf4jUtils.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import com.google.api.core.InternalApi; +import java.util.Map; +import java.util.Map.Entry; +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import org.slf4j.spi.LoggingEventBuilder; + +/** + * Contains util methods to get SLF4J logger and log conditionally based SLF4J major version Actual + * interaction with SLF4J happens only in this class. + */ +@InternalApi +class Slf4jUtils { + + private static final Logger NO_OP_LOGGER = org.slf4j.helpers.NOPLogger.NOP_LOGGER; + private static final boolean loggingEnabled = LoggingUtils.isLoggingEnabled(); + + private static final boolean isSLF4J2x; + + static { + isSLF4J2x = checkIfClazzAvailable("org.slf4j.event.KeyValuePair"); + } + + static boolean checkIfClazzAvailable(String clazzName) { + try { + Class.forName(clazzName); + return true; + } catch (ClassNotFoundException e) { + return false; + } + } + + static Logger getLogger(Class clazz) { + return getLogger(clazz, new DefaultLoggerFactoryProvider()); + } + + // constructor with LoggerFactoryProvider to make testing easier + static Logger getLogger(Class clazz, LoggerFactoryProvider factoryProvider) { + if (loggingEnabled) { + ILoggerFactory loggerFactory = factoryProvider.getLoggerFactory(); + return loggerFactory.getLogger(clazz.getName()); + } else { + // use SLF4j's NOP logger regardless of bindings + return NO_OP_LOGGER; + } + } + + static void log( + Logger logger, org.slf4j.event.Level level, Map contextMap, String message) { + if (isSLF4J2x) { + logWithKeyValuePair(logger, level, contextMap, message); + } else { + logWithMDC(logger, level, contextMap, message); + } + } + + // exposed for testing + static void logWithMDC( + Logger logger, org.slf4j.event.Level level, Map contextMap, String message) { + if (!contextMap.isEmpty()) { + for (Entry entry : contextMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + MDC.put( + key, value instanceof String ? (String) value : Slf4jLoggingHelpers.gson.toJson(value)); + } + } + switch (level) { + case TRACE: + logger.trace(message); + break; + case DEBUG: + logger.debug(message); + break; + case INFO: + logger.info(message); + break; + case WARN: + logger.warn(message); + break; + case ERROR: + logger.error(message); + break; + default: + logger.debug(message); + // Default to DEBUG level + } + if (!contextMap.isEmpty()) { + MDC.clear(); + } + } + + private static void logWithKeyValuePair( + Logger logger, org.slf4j.event.Level level, Map contextMap, String message) { + LoggingEventBuilder loggingEventBuilder; + switch (level) { + case TRACE: + loggingEventBuilder = logger.atTrace(); + break; + case DEBUG: + loggingEventBuilder = logger.atDebug(); + break; + case INFO: + loggingEventBuilder = logger.atInfo(); + break; + case WARN: + loggingEventBuilder = logger.atWarn(); + break; + case ERROR: + loggingEventBuilder = logger.atError(); + break; + default: + loggingEventBuilder = logger.atDebug(); + // Default to DEBUG level + } + contextMap.forEach(loggingEventBuilder::addKeyValue); + loggingEventBuilder.log(message); + } + + private Slf4jUtils() {} + + interface LoggerFactoryProvider { + ILoggerFactory getLoggerFactory(); + } + + static class DefaultLoggerFactoryProvider implements LoggerFactoryProvider { + @Override + public ILoggerFactory getLoggerFactory() { + return LoggerFactory.getILoggerFactory(); + } + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LogDataTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LogDataTest.java new file mode 100644 index 0000000000..ff19dcd958 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LogDataTest.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class LogDataTest { + + @Test + void toMapResponse_correctlyConvertsData() { + Map responsePayload = ImmutableMap.of("key", "value", "key2", 123); + LogData logData = + LogData.builder() + .serviceName("MyService") + .rpcName("myMethod") + .requestHeaders(ImmutableMap.of("fake header", "item")) + .requestId("abcd") + .responsePayload(responsePayload) + .build(); + + Map expectedMap = + ImmutableMap.of( + "serviceName", "MyService", + "rpcName", "myMethod", + "response.payload", responsePayload, + "requestId", "abcd"); + + assertThat(logData.toMapResponse()).isEqualTo(expectedMap); + } + + @Test + void toMapRequest_correctlyConvertsData() { + Map header = ImmutableMap.of("fake header", "item"); + LogData logData = + LogData.builder() + .serviceName("MyService") + .rpcName("myMethod") + .requestHeaders(header) + .requestId("abcd") + .httpUrl("url") + .responsePayload(ImmutableMap.of("key", "value", "key2", 123)) + .build(); + + Map expectedMap = + ImmutableMap.of( + "serviceName", "MyService", + "rpcName", "myMethod", + "request.headers", header, + "requestId", "abcd", + "request.url", "url"); + + assertThat(logData.toMapRequest()).isEqualTo(expectedMap); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggerProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggerProviderTest.java new file mode 100644 index 0000000000..b16e94e538 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggerProviderTest.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; + +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; + +class LoggerProviderTest { + + @Test + void testGetLogger_CreatesLoggerOnce() { + Class testClass = this.getClass(); + LoggerProvider provider = LoggerProvider.forClazz(testClass); + Logger logger1 = provider.getLogger(); + Logger logger2 = provider.getLogger(); + + assertNotNull(logger1); + assertSame(logger1, logger2); + } + + @Test + void testForClazz_ReturnsNewInstance() { + Class testClass1 = this.getClass(); + Class testClass2 = String.class; + LoggerProvider provider1 = LoggerProvider.forClazz(testClass1); + LoggerProvider provider2 = LoggerProvider.forClazz(testClass2); + + assertNotSame(provider1, provider2); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingEnabledTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingEnabledTest.java new file mode 100644 index 0000000000..2d755a6ecc --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingEnabledTest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.api.gax.logging.Slf4jUtils.LoggerFactoryProvider; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.helpers.NOPLogger; +import org.slf4j.helpers.NOPLoggerFactory; + +// These tests should only run when env GOOGLE_SDK_JAVA_LOGGING = true +// it is excluded by default and only included for `envVarTest` profile +class LoggingEnabledTest { + + @Test + void testIsLoggingEnabled_true() { + Assertions.assertTrue(LoggingUtils.isLoggingEnabled()); + } + + @Test + void testGetLogger_loggingEnabled_slf4jBindingPresent() { + // should get ILoggerFactory from TestServiceProvider + Logger logger = Slf4jUtils.getLogger(Slf4jUtilsTest.class); + Assertions.assertInstanceOf(Logger.class, logger); + Assertions.assertNotEquals(NOPLogger.class, logger.getClass()); + } + + @Test + void testGetLogger_loggingEnabled_noBinding_shouldGetNOPLogger() { + // Create a mock LoggerFactoryProvider, mimic SLF4J's behavior to return NOPLoggerFactory when + // no binding + LoggerFactoryProvider mockLoggerFactoryProvider = mock(LoggerFactoryProvider.class); + ILoggerFactory nopLoggerFactory = new NOPLoggerFactory(); + when(mockLoggerFactoryProvider.getLoggerFactory()).thenReturn(nopLoggerFactory); + + Logger logger = Slf4jUtils.getLogger(Slf4jUtilsTest.class, mockLoggerFactoryProvider); + + Assertions.assertInstanceOf(NOPLogger.class, logger); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingUtilsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingUtilsTest.java new file mode 100644 index 0000000000..9e3099e929 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingUtilsTest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.mockito.Mockito.verify; + +import com.google.api.gax.logging.LoggingUtils.ThrowingRunnable; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class LoggingUtilsTest { + + @Test + void testIsLoggingEnabled_defaultToFalse() { + assertFalse(LoggingUtils.isLoggingEnabled()); + } + + @Test + void testExecuteWithTryCatch_noException() { + assertDoesNotThrow( + () -> + LoggingUtils.executeWithTryCatch( + () -> { + // Some code that should not throw an exception + int x = 5; + int y = 10; + int z = x + y; + assertEquals(15, z); + })); + } + + @Test + void testExecuteWithTryCatch_WithException() throws Throwable { + ThrowingRunnable action = Mockito.mock(ThrowingRunnable.class); + Mockito.doThrow(new RuntimeException("Test Exception")).when(action).run(); + assertDoesNotThrow(() -> LoggingUtils.executeWithTryCatch(action)); + // Verify that the action was executed (despite the exception) + verify(action).run(); + } + + @Test + void testExecuteWithTryCatch_WithNoSuchMethodError() throws Throwable { + ThrowingRunnable action = Mockito.mock(ThrowingRunnable.class); + Mockito.doThrow(new NoSuchMethodError("Test Error")).when(action).run(); + assertDoesNotThrow(() -> LoggingUtils.executeWithTryCatch(action)); + // Verify that the action was executed (despite the error) + verify(action).run(); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/Slf4jUtilsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/Slf4jUtilsTest.java new file mode 100644 index 0000000000..b40ca1bc2c --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/Slf4jUtilsTest.java @@ -0,0 +1,367 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static com.google.api.gax.logging.Slf4jLoggingHelpers.messageToMapWithGson; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.anyMap; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.protobuf.Field; +import com.google.protobuf.Field.Cardinality; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Option; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.slf4j.Logger; +import org.slf4j.event.Level; +import org.slf4j.helpers.NOPLogger; + +class Slf4jUtilsTest { + + // This test should only run GOOGLE_SDK_JAVA_LOGGING != true + @Test + void testGetLogger_loggingDisabled_shouldGetNOPLogger() { + Logger logger = Slf4jUtils.getLogger(Slf4jUtilsTest.class); + assertEquals(NOPLogger.class, logger.getClass()); + assertFalse(logger.isInfoEnabled()); + assertFalse(logger.isDebugEnabled()); + } + + // These tests does not require GOOGLE_SDK_JAVA_LOGGING + @Test + void testLog_slf4J2xLogger() { + Map contextMap = new HashMap<>(); + contextMap.put("key1", "value"); + contextMap.put("key2", 123); + String message = "Test message"; + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.log(testLogger, org.slf4j.event.Level.DEBUG, contextMap, message); + + assertEquals(message, testLogger.messageList.get(0)); + + assertEquals("value", testLogger.keyValuePairsMap.get("key1")); + assertEquals(123, testLogger.keyValuePairsMap.get("key2")); + } + + @Test + void testLogWithMDC_InfoLevel_VerifyMDC() { + // this test relies on TestMDCApapter and TestServiceProvider + TestLogger testLogger = new TestLogger("test-logger"); + Map contextMap = new HashMap<>(); + contextMap.put("key1", "value1"); + contextMap.put("key2", 123); + String message = "Test message"; + + // need a service provider + Slf4jUtils.logWithMDC(testLogger, Level.INFO, contextMap, message); + + Map mdcMap = testLogger.MDCMap; + + assertEquals(2, mdcMap.size()); + assertEquals("value1", mdcMap.get("key1")); + assertEquals("123", mdcMap.get("key2")); + + assertEquals(message, testLogger.messageList.get(0)); + } + + @Test + void testLogWithMDC_DEBUG() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.DEBUG, new HashMap<>(), "test message"); + + assertEquals(Level.DEBUG, testLogger.level); + } + + @Test + void testLogWithMDC_TRACE() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.TRACE, new HashMap<>(), "test message"); + + assertEquals(Level.TRACE, testLogger.level); + } + + @Test + void testLogWithMDC_WARN() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.WARN, new HashMap<>(), "test message"); + + assertEquals(Level.WARN, testLogger.level); + } + + @Test + void testLogWithMDC_ERROR() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.ERROR, new HashMap<>(), "test message"); + + assertEquals(Level.ERROR, testLogger.level); + } + + @Test + void testMessageToMap_ValidMessage() throws InvalidProtocolBufferException { + Field field = + Field.newBuilder() + .setNumber(2) + .setName("field_name1") + .addOptions(Option.newBuilder().setName("opt_name1").build()) + .addOptions(Option.newBuilder().setName("opt_name2").build()) + .setCardinality(Cardinality.CARDINALITY_OPTIONAL) + .build(); + + Map map = messageToMapWithGson(field); + + assertEquals("field_name1", map.get("name")); + assertEquals(2.0, map.get("number")); // Gson converts ints to doubles by default + } + + @Test + void testRecordServiceRpcAndRequestHeaders_infoEnabled() { + String serviceName = "testService"; + String rpcName = "testRpc"; + String endpoint = "http://test.com/endpoint"; + Map requestHeaders = new HashMap<>(); + requestHeaders.put("header1", "value1"); + requestHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.recordServiceRpcAndRequestHeaders( + serviceName, + rpcName, + endpoint, + requestHeaders, + logDataBuilder, + setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(serviceName, logData.serviceName()); + assertEquals(rpcName, logData.rpcName()); + assertEquals(endpoint, logData.httpUrl()); + assertEquals(requestHeaders, logData.requestHeaders()); + } + + LoggerProvider setUpLoggerProviderMock(TestLogger testLogger) { + LoggerProvider loggerProvider = mock(LoggerProvider.class); + when(loggerProvider.getLogger()).thenReturn(testLogger); + return loggerProvider; + } + + @Test + void testRecordServiceRpcAndRequestHeaders_infoDisabled() { + String serviceName = "testService"; + String rpcName = "testRpc"; + String endpoint = "http://test.com/endpoint"; + Map requestHeaders = new HashMap<>(); + requestHeaders.put("header1", "value1"); + requestHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + + TestLogger testLogger = new TestLogger("test-logger", false, false); + + LoggerProvider loggerProvider = setUpLoggerProviderMock(testLogger); + Slf4jLoggingHelpers.recordServiceRpcAndRequestHeaders( + serviceName, rpcName, endpoint, requestHeaders, logDataBuilder, loggerProvider); + + LogData logData = logDataBuilder.build(); + assertEquals(null, logData.serviceName()); + assertEquals(null, logData.rpcName()); + assertEquals(null, logData.httpUrl()); + assertEquals(null, logData.requestHeaders()); + } + + @Test + void testRecordResponseHeaders_debugEnabled() { + Map responseHeaders = new HashMap<>(); + responseHeaders.put("header1", "value1"); + responseHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.recordResponseHeaders( + responseHeaders, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(responseHeaders, logData.responseHeaders()); + } + + @Test + void testRecordResponseHeaders_debugDisabled() { + Map responseHeaders = new HashMap<>(); + responseHeaders.put("header1", "value1"); + responseHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + TestLogger testLogger = new TestLogger("test-logger", true, false); + + Slf4jLoggingHelpers.recordResponseHeaders( + responseHeaders, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(null, logData.responseHeaders()); + } + + @Test + void testRecordResponsePayload_debugEnabled() { + + Field field = + Field.newBuilder() + .setName("field_name1") + .addOptions(Option.newBuilder().setName("opt_name1").build()) + .addOptions(Option.newBuilder().setName("opt_name2").build()) + .build(); + + LogData.Builder logDataBuilder = LogData.builder(); + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.recordResponsePayload( + field, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(2, logData.responsePayload().size()); + assertEquals("field_name1", logData.responsePayload().get("name")); + assertEquals( + "[{name=opt_name1}, {name=opt_name2}]", + logData.responsePayload().get("options").toString()); + } + + @Test + void testLogRequest_infoEnabled_debugDisabled() { + Object message = new Object(); // not used in info path + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + + LogData.Builder testLogDataBuilder = + LogData.builder().serviceName("service-name").rpcName("rpc-name"); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + + TestLogger testLogger = new TestLogger("test", true, false); + Slf4jLoggingHelpers.logRequest(message, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + assertEquals(2, testLogger.keyValuePairsMap.size()); + assertEquals("Sending request", testLogger.messageList.get(0)); + verify(logDataBuilder, never()).requestPayload(anyMap()); // Ensure debug path is not taken + + assertEquals(Level.INFO, testLogger.level); + } + + @Test + void testLogRequest_debugEnabled() throws InvalidProtocolBufferException { + Field field = + Field.newBuilder() + .setName("field_name1") + .addOptions(Option.newBuilder().setName("opt_name1").build()) + .addOptions(Option.newBuilder().setName("opt_name2").build()) + .build(); + + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + LogData.Builder testLogDataBuilder = + LogData.builder() + .serviceName("service-name") + .rpcName("rpc-name") + .requestPayload(Slf4jLoggingHelpers.messageToMapWithGson(field)); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.logRequest(field, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + verify(logDataBuilder).requestPayload(Slf4jLoggingHelpers.messageToMapWithGson(field)); + + assertEquals(3, testLogger.keyValuePairsMap.size()); + assertEquals(2, ((Map) testLogger.keyValuePairsMap.get("request.payload")).size()); + assertEquals("Sending request", testLogger.messageList.get(0)); + + assertEquals(Level.DEBUG, testLogger.level); + } + + @Test + void testLogResponse_infoEnabled_debugDisabled() { + String status = "OK"; + Map responseData = new HashMap<>(); + + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + LogData.Builder testLogDataBuilder = + LogData.builder() + .serviceName("service-name") + .rpcName("rpc-name") + .responsePayload(responseData); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + TestLogger testLogger = new TestLogger("test-logger", true, false); + + Slf4jLoggingHelpers.logResponse(status, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + verify(logDataBuilder).responseStatus(status); + assertEquals("Received response", (testLogger).messageList.get(0)); + assertEquals(3, (testLogger).keyValuePairsMap.size()); + assertTrue((testLogger).keyValuePairsMap.containsKey("response.payload")); + assertEquals(Level.INFO, (testLogger).level); + } + + @Test + void testLogResponse_infoEnabled_debugEnabled() { + String status = "OK"; + Map responseData = new HashMap<>(); + + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + LogData.Builder testLogDataBuilder = + LogData.builder() + .serviceName("service-name") + .rpcName("rpc-name") + .responsePayload(responseData); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.logResponse(status, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + verify(logDataBuilder).responseStatus(status); + assertEquals("Received response", (testLogger).messageList.get(0)); + assertEquals(3, (testLogger).keyValuePairsMap.size()); + assertTrue((testLogger).keyValuePairsMap.containsKey("response.payload")); + + assertEquals(Level.DEBUG, (testLogger).level); + } + + @Test + void testCheckIfClazzAvailable() { + assertFalse(Slf4jUtils.checkIfClazzAvailable("fake.class.should.not.be.in.classpath")); + assertTrue(Slf4jUtils.checkIfClazzAvailable("org.slf4j.event.KeyValuePair")); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/TestLogger.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestLogger.java new file mode 100644 index 0000000000..3ee7e513cd --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestLogger.java @@ -0,0 +1,301 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.MDC; +import org.slf4j.Marker; +import org.slf4j.event.KeyValuePair; +import org.slf4j.event.Level; +import org.slf4j.event.LoggingEvent; +import org.slf4j.spi.LoggingEventAware; + +/** Logger implementation for testing purposes only. Only implemented methods used in tests. */ +public class TestLogger implements Logger, LoggingEventAware { + Map MDCMap = new HashMap<>(); + List messageList = new ArrayList<>(); + Level level; + + Map keyValuePairsMap = new HashMap<>(); + + private String loggerName; + private boolean infoEnabled; + private boolean debugEnabled; + + public TestLogger(String name) { + loggerName = name; + infoEnabled = true; + debugEnabled = true; + } + + public TestLogger(String name, boolean info, boolean debug) { + loggerName = name; + infoEnabled = info; + debugEnabled = debug; + } + + @Override + public String getName() { + return loggerName; + } + + @Override + public boolean isTraceEnabled() { + return false; + } + + @Override + public void trace(String msg) { + level = Level.TRACE; + } + + @Override + public void trace(String format, Object arg) {} + + @Override + public void trace(String format, Object arg1, Object arg2) {} + + @Override + public void trace(String format, Object... arguments) {} + + @Override + public void trace(String msg, Throwable t) {} + + @Override + public boolean isTraceEnabled(Marker marker) { + return false; + } + + @Override + public void trace(Marker marker, String msg) {} + + @Override + public void trace(Marker marker, String format, Object arg) {} + + @Override + public void trace(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void trace(Marker marker, String format, Object... argArray) {} + + @Override + public void trace(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isDebugEnabled() { + return debugEnabled; + } + + @Override + public void debug(String msg) { + Map currentMDC = MDC.getCopyOfContextMap(); + MDCMap.putAll(currentMDC); + messageList.add(msg); + level = Level.DEBUG; + } + + @Override + public void debug(String format, Object arg) {} + + @Override + public void debug(String format, Object arg1, Object arg2) {} + + @Override + public void debug(String format, Object... arguments) {} + + @Override + public void debug(String msg, Throwable t) {} + + @Override + public boolean isDebugEnabled(Marker marker) { + return false; + } + + @Override + public void debug(Marker marker, String msg) {} + + @Override + public void debug(Marker marker, String format, Object arg) {} + + @Override + public void debug(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void debug(Marker marker, String format, Object... arguments) {} + + @Override + public void debug(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isInfoEnabled() { + return infoEnabled; + } + + @Override + public void info(String msg) { + // access MDC content here before it is cleared. + // TestMDCAdapter is set up via TestServiceProvider + // to allow MDC values recorded and copied for testing here + Map currentMDC = MDC.getCopyOfContextMap(); + MDCMap.putAll(currentMDC); + messageList.add(msg); + } + + @Override + public void info(String format, Object arg) {} + + @Override + public void info(String format, Object arg1, Object arg2) {} + + @Override + public void info(String format, Object... arguments) {} + + @Override + public void info(String msg, Throwable t) {} + + @Override + public boolean isInfoEnabled(Marker marker) { + return false; + } + + @Override + public void info(Marker marker, String msg) {} + + @Override + public void info(Marker marker, String format, Object arg) {} + + @Override + public void info(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void info(Marker marker, String format, Object... arguments) {} + + @Override + public void info(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isWarnEnabled() { + return false; + } + + @Override + public void warn(String msg) { + level = Level.WARN; + } + + @Override + public void warn(String format, Object arg) {} + + @Override + public void warn(String format, Object... arguments) {} + + @Override + public void warn(String format, Object arg1, Object arg2) {} + + @Override + public void warn(String msg, Throwable t) {} + + @Override + public boolean isWarnEnabled(Marker marker) { + return false; + } + + @Override + public void warn(Marker marker, String msg) {} + + @Override + public void warn(Marker marker, String format, Object arg) {} + + @Override + public void warn(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void warn(Marker marker, String format, Object... arguments) {} + + @Override + public void warn(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public void error(String msg) { + level = Level.ERROR; + } + + @Override + public void error(String format, Object arg) {} + + @Override + public void error(String format, Object arg1, Object arg2) {} + + @Override + public void error(String format, Object... arguments) {} + + @Override + public void error(String msg, Throwable t) {} + + @Override + public boolean isErrorEnabled(Marker marker) { + return false; + } + + @Override + public void error(Marker marker, String msg) {} + + @Override + public void error(Marker marker, String format, Object arg) {} + + @Override + public void error(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void error(Marker marker, String format, Object... arguments) {} + + @Override + public void error(Marker marker, String msg, Throwable t) {} + + @Override + public void log(LoggingEvent event) { + messageList.add(event.getMessage()); + level = event.getLevel(); + List keyValuePairs = event.getKeyValuePairs(); + for (KeyValuePair pair : keyValuePairs) { + keyValuePairsMap.put(pair.key, pair.value); + } + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/TestMDCAdapter.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestMDCAdapter.java new file mode 100644 index 0000000000..b1b5d379cc --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestMDCAdapter.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import java.util.Deque; +import java.util.HashMap; +import java.util.Map; +import org.slf4j.spi.MDCAdapter; + +/** + * this adapter is for unit test only. It is set up via TestServiceProvider to test behavior when + * LogWithMDC + */ +public class TestMDCAdapter implements MDCAdapter { + Map mdcValues = new HashMap<>(); + + @Override + public void put(String key, String val) { + mdcValues.put(key, val); + } + + @Override + public String get(String key) { + return ""; + } + + @Override + public void remove(String key) {} + + @Override + public void clear() { + mdcValues.clear(); + } + + @Override + public Map getCopyOfContextMap() { + return mdcValues; + } + + @Override + public void setContextMap(Map contextMap) {} + + @Override + public void pushByKey(String key, String value) {} + + @Override + public String popByKey(String key) { + return ""; + } + + @Override + public Deque getCopyOfDequeByKey(String key) { + return null; + } + + @Override + public void clearDequeByKey(String key) {} +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/TestServiceProvider.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestServiceProvider.java new file mode 100644 index 0000000000..69cc43ba2a --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestServiceProvider.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import org.slf4j.ILoggerFactory; +import org.slf4j.IMarkerFactory; +import org.slf4j.spi.MDCAdapter; +import org.slf4j.spi.SLF4JServiceProvider; + +/** + * This provider is made discoverable to SFL4J's LoggerFactory in + * resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider + */ +public class TestServiceProvider implements SLF4JServiceProvider { + + @Override + public ILoggerFactory getLoggerFactory() { + // mock behavior when provider present + ILoggerFactory mockLoggerFactory = mock(ILoggerFactory.class); + when(mockLoggerFactory.getLogger(anyString())).thenReturn(new TestLogger("test-logger")); + return mockLoggerFactory; + } + + @Override + public IMarkerFactory getMarkerFactory() { + return null; + } + + @Override + public MDCAdapter getMDCAdapter() { + return new TestMDCAdapter(); + } + + @Override + public String getRequestedApiVersion() { + return ""; + } + + @Override + public void initialize() {} +} diff --git a/gax-java/gax/src/test/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider b/gax-java/gax/src/test/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider new file mode 100644 index 0000000000..de8b02c7be --- /dev/null +++ b/gax-java/gax/src/test/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider @@ -0,0 +1 @@ +com.google.api.gax.logging.TestServiceProvider \ No newline at end of file diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 72b31f7070..193276a45d 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -134,6 +134,11 @@ graal-sdk ${graal-sdk.version} + + org.slf4j + slf4j-api + ${slf4j.version} + com.google.http-client google-http-client-bom @@ -165,8 +170,9 @@ - + + org.junit.jupiter junit-jupiter-engine diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index 2549eb199f..331146b5d8 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -215,5 +215,144 @@ opentelemetry-sdk-testing test + + + + + + slf4j2_logback + + + + slf4j2_logback + + + + + org.slf4j + slf4j-api + 2.0.16 + test + + + ch.qos.logback + logback-classic + 1.5.16 + test + + + ch.qos.logback + logback-core + 1.5.16 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + + + + + + + + slf4j1_logback + + + + slf4j1_logback + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + 1.2.13 + test + + + ch.qos.logback + logback-core + 1.2.13 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + disabledLogging + + + + + disable_logging + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + 1.2.13 + test + + + ch.qos.logback + logback-core + 1.2.13 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java new file mode 100644 index 0000000000..5979b88c41 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java @@ -0,0 +1,257 @@ +/* + * Copyright 2025 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. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; +import org.slf4j.event.KeyValuePair; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' +public class ITLogging { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final KeyValuePair SERVICE_NAME_KEY_VALUE_PAIR = + new KeyValuePair("serviceName", "google.showcase.v1beta1.Echo"); + private static final KeyValuePair RPC_NAME_KEY_VALUE_PAIR = + new KeyValuePair("rpcName", "google.showcase.v1beta1.Echo/Echo"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR = + new KeyValuePair("response.status", "OK"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP = + new KeyValuePair("response.status", "200"); + private static final KeyValuePair REQUEST_URL_KEY_VALUE_PAIR = + new KeyValuePair("request.url", "http://localhost:7469"); + + private static final KeyValuePair RESPONSE_HEADERS_KEY_VALUE_PAIR = + new KeyValuePair("response.headers", ImmutableMap.of("content-type", "application/grpc")); + + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(5); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, + RESPONSE_HEADERS_KEY_VALUE_PAIR, + SERVICE_NAME_KEY_VALUE_PAIR, + RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + } + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(3); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(4); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("response.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers.size()).isEqualTo(11); + } + } + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(2); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java new file mode 100644 index 0000000000..d0dec4b80d --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java @@ -0,0 +1,217 @@ +/* + * Copyright 2025 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. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn verify -P +// '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback ' +public class ITLogging1x { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final String ECHO_STRING = "echo?"; + private static final String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + private static final String RPC_NAME = "google.showcase.v1beta1.Echo/Echo"; + private static final String ENDPOINT = "http://localhost:7469"; + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + + private static Logger logger = LoggerFactory.getLogger(ITLogging1x.class); + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void test() { + assertThat(logger.isInfoEnabled()).isTrue(); + assertThat(logger.isDebugEnabled()).isTrue(); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap).containsEntry("rpcName", RPC_NAME); + assertThat(mdcPropertyMap).containsEntry("request.url", ENDPOINT); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "rpcName", RPC_NAME, + "request.url", ENDPOINT)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java new file mode 100644 index 0000000000..16c6acb0a6 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java @@ -0,0 +1,78 @@ +/* + * Copyright 2025 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. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; + +// mvn verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' +public class ITLoggingDisabled { + + private static EchoClient grpcClient; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(Level.DEBUG); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // only run when GOOGLE_SDK_JAVA_LOGGING!=true + @Test + void testloggingDisabled() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(0); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java new file mode 100644 index 0000000000..769ad9a740 --- /dev/null +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 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. + */ + +package com.google.showcase.v1beta1.it.logging; + + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import java.util.ArrayList; +import java.util.List; + +/** Logback appender used to set up tests. */ +public class TestAppender extends AppenderBase { + public List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + // triggering Logback to capture the current MDC context and store it with the log event + // the default ListAppender does not capture MDC contents + eventObject.getMDCPropertyMap(); + + events.add(eventObject); + } + public void clearEvents() { + events.clear(); + } +} + diff --git a/showcase/pom.xml b/showcase/pom.xml index 436d52d359..256034da48 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -74,6 +74,16 @@ native + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + org.graalvm.buildtools native-maven-plugin @@ -103,6 +113,51 @@ true + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + + loggingTestBase + @@ -138,6 +193,16 @@ enable-golden-tests + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + org.codehaus.mojo exec-maven-plugin From 29c061e8a18b9a416262986f11c5148ea6fec9b2 Mon Sep 17 00:00:00 2001 From: Riya Mehta <55350838+rmehta19@users.noreply.github.com> Date: Mon, 24 Feb 2025 14:07:40 -0800 Subject: [PATCH 07/17] fix: S2A gRPC flow creates ComputeEngineCredentials via newBuilder. (#3651) @rockspore pointed out that the credential should be created from scratch because when using [toBuilder](https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java#L648) the underlying [access token is copied](https://github.com/googleapis/google-auth-library-java/blob/37d228410e99799e4a7be8650fe472ea712c9b4d/oauth2_http/java/com/google/auth/oauth2/OAuth2Credentials.java#L657). This was confirmed to be a bug with local testing which: - deployed a GAE app, the app performs the below two actions sequentially - create Google API client ( `allowedHardBoundAccessTokens` empty in GrpcProvider) and then ping the API, logs show the bearer token is used, obtained from making call to MDS - create a Google API client ( `allowedHardBoundAccessTokens` contains `MTLS_S2A` in GrpcProvider) and then ping the API, logs show the bearer token is used. A call to MDS is **not** made. This is likely because the credential and channel have different lifetimes. --- .../grpc/InstantiatingGrpcChannelProvider.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 2b00ade341..88bfd91601 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 @@ -1200,11 +1200,20 @@ boolean isDirectPathBoundTokenEnabled() { CallCredentials createHardBoundTokensCallCredentials( ComputeEngineCredentials.GoogleAuthTransport googleAuthTransport, ComputeEngineCredentials.BindingEnforcement bindingEnforcement) { + ComputeEngineCredentials.Builder credsBuilder = + ((ComputeEngineCredentials) credentials).toBuilder(); // We only set scopes and HTTP transport factory from the original credentials because - // only those are used in gRPC CallCredentials to fetch request metadata. + // only those are used in gRPC CallCredentials to fetch request metadata. We create a new + // credential + // via {@code newBuilder} as opposed to {@code toBuilder} because we don't want a reference to + // the + // access token held by {@code credentials}; we want this new credential to fetch a new access + // token + // from MDS using the {@param googleAuthTransport} and {@param bindingEnforcement}. return MoreCallCredentials.from( - ((ComputeEngineCredentials) this.credentials) - .toBuilder() + ComputeEngineCredentials.newBuilder() + .setScopes(credsBuilder.getScopes()) + .setHttpTransportFactory(credsBuilder.getHttpTransportFactory()) .setGoogleAuthTransport(googleAuthTransport) .setBindingEnforcement(bindingEnforcement) .build()); From 093d867eb5dcdcc08ece434598f96a6dff760326 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Feb 2025 17:11:58 +0100 Subject: [PATCH 08/17] deps: update dependency ch.qos.logback:logback-core to v1.3.15 [security] (#3654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ch.qos.logback:logback-core](http://logback.qos.ch) ([source](https://redirect.github.com/qos-ch/logback), [changelog](https://logback.qos.ch/news.html)) | `1.2.13` -> `1.3.15` | [![age](https://developer.mend.io/api/mc/badges/age/maven/ch.qos.logback:logback-core/1.3.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/ch.qos.logback:logback-core/1.3.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/ch.qos.logback:logback-core/1.2.13/1.3.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/ch.qos.logback:logback-core/1.2.13/1.3.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. ### GitHub Vulnerability Alerts #### [CVE-2024-12798](https://nvd.nist.gov/vuln/detail/CVE-2024-12798) ACE vulnerability in JaninoEventEvaluator by QOS.CH logback-core up to and including version 1.5.12 in Java applications allows attackers to execute arbitrary code by compromising an existing logback configuration file or by injecting an environment variable before program execution. Malicious logback configuration files can allow the attacker to execute arbitrary code using the JaninoEventEvaluator extension. A successful attack requires the user to have write access to a configuration file. Alternatively, the attacker could inject a malicious environment variable pointing to a malicious configuration file. In both cases, the attack requires existing privilege. #### [CVE-2024-12801](https://nvd.nist.gov/vuln/detail/CVE-2024-12801) Server-Side Request Forgery (SSRF) in SaxEventRecorder by QOS.CH logback version 1.5.12 on the Java platform, allows an attacker to forge requests by compromising logback configuration files in XML. The attacks involves the modification of DOCTYPE declaration in  XML configuration files. --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/sdk-platform-java). --- showcase/gapic-showcase/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index 331146b5d8..a8cc4dc483 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -288,7 +288,7 @@ ch.qos.logback logback-core - 1.2.13 + 1.3.15 test @@ -333,7 +333,7 @@ ch.qos.logback logback-core - 1.2.13 + 1.3.15 test From f333a80d07b91f486d6b1f02aeea476824c4ef2e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Feb 2025 17:32:16 +0100 Subject: [PATCH 09/17] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.14.4 (#3655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://redirect.github.com/googleapis/java-shared-config) | `1.14.2` -> `1.14.4` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-shared-config/1.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-shared-config/1.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-shared-config/1.14.2/1.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-shared-config/1.14.2/1.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
googleapis/java-shared-config (com.google.cloud:google-cloud-shared-config) ### [`v1.14.4`](https://redirect.github.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#1144-2025-02-24) [Compare Source](https://redirect.github.com/googleapis/java-shared-config/compare/v1.14.3...v1.14.4) ##### Dependencies - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.5 ([#​979](https://redirect.github.com/googleapis/java-shared-config/issues/979)) ([06c8547](https://redirect.github.com/googleapis/java-shared-config/commit/06c854718c39e658cdead0584cfb1cc698143ffd)) ### [`v1.14.3`](https://redirect.github.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#1143-2025-02-18) [Compare Source](https://redirect.github.com/googleapis/java-shared-config/compare/v1.14.2...v1.14.3) ##### Bug Fixes - Introducing "flatten" profile to use the plugin ([#​984](https://redirect.github.com/googleapis/java-shared-config/issues/984)) ([436aa7c](https://redirect.github.com/googleapis/java-shared-config/commit/436aa7c9e9914a830e3172ae0ee93131bb641e07))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/sdk-platform-java). --- .cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml | 2 +- .../graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml | 2 +- .cloudbuild/graalvm/cloudbuild-test-a.yaml | 2 +- .cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml | 2 +- .../graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml | 2 +- .cloudbuild/graalvm/cloudbuild-test-b.yaml | 2 +- .cloudbuild/graalvm/cloudbuild.yaml | 2 +- gapic-generator-java-pom-parent/pom.xml | 2 +- gax-java/gax-bom/pom.xml | 2 +- java-shared-dependencies/first-party-dependencies/pom.xml | 2 +- java-shared-dependencies/upper-bound-check/pom.xml | 2 +- sdk-platform-java-config/pom.xml | 2 +- showcase/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml index b445c77b6f..c87a60bee1 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.14.2' + _JAVA_SHARED_CONFIG_VERSION: '1.14.4' 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 c26d8ad360..b27f5effe0 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.14.2' + _JAVA_SHARED_CONFIG_VERSION: '1.14.4' 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 02a9fca76c..1f2745619a 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.14.2' + _JAVA_SHARED_CONFIG_VERSION: '1.14.4' 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 caa8103b59..1440175ac1 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.14.2' + _JAVA_SHARED_CONFIG_VERSION: '1.14.4' 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 4168bdead9..833062e62d 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.14.2' + _JAVA_SHARED_CONFIG_VERSION: '1.14.4' 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 655eb6a174..9d00b91f51 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.14.2' + _JAVA_SHARED_CONFIG_VERSION: '1.14.4' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml index 96ad7f7f42..39c4c19a1e 100644 --- a/.cloudbuild/graalvm/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.14.2' + _JAVA_SHARED_CONFIG_VERSION: '1.14.4' steps: # GraalVM A build - name: gcr.io/cloud-builders/docker diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index bb87b52553..7606e47101 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.14.2 + 1.14.4 diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 039144c644..11c6229542 100644 --- a/gax-java/gax-bom/pom.xml +++ b/gax-java/gax-bom/pom.xml @@ -11,7 +11,7 @@ com.google.cloud google-cloud-shared-config - 1.14.2 + 1.14.4 diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml index 3ea05cfec8..b357768bb0 100644 --- a/java-shared-dependencies/first-party-dependencies/pom.xml +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.14.2 + 1.14.4 diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index 90cad644fd..9b51088799 100644 --- a/java-shared-dependencies/upper-bound-check/pom.xml +++ b/java-shared-dependencies/upper-bound-check/pom.xml @@ -16,7 +16,7 @@ com.google.cloud google-cloud-shared-config - 1.14.2 + 1.14.4 diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index 879f15151f..bf56be4f33 100644 --- a/sdk-platform-java-config/pom.xml +++ b/sdk-platform-java-config/pom.xml @@ -13,7 +13,7 @@ com.google.cloud google-cloud-shared-config - 1.14.2 + 1.14.4 diff --git a/showcase/pom.xml b/showcase/pom.xml index 256034da48..b4268e3b8b 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.14.2 + 1.14.4 From 48db2a10e3ef46ad9ddf23378613a550172f63af Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Feb 2025 18:00:24 +0100 Subject: [PATCH 10/17] deps: update google api dependencies (#3631) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:grpc-google-common-protos](https://redirect.github.com/googleapis/sdk-platform-java) | `2.51.0` -> `2.52.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:grpc-google-common-protos/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:grpc-google-common-protos/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:grpc-google-common-protos/2.51.0/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:grpc-google-common-protos/2.51.0/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api.grpc:grpc-google-iam-v1](https://redirect.github.com/googleapis/sdk-platform-java) | `1.46.0` -> `1.47.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:grpc-google-iam-v1/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:grpc-google-iam-v1/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:grpc-google-iam-v1/1.46.0/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:grpc-google-iam-v1/1.46.0/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api.grpc:proto-google-common-protos](https://redirect.github.com/googleapis/sdk-platform-java) | `2.51.0` -> `2.52.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:proto-google-common-protos/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:proto-google-common-protos/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:proto-google-common-protos/2.51.0/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:proto-google-common-protos/2.51.0/2.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api.grpc:proto-google-iam-v1](https://redirect.github.com/googleapis/sdk-platform-java) | `1.46.0` -> `1.47.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:proto-google-iam-v1/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:proto-google-iam-v1/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:proto-google-iam-v1/1.46.0/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:proto-google-iam-v1/1.46.0/1.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api:api-common](https://redirect.github.com/googleapis/sdk-platform-java) | `2.43.0` -> `2.44.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api:api-common/2.44.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api:api-common/2.44.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api:api-common/2.43.0/2.44.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api:api-common/2.43.0/2.44.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
googleapis/sdk-platform-java (com.google.api.grpc:grpc-google-common-protos) ### [`v2.52.0`](https://redirect.github.com/googleapis/sdk-platform-java/blob/HEAD/CHANGELOG.md#2520-2025-01-24) [Compare Source](https://redirect.github.com/googleapis/sdk-platform-java/compare/v2.51.0...v2.52.0) ##### Features - add support for new setAllowHardBoundTokens field. ([#​3467](https://redirect.github.com/googleapis/sdk-platform-java/issues/3467)) ([38431a2](https://redirect.github.com/googleapis/sdk-platform-java/commit/38431a290ed55174599be0927be32daaa1c49d56)) - revert [#​3400](https://redirect.github.com/googleapis/sdk-platform-java/issues/3400): reintroduce experimental S2A integration in client libraries grpc transport ([#​3548](https://redirect.github.com/googleapis/sdk-platform-java/issues/3548)) ([65a0f11](https://redirect.github.com/googleapis/sdk-platform-java/commit/65a0f11d2c8bebade9518ff338103e92a332252c)) ##### Dependencies - update dependency com.google.api-client:google-api-client-bom to v2.7.2 ([#​3578](https://redirect.github.com/googleapis/sdk-platform-java/issues/3578)) ([f6e5ad9](https://redirect.github.com/googleapis/sdk-platform-java/commit/f6e5ad90aced32f8a738b2e52b30fcfa02c7af4b)) - update dependency commons-codec:commons-codec to v1.17.2 ([#​3557](https://redirect.github.com/googleapis/sdk-platform-java/issues/3557)) ([07ce801](https://redirect.github.com/googleapis/sdk-platform-java/commit/07ce801599479020629ce726afb9c06b2f711093)) - update dependency gitpython to v3.1.44 ([#​3559](https://redirect.github.com/googleapis/sdk-platform-java/issues/3559)) ([e924db0](https://redirect.github.com/googleapis/sdk-platform-java/commit/e924db06590648ad40b5b3aa0f6269084270064b)) - update dependency org.checkerframework:checker-qual to v3.48.4 ([#​3560](https://redirect.github.com/googleapis/sdk-platform-java/issues/3560)) ([a4726e9](https://redirect.github.com/googleapis/sdk-platform-java/commit/a4726e9d96e9f54d839b6822a6372b1905839b6d)) - update dependency smmap to v5.0.2 ([#​3561](https://redirect.github.com/googleapis/sdk-platform-java/issues/3561)) ([6cd5d0d](https://redirect.github.com/googleapis/sdk-platform-java/commit/6cd5d0dfa4c5cd981b2d27771ca4b681ef415c63)) - update docker.io/library/alpine docker tag to v3.21.1 ([#​3551](https://redirect.github.com/googleapis/sdk-platform-java/issues/3551)) ([edd5a4c](https://redirect.github.com/googleapis/sdk-platform-java/commit/edd5a4c04db6b16cb005301d4dbcd3f8c28b7537)) - update docker.io/library/alpine docker tag to v3.21.2 ([#​3580](https://redirect.github.com/googleapis/sdk-platform-java/issues/3580)) ([f577ecd](https://redirect.github.com/googleapis/sdk-platform-java/commit/f577ecd044fc30dbeb2209292ecc6dcfdedaa758)) - update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to [`9a259c6`](https://redirect.github.com/googleapis/sdk-platform-java/commit/9a259c6) ([#​3554](https://redirect.github.com/googleapis/sdk-platform-java/issues/3554)) ([eb2cbd6](https://redirect.github.com/googleapis/sdk-platform-java/commit/eb2cbd6515ded9278ffd0dae92af80b321e95c25)) - update docker.io/library/python:3.13.1-alpine3.20 docker digest to [`9ab3b6e`](https://redirect.github.com/googleapis/sdk-platform-java/commit/9ab3b6e) ([#​3555](https://redirect.github.com/googleapis/sdk-platform-java/issues/3555)) ([40a74fe](https://redirect.github.com/googleapis/sdk-platform-java/commit/40a74fe322b9cc4fc50919e17472c617dd331e86)) - update google auth library dependencies to v1.31.0 ([#​3577](https://redirect.github.com/googleapis/sdk-platform-java/issues/3577)) ([7fa879a](https://redirect.github.com/googleapis/sdk-platform-java/commit/7fa879a0e795094d481c090123d612f0e3a3968e)) - update googleapis/java-cloud-bom digest to [`c7c443f`](https://redirect.github.com/googleapis/sdk-platform-java/commit/c7c443f) ([#​3579](https://redirect.github.com/googleapis/sdk-platform-java/issues/3579)) ([fcf40b7](https://redirect.github.com/googleapis/sdk-platform-java/commit/fcf40b72d43346e43d78d1e87060be6e621e9d52)) - update repo-automation-bots digest to [`0a12b5d`](https://redirect.github.com/googleapis/sdk-platform-java/commit/0a12b5d) ([#​3464](https://redirect.github.com/googleapis/sdk-platform-java/issues/3464)) ([b9c9d21](https://redirect.github.com/googleapis/sdk-platform-java/commit/b9c9d212ea57598de5ddf2e4ead2ee323c5a8135))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/sdk-platform-java). --- gax-java/dependencies.properties | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 9dcb8c805d..547b425a47 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -35,8 +35,8 @@ version.io_grpc=1.70.0 # 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.51.0 -maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.51.0 +maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.52.0 +maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.52.0 maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.32.1 maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.32.1 maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.47.0 @@ -67,10 +67,10 @@ maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_ 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.43.0 +maven.com_google_api_api_common=com.google.api:api-common:2.44.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.46.0 -maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.46.0 +maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:1.47.0 +maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.47.0 maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.46.1 maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.46.1 maven.org_codehaus_mojo_animal_sniffer_annotations=org.codehaus.mojo:animal-sniffer-annotations:1.24 From 0ddf0738a8ef74f5676a3bf76c306837d14988e0 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:49:39 -0500 Subject: [PATCH 11/17] docs: update showcase readme (#3659) In this PR: - Update link in showcase readme. --- showcase/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/showcase/README.md b/showcase/README.md index 536568e76b..b5d3c8a6fb 100644 --- a/showcase/README.md +++ b/showcase/README.md @@ -81,7 +81,7 @@ Note that the underlying scripts will modify your `$HOME` folder by creating a `.library_generation` folder. This is the well-known location of the artifacts the generation scripts use. For more details see the -[development guide](https://github.com/googleapis/sdk-platform-java/blob/main/library_generation/DEVELOPMENT.md#the-hermetic-builds-well-known-folder) +[development guide](https://github.com/googleapis/sdk-platform-java/blob/main/hermetic_build/DEVELOPMENT.md#the-hermetic-builds-well-known-folder) ```shell # In repository's root directory From 6ca05994f6be40344b21befb8cdabb0766a835d0 Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:47:58 +0000 Subject: [PATCH 12/17] deps: update grpc to 1.70.0 (missed update) (#3658) this should have gone with PR https://github.com/googleapis/sdk-platform-java/pull/3641 --------- Co-authored-by: cloud-java-bot Co-authored-by: JoeWang1127 --- .../library_generation.Dockerfile | 2 +- gapic-generator-java-pom-parent/pom.xml | 2 +- .../google/cloud/location/LocationsGrpc.java | 61 ++++++ .../google/longrunning/OperationsGrpc.java | 129 ++++++++++++ .../java/com/google/iam/v1/IAMPolicyGrpc.java | 96 +++++++++ .../java/com/google/iam/v2/PoliciesGrpc.java | 106 ++++++++++ .../com/google/iam/v2beta/PoliciesGrpc.java | 106 ++++++++++ .../showcase/v1beta1/ComplianceGrpc.java | 151 ++++++++++++++ .../com/google/showcase/v1beta1/EchoGrpc.java | 167 +++++++++++++++ .../google/showcase/v1beta1/IdentityGrpc.java | 85 ++++++++ .../showcase/v1beta1/MessagingGrpc.java | 193 ++++++++++++++++++ .../showcase/v1beta1/SequenceServiceGrpc.java | 94 +++++++++ .../google/showcase/v1beta1/TestingGrpc.java | 129 ++++++++++++ 13 files changed, 1319 insertions(+), 2 deletions(-) diff --git a/.cloudbuild/library_generation/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile index 79d424de2a..c303a78de8 100644 --- a/.cloudbuild/library_generation/library_generation.Dockerfile +++ b/.cloudbuild/library_generation/library_generation.Dockerfile @@ -51,7 +51,7 @@ FROM docker.io/library/python:3.13.2-alpine3.20@sha256:816feb29731cdee64b15b0ae9 ARG OWLBOT_CLI_COMMITTISH=3a68a9c0de318784b3aefadcc502a6521b3f1bc5 ARG PROTOC_VERSION=25.5 -ARG GRPC_VERSION=1.69.1 +ARG GRPC_VERSION=1.70.0 ARG JAVA_FORMAT_VERSION=1.7 ENV HOME=/home ENV OS_ARCHITECTURE="linux-x86_64" diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 7606e47101..693ee5bd21 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -26,7 +26,7 @@ 1.3.2 - 1.69.1 + 1.70.0 1.32.1 1.46.1 2.12.1 diff --git a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java index 82b7bd4cb5..db4ea9047a 100644 --- a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java +++ b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java @@ -134,6 +134,19 @@ public LocationsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOp return LocationsStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static LocationsBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingV2Stub(channel, callOptions); + } + }; + return LocationsBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -282,6 +295,54 @@ public void getLocation( * [Location.metadata][google.cloud.location.Location.metadata] field. * */ + public static final class LocationsBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private LocationsBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public com.google.cloud.location.ListLocationsResponse listLocations( + com.google.cloud.location.ListLocationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLocationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public com.google.cloud.location.Location getLocation( + com.google.cloud.location.GetLocationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLocationMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Locations. + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ public static final class LocationsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private LocationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 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 2d2a18e3c3..f279b1b9d5 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 @@ -262,6 +262,19 @@ public OperationsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callO return OperationsStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static OperationsBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OperationsBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OperationsBlockingV2Stub(channel, callOptions); + } + }; + return OperationsBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -568,6 +581,122 @@ public void waitOperation( * developers can have a consistent client experience. * */ + public static final class OperationsBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private OperationsBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OperationsBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OperationsBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists operations that match the specified filter in the request. If the
+     * server doesn't support this method, it returns `UNIMPLEMENTED`.
+     * 
+ */ + public com.google.longrunning.ListOperationsResponse listOperations( + com.google.longrunning.ListOperationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListOperationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the latest state of a long-running operation.  Clients can use this
+     * method to poll the operation result at intervals as recommended by the API
+     * service.
+     * 
+ */ + public com.google.longrunning.Operation getOperation( + com.google.longrunning.GetOperationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOperationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a long-running operation. This method indicates that the client is
+     * no longer interested in the operation result. It does not cancel the
+     * operation. If the server doesn't support this method, it returns
+     * `google.rpc.Code.UNIMPLEMENTED`.
+     * 
+ */ + public com.google.protobuf.Empty deleteOperation( + com.google.longrunning.DeleteOperationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteOperationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts asynchronous cancellation on a long-running operation.  The server
+     * makes a best effort to cancel the operation, but success is not
+     * guaranteed.  If the server doesn't support this method, it returns
+     * `google.rpc.Code.UNIMPLEMENTED`.  Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * 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`.
+     * 
+ */ + public com.google.protobuf.Empty cancelOperation( + com.google.longrunning.CancelOperationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCancelOperationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Waits until the specified long-running operation is done or reaches at most
+     * a specified timeout, returning the latest state.  If the operation is
+     * already done, the latest state is immediately returned.  If the timeout
+     * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
+     * timeout is used.  If the server does not support this method, it returns
+     * `google.rpc.Code.UNIMPLEMENTED`.
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation waitOperation( + com.google.longrunning.WaitOperationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWaitOperationMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Operations. + * + *
+   * 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 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 extends io.grpc.stub.AbstractBlockingStub { private OperationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { diff --git a/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java b/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java index 723e9dc70d..9c1eb28262 100644 --- a/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java +++ b/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java @@ -183,6 +183,19 @@ public IAMPolicyStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOp return IAMPolicyStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static IAMPolicyBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IAMPolicyBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IAMPolicyBlockingV2Stub(channel, callOptions); + } + }; + return IAMPolicyBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -439,6 +452,89 @@ public void testIamPermissions( * attached. * */ + public static final class IAMPolicyBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private IAMPolicyBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IAMPolicyBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IAMPolicyBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Sets the access control policy on the specified resource. Replaces any
+     * existing policy.
+     * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy for a resource.
+     * Returns an empty policy if the resource exists and does not have a policy
+     * set.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified resource.
+     * If the resource does not exist, this will return an empty set of
+     * permissions, not a `NOT_FOUND` error.
+     * Note: This operation is designed to be used for building permission-aware
+     * UIs and command-line tools, not for authorization checking. This operation
+     * may "fail open" without warning.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service IAMPolicy. + * + *
+   * API Overview
+   * Manages Identity and Access Management (IAM) policies.
+   * Any implementation of an API that offers access control features
+   * implements the google.iam.v1.IAMPolicy interface.
+   * ## Data model
+   * Access control is applied when a principal (user or service account), takes
+   * some action on a resource exposed by a service. Resources, identified by
+   * URI-like names, are the unit of access control specification. Service
+   * implementations can choose the granularity of access control and the
+   * supported permissions for their resources.
+   * For example one database service may allow access control to be
+   * specified only at the Table level, whereas another might allow access control
+   * to also be specified at the Column level.
+   * ## Policy Structure
+   * See google.iam.v1.Policy
+   * This is intentionally not a CRUD style API because access control policies
+   * are created and deleted implicitly with the resources to which they are
+   * attached.
+   * 
+ */ public static final class IAMPolicyBlockingStub extends io.grpc.stub.AbstractBlockingStub { private IAMPolicyBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { diff --git a/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java b/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java index 57a46e9555..ef9eccd8a2 100644 --- a/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java +++ b/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java @@ -246,6 +246,19 @@ public PoliciesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOpt return PoliciesStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PoliciesBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PoliciesBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + }; + return PoliciesBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -489,6 +502,99 @@ public void deletePolicy( * An interface for managing Identity and Access Management (IAM) policies. * */ + public static final class PoliciesBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PoliciesBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PoliciesBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the policies of the specified kind that are attached to a
+     * resource.
+     * The response lists only policy metadata. In particular, policy rules are
+     * omitted.
+     * 
+ */ + public com.google.iam.v2.ListPoliciesResponse listPolicies( + com.google.iam.v2.ListPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a policy.
+     * 
+ */ + public com.google.iam.v2.Policy getPolicy(com.google.iam.v2.GetPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a policy.
+     * 
+ */ + public com.google.longrunning.Operation createPolicy( + com.google.iam.v2.CreatePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified policy.
+     * You can update only the rules and the display name for the policy.
+     * To update a policy, you should use a read-modify-write loop:
+     * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
+     * 2. Modify the policy as needed.
+     * 3. Use `UpdatePolicy` to write the updated policy.
+     * This pattern helps prevent conflicts between concurrent updates.
+     * 
+ */ + public com.google.longrunning.Operation updatePolicy( + com.google.iam.v2.UpdatePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a policy. This action is permanent.
+     * 
+ */ + public com.google.longrunning.Operation deletePolicy( + com.google.iam.v2.DeletePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePolicyMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Policies. + * + *
+   * An interface for managing Identity and Access Management (IAM) policies.
+   * 
+ */ public static final class PoliciesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private PoliciesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { diff --git a/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java b/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java index 251690535c..f46f577747 100644 --- a/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java +++ b/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java @@ -247,6 +247,19 @@ public PoliciesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOpt return PoliciesStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PoliciesBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PoliciesBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + }; + return PoliciesBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -490,6 +503,99 @@ public void deletePolicy( * An interface for managing Identity and Access Management (IAM) policies. * */ + public static final class PoliciesBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PoliciesBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PoliciesBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the policies of the specified kind that are attached to a
+     * resource.
+     * The response lists only policy metadata. In particular, policy rules are
+     * omitted.
+     * 
+ */ + public com.google.iam.v2beta.ListPoliciesResponse listPolicies( + com.google.iam.v2beta.ListPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a policy.
+     * 
+ */ + public com.google.iam.v2beta.Policy getPolicy(com.google.iam.v2beta.GetPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a policy.
+     * 
+ */ + public com.google.longrunning.Operation createPolicy( + com.google.iam.v2beta.CreatePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified policy.
+     * You can update only the rules and the display name for the policy.
+     * To update a policy, you should use a read-modify-write loop:
+     * 1. Use [GetPolicy][google.iam.v2beta.Policies.GetPolicy] to read the current version of the policy.
+     * 2. Modify the policy as needed.
+     * 3. Use `UpdatePolicy` to write the updated policy.
+     * This pattern helps prevent conflicts between concurrent updates.
+     * 
+ */ + public com.google.longrunning.Operation updatePolicy( + com.google.iam.v2beta.UpdatePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a policy. This action is permanent.
+     * 
+ */ + public com.google.longrunning.Operation deletePolicy( + com.google.iam.v2beta.DeletePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePolicyMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Policies. + * + *
+   * An interface for managing Identity and Access Management (IAM) policies.
+   * 
+ */ public static final class PoliciesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private PoliciesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java index ac687ff3e1..501e88c27e 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -344,6 +344,21 @@ public ComplianceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callO return ComplianceStub.newStub(factory, channel); } + /** + * Creates a new blocking-style stub that supports all types of calls on the service + */ + public static ComplianceBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + }; + return ComplianceBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -668,6 +683,142 @@ public void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, * correctly. * */ + public static final class ComplianceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + + /** + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending the entire request object in the REST body.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending the a message-type field in the REST body. Per AIP-127, only
+     * top-level, non-repeated fields can be sent this way.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending all request fields as query parameters.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending some parameters as "simple" path variables (i.e., of the form
+     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + *
+     * Same as RepeatDataSimplePath, but with a path resource.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + *
+     * Same as RepeatDataSimplePath, but with a trailing resource.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + *
+     * This method echoes the ComplianceData request, using the HTTP PUT method.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + *
+     * This method echoes the ComplianceData request, using the HTTP PATCH method.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + *
+     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
+     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum vaues they receive, use the
+     * response from this RPC as the request to VerifyEnum()
+     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
+     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
+     * 
+ */ + public com.google.showcase.v1beta1.EnumResponse getEnum(com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + *
+     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
+     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
+     * with the same EnumResponse; otherwise, the RPC errors.
+     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
+     * although they are not guaranteed to be the same across separate Showcase server runs.
+     * 
+ */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum(com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Compliance. + *
+   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
+   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
+   * correctly.
+   * 
+ */ public static final class ComplianceBlockingStub extends io.grpc.stub.AbstractBlockingStub { private ComplianceBlockingStub( diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java index 907089a5e7..88dfc51bf7 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java @@ -348,6 +348,21 @@ public EchoStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions return EchoStub.newStub(factory, channel); } + /** + * Creates a new blocking-style stub that supports all types of calls on the service + */ + public static EchoBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + }; + return EchoBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -700,6 +715,158 @@ public void block(com.google.showcase.v1beta1.BlockRequest request, * echoed in the response headers. * */ + public static final class EchoBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + + /** + *
+     * This method simply echoes the request. This method showcases unary RPCs.
+     * 
+ */ + public com.google.showcase.v1beta1.EchoResponse echo(com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + *
+     * This method returns error details in a repeated "google.protobuf.Any"
+     * field. This method showcases handling errors thus encoded, particularly
+     * over REST transport. Note that GAPICs only allow the type
+     * "google.protobuf.Any" for field paths ending in "error.details", and, at
+     * run-time, the actual types for these fields must be one of the types in
+     * google/rpc/error_details.proto.
+     * 
+ */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails(com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + *
+     * This method splits the given content into words and will pass each word back
+     * through the stream. This method showcases server-side streaming RPCs.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + expand(com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + *
+     * This method will collect the words given to it. When the stream is closed
+     * by the client, this method will return the a concatenation of the strings
+     * passed to it. This method showcases client-side streaming RPCs.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + collect() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getCollectMethod(), getCallOptions()); + } + + /** + *
+     * This method, upon receiving a request on the stream, will pass the same
+     * content back on the stream. This method showcases bidirectional
+     * streaming RPCs.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + chat() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getChatMethod(), getCallOptions()); + } + + /** + *
+     * This is similar to the Expand method but instead of returning a stream of
+     * expanded words, this method returns a paged list of expanded words.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + *
+     * This is similar to the PagedExpand except that it uses
+     * max_results instead of page_size, as some legacy APIs still
+     * do. New APIs should NOT use this pattern.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + *
+     * This method returns a map containing lists of words that appear in the input, keyed by their
+     * initial character. The only words returned are the ones included in the current page,
+     * as determined by page_token and page_size, which both refer to the word indices in the
+     * input. This paging result consisting of a map of lists is a pattern used by some legacy
+     * APIs. New APIs should NOT use this pattern.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + *
+     * This method will wait for the requested amount of time and then return.
+     * This method showcases how a client handles a request timeout.
+     * 
+ */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + *
+     * This method will block (wait) for the requested amount of time
+     * and then return the response or error.
+     * This method showcases how a client handles delays or retries.
+     * 
+ */ + public com.google.showcase.v1beta1.BlockResponse block(com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Echo. + *
+   * This service is used showcase the four main types of rpcs - unary, server
+   * side streaming, client side streaming, and bidirectional streaming. This
+   * service also exposes methods that explicitly implement server delay, and
+   * paginated calls. Set the 'showcase-trailer' metadata key on any method
+   * to have the values echoed in the response trailers. Set the
+   * 'x-goog-request-params' metadata key on any method to have the values
+   * echoed in the response headers.
+   * 
+ */ public static final class EchoBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EchoBlockingStub( diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java index 4d0168e2a5..846e1475ca 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java @@ -187,6 +187,21 @@ public IdentityStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOpt return IdentityStub.newStub(factory, channel); } + /** + * Creates a new blocking-style stub that supports all types of calls on the service + */ + public static IdentityBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + }; + return IdentityBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -370,6 +385,76 @@ public void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, * A simple identity service. * */ + public static final class IdentityBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + + /** + *
+     * Creates a user.
+     * 
+ */ + public com.google.showcase.v1beta1.User createUser(com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + *
+     * Retrieves the User with the given uri.
+     * 
+ */ + public com.google.showcase.v1beta1.User getUser(com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + *
+     * Updates a user.
+     * 
+ */ + public com.google.showcase.v1beta1.User updateUser(com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + *
+     * Deletes a user, their profile, and all of their authored messages.
+     * 
+ */ + public com.google.protobuf.Empty deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + *
+     * Lists all users.
+     * 
+ */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers(com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Identity. + *
+   * A simple identity service.
+   * 
+ */ public static final class IdentityBlockingStub extends io.grpc.stub.AbstractBlockingStub { private IdentityBlockingStub( diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java index 04c1ed6ed8..4fae3c111c 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java @@ -468,6 +468,21 @@ public MessagingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOp return MessagingStub.newStub(factory, channel); } + /** + * Creates a new blocking-style stub that supports all types of calls on the service + */ + public static MessagingBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + }; + return MessagingBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -868,6 +883,184 @@ public io.grpc.stub.StreamObserver c * generated by gapic-generators implement. * */ + public static final class MessagingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + + /** + *
+     * Creates a room.
+     * 
+ */ + public com.google.showcase.v1beta1.Room createRoom(com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + *
+     * Retrieves the Room with the given resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.Room getRoom(com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + *
+     * Updates a room.
+     * 
+ */ + public com.google.showcase.v1beta1.Room updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + *
+     * Deletes a room and all of its blurbs.
+     * 
+ */ + public com.google.protobuf.Empty deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + *
+     * Lists all chat rooms.
+     * 
+ */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms(com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + *
+     * Creates a blurb. If the parent is a room, the blurb is understood to be a
+     * message in that room. If the parent is a profile, the blurb is understood
+     * to be a post on the profile.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + *
+     * Retrieves the Blurb with the given resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + *
+     * Updates a blurb.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + *
+     * Deletes a blurb.
+     * 
+ */ + public com.google.protobuf.Empty deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + *
+     * Lists blurbs for a specific chat room or user profile depending on the
+     * parent resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + *
+     * This method searches through all blurbs across all rooms and profiles
+     * for blurbs containing to words found in the query. Only posts that
+     * contain an exact match of a queried word will be returned.
+     * 
+ */ + public com.google.longrunning.Operation searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + *
+     * This returns a stream that emits the blurbs that are created for a
+     * particular chat room or user profile.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + + /** + *
+     * This is a stream to create multiple blurbs. If an invalid blurb is
+     * requested to be created, the stream will close with an error.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + sendBlurbs() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getSendBlurbsMethod(), getCallOptions()); + } + + /** + *
+     * This method starts a bidirectional stream that receives all blurbs that
+     * are being created after the stream has started and sends requests to create
+     * blurbs. If an invalid blurb is requested to be created, the stream will
+     * close with an error.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + connect() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getConnectMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Messaging. + *
+   * A simple messaging service that implements chat rooms and profile posts.
+   * This messaging service showcases the features that API clients
+   * generated by gapic-generators implement.
+   * 
+ */ public static final class MessagingBlockingStub extends io.grpc.stub.AbstractBlockingStub { private MessagingBlockingStub( diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java index 5512a820dc..6fa9af09aa 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -215,6 +215,21 @@ public SequenceServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions return SequenceServiceStub.newStub(factory, channel); } + /** + * Creates a new blocking-style stub that supports all types of calls on the service + */ + public static SequenceServiceBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + }; + return SequenceServiceBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -407,6 +422,85 @@ public void attemptStreamingSequence(com.google.showcase.v1beta1.AttemptStreamin /** * A stub to allow clients to do synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + + /** + *
+     * Creates a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.Sequence createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + *
+     * Creates a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence(com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport(com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + *
+     * Attempts a sequence.
+     * 
+ */ + public com.google.protobuf.Empty attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + *
+     * Attempts a streaming sequence.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + attemptStreamingSequence(com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SequenceService. + */ public static final class SequenceServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SequenceServiceBlockingStub( diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java index 61c3d974e4..56781ab009 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -284,6 +284,21 @@ public TestingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOpti return TestingStub.newStub(factory, channel); } + /** + * Creates a new blocking-style stub that supports all types of calls on the service + */ + public static TestingBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + }; + return TestingBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -566,6 +581,120 @@ public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, * 2) [Nonsense][]: `pokemon/*/psychic/*` * */ + public static final class TestingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + + /** + *
+     * Creates a new testing session.
+     * Adding this comment with special characters for comment formatting tests:
+     * 1. (abra->kadabra->alakazam)
+     * 2) [Nonsense][]: `pokemon/*/psychic/*`
+     * 
+ */ + public com.google.showcase.v1beta1.Session createSession(com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + *
+     * Gets a testing session.
+     * 
+ */ + public com.google.showcase.v1beta1.Session getSession(com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + *
+     * Lists the current test sessions.
+     * 
+ */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions(com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete a test session.
+     * 
+ */ + public com.google.protobuf.Empty deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + *
+     * Report on the status of a session.
+     * This generates a report detailing which tests have been completed,
+     * and an overall rollup.
+     * 
+ */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession(com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + *
+     * List the tests of a sessesion.
+     * 
+ */ + public com.google.showcase.v1beta1.ListTestsResponse listTests(com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + *
+     * Explicitly decline to implement a test.
+     * This removes the test from subsequent `ListTests` calls, and
+     * attempting to do the test will error.
+     * This method will error if attempting to delete a required test.
+     * 
+ */ + public com.google.protobuf.Empty deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + *
+     * Register a response to a test.
+     * In cases where a test involves registering a final answer at the
+     * end of the test, this method provides the means to do so.
+     * 
+ */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Testing. + *
+   * A service to facilitate running discrete sets of tests
+   * against Showcase.
+   * Adding this comment with special characters for comment formatting tests:
+   * 1. (abra->kadabra->alakazam)
+   * 2) [Nonsense][]: `pokemon/*/psychic/*`
+   * 
+ */ public static final class TestingBlockingStub extends io.grpc.stub.AbstractBlockingStub { private TestingBlockingStub( From 9d5b3b5ae6a18fbc8445025fa9ec1abe00b7f7cc Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Tue, 25 Feb 2025 20:06:49 +0000 Subject: [PATCH 13/17] deps: update google http client dependencies to v1.46.3 (#3657) --- gapic-generator-java-pom-parent/pom.xml | 2 +- gax-java/dependencies.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 693ee5bd21..671c6b1485 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -28,7 +28,7 @@ 1.3.2 1.70.0 1.32.1 - 1.46.1 + 1.46.3 2.12.1 33.4.0-jre 3.25.5 diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 547b425a47..cf55172893 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -71,8 +71,8 @@ maven.com_google_api_api_common=com.google.api:api-common:2.44.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.47.0 maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.47.0 -maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.46.1 -maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.46.1 +maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.46.3 +maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.46.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:nativeimage:24.1.2 From f7877a5b278d3487cb50a1e942f6ff6268121069 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Feb 2025 21:28:46 +0100 Subject: [PATCH 14/17] deps: update google auth library dependencies to v1.33.1 (#3656) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.auth:google-auth-library-credentials](https://redirect.github.com/googleapis/google-auth-library-java) | `1.32.1` -> `1.33.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.auth:google-auth-library-credentials/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.auth:google-auth-library-credentials/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.auth:google-auth-library-credentials/1.32.1/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.auth:google-auth-library-credentials/1.32.1/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.auth:google-auth-library-oauth2-http](https://redirect.github.com/googleapis/google-auth-library-java) | `1.32.1` -> `1.33.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.auth:google-auth-library-oauth2-http/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.auth:google-auth-library-oauth2-http/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.auth:google-auth-library-oauth2-http/1.32.1/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.auth:google-auth-library-oauth2-http/1.32.1/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.auth:google-auth-library-bom](https://redirect.github.com/googleapis/google-auth-library-java) | `1.32.1` -> `1.33.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.auth:google-auth-library-bom/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.auth:google-auth-library-bom/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.auth:google-auth-library-bom/1.32.1/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.auth:google-auth-library-bom/1.32.1/1.33.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
googleapis/google-auth-library-java (com.google.auth:google-auth-library-credentials) ### [`v1.33.1`](https://redirect.github.com/googleapis/google-auth-library-java/blob/HEAD/CHANGELOG.md#1331-2025-02-25) [Compare Source](https://redirect.github.com/googleapis/google-auth-library-java/compare/v1.33.0...v1.33.1) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-config to v1.14.4 ([53a2abc](https://redirect.github.com/googleapis/google-auth-library-java/commit/53a2abc5b19e25079113ebff501aebc18efca309)) ### [`v1.33.0`](https://redirect.github.com/googleapis/google-auth-library-java/blob/HEAD/CHANGELOG.md#1330-2025-02-24) [Compare Source](https://redirect.github.com/googleapis/google-auth-library-java/compare/v1.32.1...v1.33.0) ##### Features - Add client logging with slf4j ([#​1586](https://redirect.github.com/googleapis/google-auth-library-java/issues/1586)) ([24761d6](https://redirect.github.com/googleapis/google-auth-library-java/commit/24761d6cc3590c4b08c56c8c992b740e235b31c5)) ##### Dependencies - Update dependency com.google.http-client:google-http-client-bom to v1.46.1 ([96a5ad8](https://redirect.github.com/googleapis/google-auth-library-java/commit/96a5ad88a7b187e1a0d472dca06ff39d74804d61))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/sdk-platform-java). --- gapic-generator-java-pom-parent/pom.xml | 2 +- gax-java/dependencies.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 671c6b1485..36aafb4c56 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -27,7 +27,7 @@ consistent across modules in this repository --> 1.3.2 1.70.0 - 1.32.1 + 1.33.1 1.46.3 2.12.1 33.4.0-jre diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index cf55172893..11feb50065 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -37,8 +37,8 @@ version.io_grpc=1.70.0 # 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.52.0 maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.52.0 -maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.32.1 -maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.32.1 +maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.33.1 +maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.33.1 maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.47.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 From 651cc9a7beabf8534d5b6edc83c1c554a9e691ef Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Tue, 25 Feb 2025 16:04:15 -0500 Subject: [PATCH 15/17] chore: update googleapis commit (#3662) --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 432348b55e..ef953bba5d 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,4 +1,4 @@ -googleapis_commitish: 0a459af4362c0e41b9723dd4d7edc022c552db40 +googleapis_commitish: 58be301346758c9a342de5632c3f9284d05c4b95 # 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. From 5c233d8b646e8385e30fb917f77870157d10f940 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:18:48 -0500 Subject: [PATCH 16/17] chore: update googleapis commit at Tue Feb 25 21:56:14 UTC 2025 (#3664) chore: update googleapis commit at Tue Feb 25 21:56:14 UTC 2025 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index ef953bba5d..dcadb4ea02 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,4 +1,4 @@ -googleapis_commitish: 58be301346758c9a342de5632c3f9284d05c4b95 +googleapis_commitish: fbbbf5023815f9a662c85aa8af8f3b72467fcb6f # 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. From 3319c715c627f5113fc54873155b45cc94a3fb0c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:35:22 -0500 Subject: [PATCH 17/17] chore(main): release 2.54.0 (#3636) :robot: I have created a release *beep* *boop* ---
2.54.0 ## [2.54.0](https://github.com/googleapis/sdk-platform-java/compare/v2.53.0...v2.54.0) (2025-02-25) ### Features * add client side logging with slf4j ([#3403](https://github.com/googleapis/sdk-platform-java/issues/3403)) ([fe002fa](https://github.com/googleapis/sdk-platform-java/commit/fe002fab1ab65b29eeb5510d1ba1ef72fa3441b0)) ### Bug Fixes * S2A gRPC flow creates ComputeEngineCredentials via newBuilder. ([#3651](https://github.com/googleapis/sdk-platform-java/issues/3651)) ([29c061e](https://github.com/googleapis/sdk-platform-java/commit/29c061e8a18b9a416262986f11c5148ea6fec9b2)) ### Dependencies * update dependency ch.qos.logback:logback-core to v1.3.15 [security] ([#3654](https://github.com/googleapis/sdk-platform-java/issues/3654)) ([093d867](https://github.com/googleapis/sdk-platform-java/commit/093d867eb5dcdcc08ece434598f96a6dff760326)) * update google api dependencies ([#3631](https://github.com/googleapis/sdk-platform-java/issues/3631)) ([48db2a1](https://github.com/googleapis/sdk-platform-java/commit/48db2a10e3ef46ad9ddf23378613a550172f63af)) * update google auth library dependencies to v1.33.1 ([#3656](https://github.com/googleapis/sdk-platform-java/issues/3656)) ([f7877a5](https://github.com/googleapis/sdk-platform-java/commit/f7877a5b278d3487cb50a1e942f6ff6268121069)) * update google http client dependencies to v1.46.3 ([#3657](https://github.com/googleapis/sdk-platform-java/issues/3657)) ([9d5b3b5](https://github.com/googleapis/sdk-platform-java/commit/9d5b3b5ae6a18fbc8445025fa9ec1abe00b7f7cc)) * update grpc to 1.70.0 ([#3641](https://github.com/googleapis/sdk-platform-java/issues/3641)) ([ad26cf9](https://github.com/googleapis/sdk-platform-java/commit/ad26cf98548e325c99edb263baf8fe1a7696e634)) * update grpc to 1.70.0 (missed update) ([#3658](https://github.com/googleapis/sdk-platform-java/issues/3658)) ([6ca0599](https://github.com/googleapis/sdk-platform-java/commit/6ca05994f6be40344b21befb8cdabb0766a835d0)) * Update opentelemetry-semconv to v1.29.0-alpha ([#3635](https://github.com/googleapis/sdk-platform-java/issues/3635)) ([49ac09d](https://github.com/googleapis/sdk-platform-java/commit/49ac09d263daad8ceb2e14a623db242339880670)) ### Documentation * update showcase readme ([#3659](https://github.com/googleapis/sdk-platform-java/issues/3659)) ([0ddf073](https://github.com/googleapis/sdk-platform-java/commit/0ddf0738a8ef74f5676a3bf76c306837d14988e0))
--- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Joe Wang --- .cloudbuild/graalvm/cloudbuild-test-a.yaml | 2 +- .cloudbuild/graalvm/cloudbuild-test-b.yaml | 2 +- .cloudbuild/graalvm/cloudbuild.yaml | 2 +- .../cloudbuild-library-generation-push.yaml | 2 +- .../library_generation.Dockerfile | 2 +- .../library_generation_airlock.Dockerfile | 2 +- .release-please-manifest.json | 2 +- CHANGELOG.md | 28 ++++++++++++++++ WORKSPACE | 2 +- api-common-java/pom.xml | 4 +-- coverage-report/pom.xml | 8 ++--- gapic-generator-java-bom/pom.xml | 26 +++++++-------- gapic-generator-java-pom-parent/pom.xml | 2 +- gapic-generator-java/pom.xml | 6 ++-- gax-java/README.md | 12 +++---- gax-java/dependencies.properties | 8 ++--- gax-java/gax-bom/pom.xml | 20 ++++++------ gax-java/gax-grpc/pom.xml | 4 +-- gax-java/gax-httpjson/pom.xml | 4 +-- gax-java/gax/pom.xml | 4 +-- gax-java/pom.xml | 14 ++++---- .../grpc-google-common-protos/pom.xml | 4 +-- java-common-protos/pom.xml | 10 +++--- .../proto-google-common-protos/pom.xml | 4 +-- java-core/google-cloud-core-bom/pom.xml | 10 +++--- java-core/google-cloud-core-grpc/pom.xml | 4 +-- java-core/google-cloud-core-http/pom.xml | 4 +-- java-core/google-cloud-core/pom.xml | 4 +-- java-core/pom.xml | 6 ++-- java-iam/grpc-google-iam-v1/pom.xml | 4 +-- java-iam/grpc-google-iam-v2/pom.xml | 4 +-- java-iam/grpc-google-iam-v2beta/pom.xml | 4 +-- java-iam/pom.xml | 22 ++++++------- java-iam/proto-google-iam-v1/pom.xml | 4 +-- java-iam/proto-google-iam-v2/pom.xml | 4 +-- java-iam/proto-google-iam-v2beta/pom.xml | 4 +-- java-shared-dependencies/README.md | 2 +- .../dependency-convergence-check/pom.xml | 2 +- .../first-party-dependencies/pom.xml | 10 +++--- java-shared-dependencies/pom.xml | 8 ++--- .../third-party-dependencies/pom.xml | 4 +-- .../upper-bound-check/pom.xml | 4 +-- sdk-platform-java-config/pom.xml | 4 +-- showcase/pom.xml | 2 +- versions.txt | 32 +++++++++---------- 45 files changed, 172 insertions(+), 144 deletions(-) diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml index 1f2745619a..975722ee16 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.44.0' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.14.4' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml index 9d00b91f51..1feaf0b34b 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.44.0' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.14.4' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml index 39c4c19a1e..7f39327425 100644 --- a/.cloudbuild/graalvm/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.43.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.44.0' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.14.4' steps: # GraalVM A build diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml index 1f7c9df729..b95f5833e6 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _GAPIC_GENERATOR_JAVA_VERSION: '2.53.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current} + _GAPIC_GENERATOR_JAVA_VERSION: '2.54.0' # {x-version-update:gapic-generator-java:current} _PRIVATE_IMAGE_NAME: "us-docker.pkg.dev/java-hermetic-build-prod/private-resources/java-library-generation" _PRIVATE_SHA_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:${COMMIT_SHA}" _PRIVATE_LATEST_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:latest" diff --git a/.cloudbuild/library_generation/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile index c303a78de8..0db1c56b57 100644 --- a/.cloudbuild/library_generation/library_generation.Dockerfile +++ b/.cloudbuild/library_generation/library_generation.Dockerfile @@ -20,7 +20,7 @@ FROM docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine@sha256:456f60c1643c WORKDIR /sdk-platform-java COPY . . # {x-version-update-start:gapic-generator-java:current} -ENV DOCKER_GAPIC_GENERATOR_VERSION="2.53.1-SNAPSHOT" +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.54.0" # {x-version-update-end} RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip diff --git a/.cloudbuild/library_generation/library_generation_airlock.Dockerfile b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile index b9162f977d..3fe0fb98c2 100644 --- a/.cloudbuild/library_generation/library_generation_airlock.Dockerfile +++ b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile @@ -21,7 +21,7 @@ FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/maven@sha256:d3f0 WORKDIR /sdk-platform-java COPY . . # {x-version-update-start:gapic-generator-java:current} -ENV DOCKER_GAPIC_GENERATOR_VERSION="2.53.1-SNAPSHOT" +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.54.0" # {x-version-update-end} RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fffa4507c8..5c2b1511f2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.53.0" + ".": "2.54.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e555335428..83d0a3322a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [2.54.0](https://github.com/googleapis/sdk-platform-java/compare/v2.53.0...v2.54.0) (2025-02-25) + + +### Features + +* add client side logging with slf4j ([#3403](https://github.com/googleapis/sdk-platform-java/issues/3403)) ([fe002fa](https://github.com/googleapis/sdk-platform-java/commit/fe002fab1ab65b29eeb5510d1ba1ef72fa3441b0)) + + +### Bug Fixes + +* S2A gRPC flow creates ComputeEngineCredentials via newBuilder. ([#3651](https://github.com/googleapis/sdk-platform-java/issues/3651)) ([29c061e](https://github.com/googleapis/sdk-platform-java/commit/29c061e8a18b9a416262986f11c5148ea6fec9b2)) + + +### Dependencies + +* update dependency ch.qos.logback:logback-core to v1.3.15 [security] ([#3654](https://github.com/googleapis/sdk-platform-java/issues/3654)) ([093d867](https://github.com/googleapis/sdk-platform-java/commit/093d867eb5dcdcc08ece434598f96a6dff760326)) +* update google api dependencies ([#3631](https://github.com/googleapis/sdk-platform-java/issues/3631)) ([48db2a1](https://github.com/googleapis/sdk-platform-java/commit/48db2a10e3ef46ad9ddf23378613a550172f63af)) +* update google auth library dependencies to v1.33.1 ([#3656](https://github.com/googleapis/sdk-platform-java/issues/3656)) ([f7877a5](https://github.com/googleapis/sdk-platform-java/commit/f7877a5b278d3487cb50a1e942f6ff6268121069)) +* update google http client dependencies to v1.46.3 ([#3657](https://github.com/googleapis/sdk-platform-java/issues/3657)) ([9d5b3b5](https://github.com/googleapis/sdk-platform-java/commit/9d5b3b5ae6a18fbc8445025fa9ec1abe00b7f7cc)) +* update grpc to 1.70.0 ([#3641](https://github.com/googleapis/sdk-platform-java/issues/3641)) ([ad26cf9](https://github.com/googleapis/sdk-platform-java/commit/ad26cf98548e325c99edb263baf8fe1a7696e634)) +* update grpc to 1.70.0 (missed update) ([#3658](https://github.com/googleapis/sdk-platform-java/issues/3658)) ([6ca0599](https://github.com/googleapis/sdk-platform-java/commit/6ca05994f6be40344b21befb8cdabb0766a835d0)) +* Update opentelemetry-semconv to v1.29.0-alpha ([#3635](https://github.com/googleapis/sdk-platform-java/issues/3635)) ([49ac09d](https://github.com/googleapis/sdk-platform-java/commit/49ac09d263daad8ceb2e14a623db242339880670)) + + +### Documentation + +* update showcase readme ([#3659](https://github.com/googleapis/sdk-platform-java/issues/3659)) ([0ddf073](https://github.com/googleapis/sdk-platform-java/commit/0ddf0738a8ef74f5676a3bf76c306837d14988e0)) + ## [2.53.0](https://github.com/googleapis/sdk-platform-java/compare/v2.52.0...v2.53.0) (2025-02-10) diff --git a/WORKSPACE b/WORKSPACE index 2a6449b6f7..aba5fbb7f1 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -58,7 +58,7 @@ 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.53.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current} +_gapic_generator_java_version = "2.54.0" # {x-version-update:gapic-generator-java:current} maven_install( artifacts = [ diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index 479d7f4a80..88f1bc01d4 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,14 +5,14 @@ com.google.api api-common jar - 2.44.1-SNAPSHOT + 2.45.0 API Common Common utilities for Google APIs in Java com.google.api gapic-generator-java-pom-parent - 2.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index eb06248bf3..abc4e66102 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -31,22 +31,22 @@ com.google.api gax - 2.61.1-SNAPSHOT + 2.62.0 com.google.api gax-grpc - 2.61.1-SNAPSHOT + 2.62.0 com.google.api gax-httpjson - 2.61.1-SNAPSHOT + 2.62.0 com.google.api api-common - 2.44.1-SNAPSHOT + 2.45.0 diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index 280463a887..0ef582eb2f 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.53.1-SNAPSHOT + 2.54.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.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent @@ -75,61 +75,61 @@ com.google.api api-common - 2.44.1-SNAPSHOT + 2.45.0 com.google.api gax-bom - 2.61.1-SNAPSHOT + 2.62.0 pom import com.google.api gapic-generator-java - 2.53.1-SNAPSHOT + 2.54.0 com.google.api.grpc grpc-google-common-protos - 2.52.1-SNAPSHOT + 2.53.0 com.google.api.grpc proto-google-common-protos - 2.52.1-SNAPSHOT + 2.53.0 com.google.api.grpc proto-google-iam-v1 - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc proto-google-iam-v2 - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc proto-google-iam-v2beta - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc grpc-google-iam-v1 - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc grpc-google-iam-v2 - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc grpc-google-iam-v2beta - 1.47.1-SNAPSHOT + 1.48.0 diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 36aafb4c56..1fa1a803e3 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.53.1-SNAPSHOT + 2.54.0 pom GAPIC Generator Java POM Parent https://github.com/googleapis/sdk-platform-java diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 4b08253e11..c5f652e20d 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.53.1-SNAPSHOT + 2.54.0 GAPIC Generator Java GAPIC generator Java @@ -22,7 +22,7 @@ com.google.api gapic-generator-java-pom-parent - 2.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent @@ -31,7 +31,7 @@ com.google.api gapic-generator-java-bom - 2.53.1-SNAPSHOT + 2.54.0 pom import diff --git a/gax-java/README.md b/gax-java/README.md index 3cfb4d5059..17a95656fb 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.61.0 + 2.62.0 com.google.api gax-grpc - 2.61.0 + 2.62.0 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.api:gax:2.61.0', - 'com.google.api:gax-grpc:2.61.0' +compile 'com.google.api:gax:2.62.0', + 'com.google.api:gax-grpc:2.62.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.api" % "gax" % "2.61.0" -libraryDependencies += "com.google.api" % "gax-grpc" % "2.61.0" +libraryDependencies += "com.google.api" % "gax" % "2.62.0" +libraryDependencies += "com.google.api" % "gax-grpc" % "2.62.0" ``` [//]: # ({x-version-update-end}) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 11feb50065..eb1f7e99a3 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.61.1-SNAPSHOT +version.gax=2.62.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.61.1-SNAPSHOT +version.gax_grpc=2.62.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.61.1-SNAPSHOT +version.gax_bom=2.62.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_httpjson=2.61.1-SNAPSHOT +version.gax_httpjson=2.62.0 # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 11c6229542..90ac3bcd34 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.61.1-SNAPSHOT + 2.62.0 pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -43,55 +43,55 @@ com.google.api gax - 2.61.1-SNAPSHOT + 2.62.0 com.google.api gax - 2.61.1-SNAPSHOT + 2.62.0 test-jar testlib com.google.api gax - 2.61.1-SNAPSHOT + 2.62.0 testlib com.google.api gax-grpc - 2.61.1-SNAPSHOT + 2.62.0 com.google.api gax-grpc - 2.61.1-SNAPSHOT + 2.62.0 test-jar testlib com.google.api gax-grpc - 2.61.1-SNAPSHOT + 2.62.0 testlib com.google.api gax-httpjson - 2.61.1-SNAPSHOT + 2.62.0 com.google.api gax-httpjson - 2.61.1-SNAPSHOT + 2.62.0 test-jar testlib com.google.api gax-httpjson - 2.61.1-SNAPSHOT + 2.62.0 testlib diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index cb33a3dae3..41b51fc457 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.61.1-SNAPSHOT + 2.62.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.61.1-SNAPSHOT + 2.62.0 diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index 30e1389b80..685406ba96 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.61.1-SNAPSHOT + 2.62.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.61.1-SNAPSHOT + 2.62.0 diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index 7323e6315e..b97c5b190d 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax - 2.61.1-SNAPSHOT + 2.62.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.61.1-SNAPSHOT + 2.62.0 diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 193276a45d..a28ea58f87 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,14 +4,14 @@ com.google.api gax-parent pom - 2.61.1-SNAPSHOT + 2.62.0 GAX (Google Api eXtensions) for Java (Parent) Google Api eXtensions for Java (Parent) com.google.api gapic-generator-java-pom-parent - 2.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.api api-common - 2.44.1-SNAPSHOT + 2.45.0 com.google.auth @@ -98,24 +98,24 @@ com.google.api gax - 2.61.1-SNAPSHOT + 2.62.0 com.google.api gax - 2.61.1-SNAPSHOT + 2.62.0 test-jar testlib com.google.api.grpc proto-google-common-protos - 2.52.1-SNAPSHOT + 2.53.0 com.google.api.grpc grpc-google-common-protos - 2.52.1-SNAPSHOT + 2.53.0 io.grpc diff --git a/java-common-protos/grpc-google-common-protos/pom.xml b/java-common-protos/grpc-google-common-protos/pom.xml index e996ebe3f7..409d8b086a 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.52.1-SNAPSHOT + 2.53.0 grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.52.1-SNAPSHOT + 2.53.0 diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index 37301dcd02..b471f41f94 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.52.1-SNAPSHOT + 2.53.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.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent @@ -51,7 +51,7 @@ com.google.cloud third-party-dependencies - 3.43.1-SNAPSHOT + 3.44.0 pom import @@ -65,7 +65,7 @@ com.google.api.grpc grpc-google-common-protos - 2.52.1-SNAPSHOT + 2.53.0 io.grpc @@ -77,7 +77,7 @@ com.google.api.grpc proto-google-common-protos - 2.52.1-SNAPSHOT + 2.53.0 com.google.guava diff --git a/java-common-protos/proto-google-common-protos/pom.xml b/java-common-protos/proto-google-common-protos/pom.xml index 505093f004..7b78c13c18 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.52.1-SNAPSHOT + 2.53.0 proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.52.1-SNAPSHOT + 2.53.0 diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml index 3897effd06..ef97d1b284 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.51.1-SNAPSHOT + 2.52.0 pom com.google.api gapic-generator-java-pom-parent - 2.53.1-SNAPSHOT + 2.54.0 ../../gapic-generator-java-pom-parent @@ -23,17 +23,17 @@ com.google.cloud google-cloud-core - 2.51.1-SNAPSHOT + 2.52.0 com.google.cloud google-cloud-core-grpc - 2.51.1-SNAPSHOT + 2.52.0 com.google.cloud google-cloud-core-http - 2.51.1-SNAPSHOT + 2.52.0 diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index 3825901deb..3a94658f84 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.51.1-SNAPSHOT + 2.52.0 jar Google Cloud Core gRPC @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.51.1-SNAPSHOT + 2.52.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 2c7eb9f1fa..30a4a3a649 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.51.1-SNAPSHOT + 2.52.0 jar Google Cloud Core HTTP @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.51.1-SNAPSHOT + 2.52.0 google-cloud-core-http diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index 069c499f68..3c7839b3dc 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.51.1-SNAPSHOT + 2.52.0 jar Google Cloud Core @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.51.1-SNAPSHOT + 2.52.0 google-cloud-core diff --git a/java-core/pom.xml b/java-core/pom.xml index 0a681e80a7..d3e8bf1b47 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.51.1-SNAPSHOT + 2.52.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.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent @@ -33,7 +33,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.43.1-SNAPSHOT + 3.44.0 pom import diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index 7215872a8f..0bdf397488 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.47.1-SNAPSHOT + 1.48.0 grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.47.1-SNAPSHOT + 1.48.0 diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml index 9b55bedb2c..cce2ab113e 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.47.1-SNAPSHOT + 1.48.0 grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.47.1-SNAPSHOT + 1.48.0 diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml index 33ed491c6a..265d13b970 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.47.1-SNAPSHOT + 1.48.0 grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.1-SNAPSHOT + 1.48.0 diff --git a/java-iam/pom.xml b/java-iam/pom.xml index f53c001933..621bbb2c3a 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.47.1-SNAPSHOT + 1.48.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.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.cloud third-party-dependencies - 3.43.1-SNAPSHOT + 3.44.0 pom import @@ -78,44 +78,44 @@ com.google.api gax-bom - 2.61.1-SNAPSHOT + 2.62.0 pom import com.google.api.grpc proto-google-iam-v2 - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc grpc-google-iam-v2 - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc proto-google-common-protos - 2.52.1-SNAPSHOT + 2.53.0 com.google.api.grpc proto-google-iam-v2beta - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc grpc-google-iam-v1 - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc grpc-google-iam-v2beta - 1.47.1-SNAPSHOT + 1.48.0 com.google.api.grpc proto-google-iam-v1 - 1.47.1-SNAPSHOT + 1.48.0 javax.annotation diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index f33b239f78..76c0227a07 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.47.1-SNAPSHOT + 1.48.0 proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.1-SNAPSHOT + 1.48.0 diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index 79165f484f..d907ea2802 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.47.1-SNAPSHOT + 1.48.0 proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.1-SNAPSHOT + 1.48.0 diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml index 2b3b1f2014..951b96f2ce 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.47.1-SNAPSHOT + 1.48.0 proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.47.1-SNAPSHOT + 1.48.0 diff --git a/java-shared-dependencies/README.md b/java-shared-dependencies/README.md index 6de421bf02..15968bcf2a 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.43.0 + 3.44.0 pom import diff --git a/java-shared-dependencies/dependency-convergence-check/pom.xml b/java-shared-dependencies/dependency-convergence-check/pom.xml index 485d2b121a..e5134eb830 100644 --- a/java-shared-dependencies/dependency-convergence-check/pom.xml +++ b/java-shared-dependencies/dependency-convergence-check/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud shared-dependencies-dependency-convergence-test - 3.43.1-SNAPSHOT + 3.44.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 b357768bb0..7deb2a9e69 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.43.1-SNAPSHOT + 3.44.0 Google Cloud First-party Shared Dependencies Shared first-party dependencies for Google Cloud Java libraries. @@ -33,7 +33,7 @@ com.google.api gapic-generator-java-bom - 2.53.1-SNAPSHOT + 2.54.0 pom import @@ -45,7 +45,7 @@ com.google.cloud google-cloud-core-bom - 2.51.1-SNAPSHOT + 2.52.0 pom import @@ -69,13 +69,13 @@ com.google.cloud google-cloud-core - 2.51.1-SNAPSHOT + 2.52.0 test-jar com.google.cloud google-cloud-core - 2.51.1-SNAPSHOT + 2.52.0 tests diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml index f4f756f489..b830747fcf 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.43.1-SNAPSHOT + 3.44.0 first-party-dependencies third-party-dependencies @@ -17,7 +17,7 @@ com.google.api gapic-generator-java-pom-parent - 2.53.1-SNAPSHOT + 2.54.0 ../gapic-generator-java-pom-parent @@ -31,14 +31,14 @@ com.google.cloud first-party-dependencies - 3.43.1-SNAPSHOT + 3.44.0 pom import com.google.cloud third-party-dependencies - 3.43.1-SNAPSHOT + 3.44.0 pom import diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index a04b8348be..1d11cff55a 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.43.1-SNAPSHOT + 3.44.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.53.1-SNAPSHOT + 2.54.0 ../../gapic-generator-java-pom-parent diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index 9b51088799..9a83c94e69 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.43.1-SNAPSHOT + 3.44.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 @@ -30,7 +30,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.43.1-SNAPSHOT + 3.44.0 pom import diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index bf56be4f33..71204635d5 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.43.1-SNAPSHOT + 3.44.0 SDK Platform For Java Configurations Shared build configuration for Google Cloud Java libraries. @@ -17,6 +17,6 @@ - 3.43.1-SNAPSHOT + 3.44.0 \ No newline at end of file diff --git a/showcase/pom.xml b/showcase/pom.xml index b4268e3b8b..98830421cd 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -34,7 +34,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.43.1-SNAPSHOT + 3.44.0 pom import diff --git a/versions.txt b/versions.txt index bafc3eee6c..b4eb861b60 100644 --- a/versions.txt +++ b/versions.txt @@ -1,19 +1,19 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.53.0:2.53.1-SNAPSHOT -api-common:2.44.0:2.44.1-SNAPSHOT -gax:2.61.0:2.61.1-SNAPSHOT -gax-grpc:2.61.0:2.61.1-SNAPSHOT -gax-httpjson:0.146.0:0.146.1-SNAPSHOT -proto-google-common-protos:2.52.0:2.52.1-SNAPSHOT -grpc-google-common-protos:2.52.0:2.52.1-SNAPSHOT -proto-google-iam-v1:1.47.0:1.47.1-SNAPSHOT -grpc-google-iam-v1:1.47.0:1.47.1-SNAPSHOT -proto-google-iam-v2beta:1.47.0:1.47.1-SNAPSHOT -grpc-google-iam-v2beta:1.47.0:1.47.1-SNAPSHOT -google-iam-policy:1.47.0:1.47.1-SNAPSHOT -proto-google-iam-v2:1.47.0:1.47.1-SNAPSHOT -grpc-google-iam-v2:1.47.0:1.47.1-SNAPSHOT -google-cloud-core:2.51.0:2.51.1-SNAPSHOT -google-cloud-shared-dependencies:3.43.0:3.43.1-SNAPSHOT +gapic-generator-java:2.54.0:2.54.0 +api-common:2.45.0:2.45.0 +gax:2.62.0:2.62.0 +gax-grpc:2.62.0:2.62.0 +gax-httpjson:0.147.0:0.147.0 +proto-google-common-protos:2.53.0:2.53.0 +grpc-google-common-protos:2.53.0:2.53.0 +proto-google-iam-v1:1.48.0:1.48.0 +grpc-google-iam-v1:1.48.0:1.48.0 +proto-google-iam-v2beta:1.48.0:1.48.0 +grpc-google-iam-v2beta:1.48.0:1.48.0 +google-iam-policy:1.48.0:1.48.0 +proto-google-iam-v2:1.48.0:1.48.0 +grpc-google-iam-v2:1.48.0:1.48.0 +google-cloud-core:2.52.0:2.52.0 +google-cloud-shared-dependencies:3.44.0:3.44.0