diff --git a/.cloudbuild/cloudbuild-test-a.yaml b/.cloudbuild/cloudbuild-test-a.yaml index 4b58ee5ea7..6be1ab2a77 100644 --- a/.cloudbuild/cloudbuild-test-a.yaml +++ b/.cloudbuild/cloudbuild-test-a.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.22.0' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.23.0' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.1' steps: diff --git a/.cloudbuild/cloudbuild-test-b.yaml b/.cloudbuild/cloudbuild-test-b.yaml index 9a0bd12edb..ce809694e1 100644 --- a/.cloudbuild/cloudbuild-test-b.yaml +++ b/.cloudbuild/cloudbuild-test-b.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.22.0' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.23.0' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.1' steps: diff --git a/.cloudbuild/cloudbuild.yaml b/.cloudbuild/cloudbuild.yaml index bbe4e2c671..24f823d83a 100644 --- a/.cloudbuild/cloudbuild.yaml +++ b/.cloudbuild/cloudbuild.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.22.0' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.23.0' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.1' steps: # GraalVM A build diff --git a/.github/workflows/create_additional_release_tag.yaml b/.github/workflows/create_additional_release_tag.yaml index 26079cfc0a..892a821788 100644 --- a/.github/workflows/create_additional_release_tag.yaml +++ b/.github/workflows/create_additional_release_tag.yaml @@ -39,5 +39,7 @@ jobs: # update the version. CHECK_LATEST_TAG="unmanaged-dependencies-check-latest" git tag ${CHECK_LATEST_TAG} - git push origin -f ${CHECK_LATEST_TAG} + # delete the tag in remote repo and push again. + git push --delete origin ${CHECK_LATEST_TAG} + git push origin ${CHECK_LATEST_TAG} diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml new file mode 100644 index 0000000000..236beaf99d --- /dev/null +++ b/.github/workflows/renovate_config_check.yaml @@ -0,0 +1,25 @@ +name: Renovate Bot Config Validation + +on: + pull_request: + paths: + - 'renovate.json' + +jobs: + config_validation: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install Renovate and Config Validator + run: | + npm install -g npm@latest + npm install --global renovate + renovate-config-validator \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 527d2e30b0..7ef8288ed5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.32.0" + ".": "2.33.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f120b6498a..53c1ed7304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.33.0](https://github.com/googleapis/sdk-platform-java/compare/v2.32.0...v2.33.0) (2024-01-24) + + +### Features + +* Introduce interfaces for metrics instrumentation ([#2403](https://github.com/googleapis/sdk-platform-java/issues/2403)) ([3c61b14](https://github.com/googleapis/sdk-platform-java/commit/3c61b14fef87c735ea2ed382f8510b29176a4279)) + + +### Bug Fixes + +* Verify Universe Domain's DirectPath Compatibility after Endpoint Resolution ([#2412](https://github.com/googleapis/sdk-platform-java/issues/2412)) ([e2de93b](https://github.com/googleapis/sdk-platform-java/commit/e2de93bb7051039e8a96128b9eacc0f2ea3a1205)) + ## [2.32.0](https://github.com/googleapis/sdk-platform-java/compare/v2.31.0...v2.32.0) (2024-01-19) diff --git a/WORKSPACE b/WORKSPACE index 4644bdf52c..df66454427 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -60,7 +60,7 @@ maven_install( repositories = ["https://repo.maven.apache.org/maven2/"], ) -_gapic_generator_java_version = "2.32.0" # {x-version-update:gapic-generator-java:current} +_gapic_generator_java_version = "2.33.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 922fb760bc..559e4bc7b3 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,14 +5,14 @@ com.google.api api-common jar - 2.23.0 + 2.24.0 API Common Common utilities for Google APIs in Java com.google.api gapic-generator-java-pom-parent - 2.32.0 + 2.33.0 ../gapic-generator-java-pom-parent diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 5ae5501e86..4536cb6cce 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -31,22 +31,22 @@ com.google.api gax - 2.40.0 + 2.41.0 com.google.api gax-grpc - 2.40.0 + 2.41.0 com.google.api gax-httpjson - 2.40.0 + 2.41.0 com.google.api api-common - 2.23.0 + 2.24.0 diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index 0bcd27407c..5f4c620562 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.32.0 + 2.33.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.32.0 + 2.33.0 ../gapic-generator-java-pom-parent @@ -75,61 +75,61 @@ com.google.api api-common - 2.23.0 + 2.24.0 com.google.api gax-bom - 2.40.0 + 2.41.0 pom import com.google.api gapic-generator-java - 2.32.0 + 2.33.0 com.google.api.grpc grpc-google-common-protos - 2.31.0 + 2.32.0 com.google.api.grpc proto-google-common-protos - 2.31.0 + 2.32.0 com.google.api.grpc proto-google-iam-v1 - 1.26.0 + 1.27.0 com.google.api.grpc proto-google-iam-v2 - 1.26.0 + 1.27.0 com.google.api.grpc proto-google-iam-v2beta - 1.26.0 + 1.27.0 com.google.api.grpc grpc-google-iam-v1 - 1.26.0 + 1.27.0 com.google.api.grpc grpc-google-iam-v2 - 1.26.0 + 1.27.0 com.google.api.grpc grpc-google-iam-v2beta - 1.26.0 + 1.27.0 diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 61f9beca85..7e120c3f3b 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.32.0 + 2.33.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 a6ab6195ff..7800c7fc16 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.32.0 + 2.33.0 GAPIC Generator Java GAPIC generator Java @@ -22,7 +22,7 @@ com.google.api gapic-generator-java-pom-parent - 2.32.0 + 2.33.0 ../gapic-generator-java-pom-parent @@ -31,7 +31,7 @@ com.google.api gapic-generator-java-bom - 2.32.0 + 2.33.0 pom import diff --git a/gax-java/README.md b/gax-java/README.md index 2ca6eb9224..cb8d3bb116 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.40.0 + 2.41.0 com.google.api gax-grpc - 2.40.0 + 2.41.0 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.api:gax:2.40.0', - 'com.google.api:gax-grpc:2.40.0' +compile 'com.google.api:gax:2.41.0', + 'com.google.api:gax-grpc:2.41.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.api" % "gax" % "2.40.0" -libraryDependencies += "com.google.api" % "gax-grpc" % "2.40.0" +libraryDependencies += "com.google.api" % "gax" % "2.41.0" +libraryDependencies += "com.google.api" % "gax-grpc" % "2.41.0" ``` [//]: # ({x-version-update-end}) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 0a182f46af..fdf72a7dde 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.40.0 +version.gax=2.41.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.40.0 +version.gax_grpc=2.41.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.40.0 +version.gax_bom=2.41.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_httpjson=2.40.0 +version.gax_httpjson=2.41.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 6ace1fdd59..aa7a444187 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.40.0 + 2.41.0 pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -43,55 +43,55 @@ com.google.api gax - 2.40.0 + 2.41.0 com.google.api gax - 2.40.0 + 2.41.0 test-jar testlib com.google.api gax - 2.40.0 + 2.41.0 testlib com.google.api gax-grpc - 2.40.0 + 2.41.0 com.google.api gax-grpc - 2.40.0 + 2.41.0 test-jar testlib com.google.api gax-grpc - 2.40.0 + 2.41.0 testlib com.google.api gax-httpjson - 2.40.0 + 2.41.0 com.google.api gax-httpjson - 2.40.0 + 2.41.0 test-jar testlib com.google.api gax-httpjson - 2.40.0 + 2.41.0 testlib diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index 9b94517701..b26a6daffa 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.40.0 + 2.41.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.40.0 + 2.41.0 diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java index 823d8c56b7..886beda4ec 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java @@ -77,7 +77,9 @@ public final class GrpcCallContext implements ApiCallContext { private static final GrpcStatusCode UNAUTHENTICATED_STATUS_CODE = GrpcStatusCode.of(Status.Code.UNAUTHENTICATED); - static final CallOptions.Key TRACER_KEY = CallOptions.Key.create("gax.tracer"); + // This field is made public for handwritten libraries to easily access the tracer from + // CallOptions + public static final CallOptions.Key TRACER_KEY = CallOptions.Key.create("gax.tracer"); private final Channel channel; @Nullable private final Credentials credentials; 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 51d1ee5802..280f9cf78e 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 @@ -295,10 +295,6 @@ private void logDirectPathMisconfig() { Level.WARNING, "DirectPath is misconfigured. DirectPath is only available in a GCE environment."); } - if (!canUseDirectPathWithUniverseDomain()) { - LOG.log( - Level.WARNING, "DirectPath will only work in the the googleapis.com Universe Domain"); - } } } } @@ -334,8 +330,10 @@ static boolean isOnComputeEngine() { return false; } - private boolean canUseDirectPathWithUniverseDomain() { - return endpoint.contains("googleapis.com"); + // Universe Domain configuration is currently only supported in the GDU + @VisibleForTesting + boolean canUseDirectPathWithUniverseDomain() { + return endpoint.contains(Credentials.GOOGLE_DEFAULT_UNIVERSE); } @VisibleForTesting diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java index 537a3c5176..f6fb9d00ac 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java @@ -292,6 +292,28 @@ public void testDirectPathDisallowNullCredentials() throws IOException { assertThat(provider.isCredentialDirectPathCompatible()).isFalse(); } + @Test + public void testDirectPathWithGDUEndpoint() { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPath(true) + .setAttemptDirectPathXds() + .setEndpoint("test.googleapis.com:443") + .build(); + assertThat(provider.canUseDirectPathWithUniverseDomain()).isTrue(); + } + + @Test + public void testDirectPathWithNonGDUEndpoint() { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPath(true) + .setAttemptDirectPathXds() + .setEndpoint("test.random.com:443") + .build(); + assertThat(provider.canUseDirectPathWithUniverseDomain()).isFalse(); + } + @Test public void testDirectPathXdsEnabled() throws IOException { InstantiatingGrpcChannelProvider provider = @@ -565,22 +587,6 @@ public void testLogDirectPathMisconfigNotOnGCE() { InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); } - @Test - public void testLogDirectPathMisconfigNotInGDU() { - FakeLogHandler logHandler = new FakeLogHandler(); - InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder() - .setAttemptDirectPathXds() - .setAttemptDirectPath(true) - .setAllowNonDefaultServiceAccount(true) - .setEndpoint("test.random.endpoint.com:443") - .build(); - assertThat(logHandler.getAllMessages()) - .contains("DirectPath will only work in the the googleapis.com Universe Domain"); - InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); - } - private static class FakeLogHandler extends Handler { List records = new ArrayList<>(); diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index e67b825ae7..b37d2332b9 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.40.0 + 2.41.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.40.0 + 2.41.0 diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index 1ca211cb73..f860ed0efa 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax - 2.40.0 + 2.41.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.40.0 + 2.41.0 diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java index 3176be4b92..6143772bac 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java @@ -49,19 +49,23 @@ public interface ApiTracer { * between clients using gax and external resources to share the same implementation of the * tracing. For example OpenCensus will install a thread local that can read by the GRPC. */ - Scope inScope(); + default Scope inScope() { + return () -> { + // noop + }; + }; /** * Signals that the overall operation has finished successfully. The tracer is now considered * closed and should no longer be used. */ - void operationSucceeded(); + default void operationSucceeded() {}; /** * Signals that the operation was cancelled by the user. The tracer is now considered closed and * should no longer be used. */ - void operationCancelled(); + default void operationCancelled() {}; /** * Signals that the overall operation has failed and no further attempts will be made. The tracer @@ -69,14 +73,14 @@ public interface ApiTracer { * * @param error the final error that caused the operation to fail. */ - void operationFailed(Throwable error); + default void operationFailed(Throwable error) {}; /** * Annotates the operation with selected connection id from the {@code ChannelPool}. * * @param id the local connection identifier of the selected connection. */ - void connectionSelected(String id); + default void connectionSelected(String id) {}; /** * Adds an annotation that an attempt is about to start. In general this should occur at the very @@ -86,7 +90,7 @@ public interface ApiTracer { * @deprecated Please use {@link #attemptStarted(Object, int)} instead. */ @Deprecated - void attemptStarted(int attemptNumber); + default void attemptStarted(int attemptNumber) {}; /** * Adds an annotation that an attempt is about to start with additional information from the @@ -96,13 +100,13 @@ public interface ApiTracer { * @param attemptNumber the zero based sequential attempt number. * @param request request of this attempt. */ - void attemptStarted(Object request, int attemptNumber); + default void attemptStarted(Object request, int attemptNumber) {}; /** Adds an annotation that the attempt succeeded. */ - void attemptSucceeded(); + default void attemptSucceeded() {}; /** Add an annotation that the attempt was cancelled by the user. */ - void attemptCancelled(); + default void attemptCancelled() {}; /** * Adds an annotation that the attempt failed, but another attempt will be made after the delay. @@ -110,7 +114,7 @@ public interface ApiTracer { * @param error the transient error that caused the attempt to fail. * @param delay the amount of time to wait before the next attempt will start. */ - void attemptFailed(Throwable error, Duration delay); + default void attemptFailed(Throwable error, Duration delay) {}; /** * Adds an annotation that the attempt failed and that no further attempts will be made because @@ -118,7 +122,7 @@ public interface ApiTracer { * * @param error the last error received before retries were exhausted. */ - void attemptFailedRetriesExhausted(Throwable error); + default void attemptFailedRetriesExhausted(Throwable error) {}; /** * Adds an annotation that the attempt failed and that no further attempts will be made because @@ -126,26 +130,26 @@ public interface ApiTracer { * * @param error the error that caused the final attempt to fail. */ - void attemptPermanentFailure(Throwable error); + default void attemptPermanentFailure(Throwable error) {}; /** * Signals that the initial RPC for the long running operation failed. * * @param error the error that caused the long running operation fail. */ - void lroStartFailed(Throwable error); + default void lroStartFailed(Throwable error) {}; /** * Signals that the initial RPC successfully started the long running operation. The long running * operation will now be polled for completion. */ - void lroStartSucceeded(); + default void lroStartSucceeded() {}; /** Adds an annotation that a streaming response has been received. */ - void responseReceived(); + default void responseReceived() {}; /** Adds an annotation that a streaming request has been sent. */ - void requestSent(); + default void requestSent() {}; /** * Adds an annotation that a batch of writes has been flushed. @@ -153,7 +157,7 @@ public interface ApiTracer { * @param elementCount the number of elements in the batch. * @param requestSize the size of the batch in bytes. */ - void batchRequestSent(long elementCount, long requestSize); + default void batchRequestSent(long elementCount, long requestSize) {}; /** * A context class to be used with {@link #inScope()} and a try-with-resources block. Closing a diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java index 538708b879..1e542f124d 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java @@ -33,7 +33,10 @@ import org.threeten.bp.Duration; /** - * A base implementation of {@link ApiTracer} that does nothing. + * A base implementation of {@link ApiTracer} that does nothing. With the deprecation of Java 7 + * support, all the methods in {@link ApiTracer} are now made default, we no longer need a base + * class that does nothing. This class should be removed once all the references to it are removed + * in Google Cloud Client Libraries. * *

For internal use only. */ diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MethodName.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MethodName.java new file mode 100644 index 0000000000..1581c0ed38 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MethodName.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024 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.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.StubSettings; +import com.google.auto.value.AutoValue; + +/** A value class to represent the name of the RPC method in an {@link ApiTracer}. */ +@BetaApi +@InternalApi +@AutoValue +public abstract class MethodName { + /** + * Creates a new instance of the RPC method name. + * + * @param serviceName The name of the service. In general this will be GAPIC generated service + * name {@link StubSettings#getServiceName()}. However, in some cases, when the GAPIC + * generated service is wrapped, this will be overridden to specify the manually written + * wrapper's name. + * @param methodName The name of the logical operation being traced. + */ + public static MethodName of(String serviceName, String methodName) { + return new AutoValue_MethodName(serviceName, methodName); + } + + /** The name of the service. ie BigtableData */ + public abstract String getServiceName(); + + /** The name of the logical operation being traced. ie. ReadRows. */ + public abstract String getMethodName(); + + @Override + public String toString() { + return getServiceName() + "." + getMethodName(); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsRecorder.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsRecorder.java new file mode 100644 index 0000000000..d2e221fb5b --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsRecorder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 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.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import java.util.Map; + +/** + * Provides an interface for metrics recording. The implementer is expected to use an observability + * framework, e.g. OpenTelemetry. There should be only one instance of MetricsRecorder per client, + * all the methods in this class are expected to be called from multiple threads, hence the + * implementation must be thread safe. + */ +@BetaApi +@InternalApi +public interface MetricsRecorder { + + /** Records the latency of an RPC attempt */ + default void recordAttemptLatency(double attemptLatency, Map attributes) {} + + /** Records the count of RPC attempts */ + default void recordAttemptCount(long count, Map attributes) {} + + /** + * Records the total end-to-end latency for an operation, including the initial RPC attempts and + * subsequent retries. + */ + default void recordOperationLatency(double operationLatency, Map attributes) {} + + /** Records the count of operations */ + default void recordOperationCount(long count, Map attributes) {} +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java new file mode 100644 index 0000000000..bf5dbdd046 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; + +/** + * This class computes generic metrics that can be observed in the lifecycle of an RPC operation. + * The responsibility of recording metrics should delegate to {@link MetricsRecorder}, hence this + * class should not have any knowledge about the observability framework used for metrics recording. + */ +@BetaApi +@InternalApi +public class MetricsTracer implements ApiTracer { + + public MetricsTracer(MethodName methodName, MetricsRecorder metricsRecorder) {} + + /** + * Add attributes that will be attached to all metrics. This is expected to be called by + * handwritten client teams to add additional attributes that are not supposed be collected by + * Gax. + */ + public void addAttributes(String key, String value) {}; +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracerFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracerFactory.java new file mode 100644 index 0000000000..d2b8d87fb4 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracerFactory.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; + +/** + * A {@link ApiTracerFactory} to build instances of {@link MetricsTracer}. + * + *

This class wraps the {@link MetricsRecorder} and pass it to {@link MetricsTracer}. It will be + * used to record metrics in {@link MetricsTracer}. + * + *

This class is expected to be initialized once during client initialization. + */ +@BetaApi +@InternalApi +public class MetricsTracerFactory implements ApiTracerFactory { + protected MetricsRecorder metricsRecorder; + + public MetricsTracerFactory(MetricsRecorder metricsRecorder) { + this.metricsRecorder = metricsRecorder; + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + return new MetricsTracer( + MethodName.of(spanName.getClientName(), spanName.getMethodName()), metricsRecorder); + } +} diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 5be9144aff..f231ab56ff 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,14 +4,14 @@ com.google.api gax-parent pom - 2.40.0 + 2.41.0 GAX (Google Api eXtensions) for Java (Parent) Google Api eXtensions for Java (Parent) com.google.api gapic-generator-java-pom-parent - 2.32.0 + 2.33.0 ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.api api-common - 2.23.0 + 2.24.0 com.google.auth @@ -108,24 +108,24 @@ com.google.api gax - 2.40.0 + 2.41.0 com.google.api gax - 2.40.0 + 2.41.0 test-jar testlib com.google.api.grpc proto-google-common-protos - 2.31.0 + 2.32.0 com.google.api.grpc grpc-google-common-protos - 2.31.0 + 2.32.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 3a21dbb1a4..05b056bb71 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.31.0 + 2.32.0 grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.31.0 + 2.32.0 diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index caf3b6be40..619ef36cc3 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.31.0 + 2.32.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.32.0 + 2.33.0 ../gapic-generator-java-pom-parent @@ -61,7 +61,7 @@ com.google.cloud third-party-dependencies - 3.22.0 + 3.23.0 pom import @@ -75,7 +75,7 @@ com.google.api.grpc grpc-google-common-protos - 2.31.0 + 2.32.0 io.grpc @@ -87,7 +87,7 @@ com.google.api.grpc proto-google-common-protos - 2.31.0 + 2.32.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 9708d82e47..079d2f967e 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.31.0 + 2.32.0 proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.31.0 + 2.32.0 diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml index a74fc689f8..c8a194cf00 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.30.0 + 2.31.0 pom com.google.api gapic-generator-java-pom-parent - 2.32.0 + 2.33.0 ../../gapic-generator-java-pom-parent @@ -23,17 +23,17 @@ com.google.cloud google-cloud-core - 2.30.0 + 2.31.0 com.google.cloud google-cloud-core-grpc - 2.30.0 + 2.31.0 com.google.cloud google-cloud-core-http - 2.30.0 + 2.31.0 diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index 85b9fd0fb3..770b7fd4f0 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.30.0 + 2.31.0 jar Google Cloud Core gRPC @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.30.0 + 2.31.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 5450481d59..208c3fd751 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.30.0 + 2.31.0 jar Google Cloud Core HTTP @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.30.0 + 2.31.0 google-cloud-core-http diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index b57ea039ab..5ba16329cb 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.30.0 + 2.31.0 jar Google Cloud Core @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.30.0 + 2.31.0 google-cloud-core diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java index 16879b8914..9384e7823d 100644 --- a/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java @@ -40,6 +40,8 @@ import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.NoHeaderProvider; +import com.google.api.gax.tracing.ApiTracer; +import com.google.api.gax.tracing.ApiTracerFactory; import com.google.auth.Credentials; import com.google.auth.oauth2.GoogleCredentials; import com.google.auth.oauth2.QuotaProjectIdProvider; @@ -110,6 +112,8 @@ public abstract class ServiceOptions< private transient ServiceT service; private transient ServiceRpc rpc; + private final ApiTracerFactory apiTracerFactory; + /** * Builder for {@code ServiceOptions}. * @@ -137,6 +141,8 @@ public abstract static class Builder< private String clientLibToken = ServiceOptions.getGoogApiClientLibName(); private String quotaProjectId; + private ApiTracerFactory apiTracerFactory; + @InternalApi("This class should only be extended within google-cloud-java") protected Builder() {} @@ -153,6 +159,7 @@ protected Builder(ServiceOptions options) { transportOptions = options.transportOptions; clientLibToken = options.clientLibToken; quotaProjectId = options.quotaProjectId; + apiTracerFactory = options.apiTracerFactory; } protected abstract ServiceOptions build(); @@ -306,6 +313,17 @@ public B setQuotaProjectId(String quotaProjectId) { return self(); } + /** + * Sets the {@link ApiTracerFactory}. It will be used to create an {@link ApiTracer} that is + * annotated throughout the lifecycle of an RPC operation. + */ + @BetaApi + @InternalApi + public B setApiTracerFactory(ApiTracerFactory apiTracerFactory) { + this.apiTracerFactory = apiTracerFactory; + return self(); + } + protected Set getAllowedClientLibTokens() { return allowedClientLibTokens; } @@ -347,6 +365,7 @@ protected ServiceOptions( builder.quotaProjectId != null ? builder.quotaProjectId : getValueFromCredentialsFile(getCredentialsPath(), "quota_project_id"); + apiTracerFactory = builder.apiTracerFactory; } private static String getCredentialsPath() { @@ -692,6 +711,10 @@ public String getLibraryVersion() { return GaxProperties.getLibraryVersion(this.getClass()); } + public ApiTracerFactory getApiTracerFactory() { + return apiTracerFactory; + } + @InternalApi public final HeaderProvider getMergedHeaderProvider(HeaderProvider internalHeaderProvider) { Map mergedHeaders = diff --git a/java-core/pom.xml b/java-core/pom.xml index e0714c7208..b5fcb73fab 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.30.0 + 2.31.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.32.0 + 2.33.0 ../gapic-generator-java-pom-parent @@ -33,7 +33,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.22.0 + 3.23.0 pom import diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index 10cd0fbf00..a025459d58 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.26.0 + 1.27.0 grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.26.0 + 1.27.0 diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml index 0d9b59336a..93568d5461 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.26.0 + 1.27.0 grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.26.0 + 1.27.0 diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml index 23339b5d83..cb18fb506c 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.26.0 + 1.27.0 grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.26.0 + 1.27.0 diff --git a/java-iam/pom.xml b/java-iam/pom.xml index 28d8a67f6b..6ae2d81703 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.26.0 + 1.27.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.32.0 + 2.33.0 ../gapic-generator-java-pom-parent @@ -60,7 +60,7 @@ com.google.cloud third-party-dependencies - 3.22.0 + 3.23.0 pom import @@ -88,44 +88,44 @@ com.google.api gax-bom - 2.40.0 + 2.41.0 pom import com.google.api.grpc proto-google-iam-v2 - 1.26.0 + 1.27.0 com.google.api.grpc grpc-google-iam-v2 - 1.26.0 + 1.27.0 com.google.api.grpc proto-google-common-protos - 2.31.0 + 2.32.0 com.google.api.grpc proto-google-iam-v2beta - 1.26.0 + 1.27.0 com.google.api.grpc grpc-google-iam-v1 - 1.26.0 + 1.27.0 com.google.api.grpc grpc-google-iam-v2beta - 1.26.0 + 1.27.0 com.google.api.grpc proto-google-iam-v1 - 1.26.0 + 1.27.0 javax.annotation diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index 633cba8ca4..d0478f1822 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.26.0 + 1.27.0 proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.26.0 + 1.27.0 diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index 51b3526143..6833e52126 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.26.0 + 1.27.0 proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.26.0 + 1.27.0 diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml index 9d770aa90e..5e50ec088a 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.26.0 + 1.27.0 proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.26.0 + 1.27.0 diff --git a/java-shared-dependencies/README.md b/java-shared-dependencies/README.md index 38cbdcb595..365048a0ef 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.22.0 + 3.23.0 pom import diff --git a/java-shared-dependencies/dependency-convergence-check/pom.xml b/java-shared-dependencies/dependency-convergence-check/pom.xml index ac8b470a3f..52597acdbd 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.22.0 + 3.23.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 36ba482f34..692f3d6475 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.22.0 + 3.23.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.32.0 + 2.33.0 pom import @@ -45,7 +45,7 @@ com.google.cloud google-cloud-core-bom - 2.30.0 + 2.31.0 pom import @@ -69,13 +69,13 @@ com.google.cloud google-cloud-core - 2.30.0 + 2.31.0 test-jar com.google.cloud google-cloud-core - 2.30.0 + 2.31.0 tests diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml index 301311d0c6..c2a16945a9 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.22.0 + 3.23.0 first-party-dependencies third-party-dependencies @@ -17,7 +17,7 @@ com.google.api gapic-generator-java-pom-parent - 2.32.0 + 2.33.0 ../gapic-generator-java-pom-parent @@ -31,14 +31,14 @@ com.google.cloud first-party-dependencies - 3.22.0 + 3.23.0 pom import com.google.cloud third-party-dependencies - 3.22.0 + 3.23.0 pom import diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index d7429f9da1..a0b8459860 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.22.0 + 3.23.0 Google Cloud Third-party Shared Dependencies Shared third-party dependencies for Google Cloud Java libraries. diff --git a/java-shared-dependencies/unmanaged-dependency-check/action.yaml b/java-shared-dependencies/unmanaged-dependency-check/action.yaml index e8988d3be1..06c7378b94 100644 --- a/java-shared-dependencies/unmanaged-dependency-check/action.yaml +++ b/java-shared-dependencies/unmanaged-dependency-check/action.yaml @@ -37,7 +37,7 @@ unmanaged_dependencies=$(mvn exec:java -Dexec.args="../pom.xml ${bom_absolute_path}" -q) if [[ "${unmanaged_dependencies}" != "[]" ]]; then echo "This pull request seems to add new third-party dependency, ${unmanaged_dependencies}, among the artifacts listed in ${{ inputs.bom-path }}." - echo "Please see go/cloud-sdk-java-dependency-governance." + echo "Please see go/cloud-sdk-java-dependencies." exit 1 fi diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java b/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java index b86722a66f..832745b346 100644 --- a/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java +++ b/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java @@ -19,13 +19,17 @@ */ public class UnmanagedDependencyCheck { // Regex of handwritten artifacts. - // There are customized artifacts defined in some handwritten libraries, e.g., firestore and - // datastore, add entries in regex to exclude these artifacts. + // There are customized artifacts defined in gapic-bom and handwritten libraries, + // e.g., firestore and datastore, add entries in regex to exclude these artifacts. private final static String downstreamArtifact = "(com.google.cloud:google-.*)|" - + "(com.google.api.grpc:(grpc|proto)-google-.*)|" + + "(com.google.api.grpc:(gapic|grpc|proto)-google-.*)|" + "(com.google.cloud:proto-google-cloud-firestore-bundle-.*)|" - + "(com.google.cloud.datastore:datastore-.*-proto-client)"; + + "(com.google.cloud.datastore:datastore-.*-proto-client)|" + + "(com.google.analytics:google-analytics-.*)|" + + "(com.google.apis:google-api-.*)|" + + "(com.google.area120:google-area120-.*)|" + + "(io.grafeas:grafeas)"; /** * @param args An array with two elements.

The first string is the path of Java shared @@ -70,7 +74,7 @@ private static Set getManagedDependenciesFromBom(Bom bom) throws InvalidVersionSpecificationException { Set res = new HashSet<>(); new ClassPathBuilder() - .resolve(bom.getManagedDependencies(), true, DependencyMediation.MAVEN) + .resolve(bom.getManagedDependencies(), false, DependencyMediation.MAVEN) .getClassPath() .forEach( classPath -> { diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java b/java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java index cac88ae426..384db40e0b 100644 --- a/java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java @@ -13,18 +13,18 @@ public class UnmanagedDependencyCheckTest { @Test public void getUnmanagedDependencyFromSamePomTest() throws MavenRepositoryException, InvalidVersionSpecificationException { - String sharedDependenciesBom = "src/test/resources/shared-dependency-3.18.0-pom.xml"; + String sharedDependenciesBom = "src/test/resources/shared-dependency-pom.xml"; List unManagedDependencies = UnmanagedDependencyCheck.getUnmanagedDependencies(sharedDependenciesBom, sharedDependenciesBom); assertTrue(unManagedDependencies.isEmpty()); } @Test - public void getUnmanagedDependencyFromHWBomTest() + public void getUnmanagedDependencyFromGapicAndHandwrittenBomTest() throws MavenRepositoryException, InvalidVersionSpecificationException { List unManagedDependencies = UnmanagedDependencyCheck.getUnmanagedDependencies( - "src/test/resources/shared-dependency-3.18.0-pom.xml", + "src/test/resources/shared-dependency-pom.xml", "src/test/resources/google-internal-artifact-test-case-pom.xml"); assertTrue(unManagedDependencies.isEmpty()); } @@ -34,7 +34,7 @@ public void getUnmanagedDependencyFromNestedPomTest() throws MavenRepositoryException, InvalidVersionSpecificationException { List unManagedDependencies = UnmanagedDependencyCheck.getUnmanagedDependencies( - "src/test/resources/shared-dependency-3.18.0-pom.xml", "src/test/resources/transitive-dependency-pom.xml"); + "src/test/resources/shared-dependency-pom.xml", "src/test/resources/transitive-dependency-pom.xml"); assertThat(unManagedDependencies) .containsAtLeastElementsIn(ImmutableList.of("com.h2database:h2")); // test dependency should be ignored. diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/google-internal-artifact-test-case-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/google-internal-artifact-test-case-pom.xml index 668976848c..f5342f5ee0 100644 --- a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/google-internal-artifact-test-case-pom.xml +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/google-internal-artifact-test-case-pom.xml @@ -36,7 +36,7 @@ com.google.cloud google-cloud-datastore-bom - 2.17.4 + 2.18.1 import pom @@ -44,14 +44,21 @@ com.google.cloud google-cloud-firestore-bom - 3.15.2 + 3.16.0 import pom com.google.cloud google-cloud-bigtable-bom - 2.29.0 + 2.31.0 + import + pom + + + com.google.cloud + gapic-libraries-bom + 1.27.0 import pom diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh index 09f0c77931..1e1c0aab36 100755 --- a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -mvn install -f shared-dependency-3.18.0-pom.xml +mvn install -f shared-dependency-pom.xml mvn install -f gax-example-pom.xml mvn install -f nested-dependency-pom.xml mvn install -f transitive-dependency-pom.xml diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-3.18.0-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-3.18.0-pom.xml deleted file mode 100644 index d716ab7738..0000000000 --- a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-3.18.0-pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-shared-dependencies - pom - 3.18.0 - - first-party-dependencies - third-party-dependencies - - Google Cloud Shared Dependencies - - Shared build configuration for Google Cloud Java libraries. - - - - com.google.api - gapic-generator-java-pom-parent - 2.28.0 - ../gapic-generator-java-pom-parent - - - - UTF-8 - ${project.artifactId} - - - - - - com.google.cloud - first-party-dependencies - 3.18.0 - pom - import - - - com.google.cloud - third-party-dependencies - 3.18.0 - pom - import - - - - diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-pom.xml new file mode 100644 index 0000000000..325fd0df0f --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + com.example + google-cloud-shared-dependencies-test + pom + 0.0.1-SNAPSHOT + Google Cloud Shared Dependencies + + Shared build configuration for Google Cloud Java libraries in Tests. + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.22.0 + pom + import + + + + diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index 0fcb62ccf7..924257a59d 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.22.0 + 3.23.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.22.0 + 3.23.0 pom import diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index c578afd774..36cecbd7e1 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.22.0 + 3.23.0 SDK Platform For Java Configurations Shared build configuration for Google Cloud Java libraries. @@ -17,6 +17,6 @@ - 3.22.0 + 3.23.0 \ No newline at end of file diff --git a/showcase/pom.xml b/showcase/pom.xml index f87437a441..92d7e20251 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -34,7 +34,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.22.0 + 3.23.0 pom import diff --git a/versions.txt b/versions.txt index bd20e58062..2347e0ff49 100644 --- a/versions.txt +++ b/versions.txt @@ -1,19 +1,19 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.32.0:2.32.0 -api-common:2.23.0:2.23.0 -gax:2.40.0:2.40.0 -gax-grpc:2.40.0:2.40.0 -gax-httpjson:0.125.0:0.125.0 -proto-google-common-protos:2.31.0:2.31.0 -grpc-google-common-protos:2.31.0:2.31.0 -proto-google-iam-v1:1.26.0:1.26.0 -grpc-google-iam-v1:1.26.0:1.26.0 -proto-google-iam-v2beta:1.26.0:1.26.0 -grpc-google-iam-v2beta:1.26.0:1.26.0 -google-iam-policy:1.26.0:1.26.0 -proto-google-iam-v2:1.26.0:1.26.0 -grpc-google-iam-v2:1.26.0:1.26.0 -google-cloud-core:2.30.0:2.30.0 -google-cloud-shared-dependencies:3.22.0:3.22.0 +gapic-generator-java:2.33.0:2.33.0 +api-common:2.24.0:2.24.0 +gax:2.41.0:2.41.0 +gax-grpc:2.41.0:2.41.0 +gax-httpjson:0.126.0:0.126.0 +proto-google-common-protos:2.32.0:2.32.0 +grpc-google-common-protos:2.32.0:2.32.0 +proto-google-iam-v1:1.27.0:1.27.0 +grpc-google-iam-v1:1.27.0:1.27.0 +proto-google-iam-v2beta:1.27.0:1.27.0 +grpc-google-iam-v2beta:1.27.0:1.27.0 +google-iam-policy:1.27.0:1.27.0 +proto-google-iam-v2:1.27.0:1.27.0 +grpc-google-iam-v2:1.27.0:1.27.0 +google-cloud-core:2.31.0:2.31.0 +google-cloud-shared-dependencies:3.23.0:3.23.0