diff --git a/.github/scripts/hermetic_library_generation.sh b/.github/scripts/hermetic_library_generation.sh deleted file mode 100644 index 49a7414cf7..0000000000 --- a/.github/scripts/hermetic_library_generation.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -set -e -# This script should be run at the root of the repository. -# This script is used to, when a pull request changes the generation -# configuration (generation_config.yaml by default): -# 1. Find whether the last commit in this pull request contains changes to -# the generation configuration and exit early if it doesn't have such a change -# since the generation result would be the same. -# 2. Compare generation configurations in the current branch (with which the -# pull request associated) and target branch (into which the pull request is -# merged); -# 3. Generate changed libraries using library_generation image; -# 4. Commit the changes to the pull request, if any. -# 5. Edit the PR body with generated pull request description, if applicable. - -# The following commands need to be installed before running the script: -# 1. git -# 2. gh -# 3. docker - -# The parameters of this script is: -# 1. target_branch, the branch into which the pull request is merged. -# 2. current_branch, the branch with which the pull request is associated. -# 3. [optional] generation_config, the path to the generation configuration, -# the default value is generation_config.yaml in the repository root. -while [[ $# -gt 0 ]]; do -key="$1" -case "${key}" in - --target_branch) - target_branch="$2" - shift - ;; - --current_branch) - current_branch="$2" - shift - ;; - --generation_config) - generation_config="$2" - shift - ;; - *) - echo "Invalid option: [$1]" - exit 1 - ;; -esac -shift -done - -if [ -z "${target_branch}" ]; then - echo "missing required argument --target_branch" - exit 1 -fi - -if [ -z "${current_branch}" ]; then - echo "missing required argument --current_branch" - exit 1 -fi - -if [ -z "${generation_config}" ]; then - generation_config=generation_config.yaml - echo "Using default generation config: ${generation_config}" -fi - -workspace_name="/workspace" -baseline_generation_config="baseline_generation_config.yaml" -message="chore: generate libraries at $(date)" - -git checkout "${target_branch}" -git checkout "${current_branch}" - -# copy generation configuration from target branch to current branch. -git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}" - -# parse image tag from the generation configuration. -image_tag=$(grep "gapic_generator_version" "${generation_config}" | cut -d ':' -f 2 | xargs) - -repo_root_dir=$(pwd) -mkdir -p "${repo_root_dir}/output" -# download api definitions from googleapis repository -googleapis_commitish=$(grep googleapis_commitish "${generation_config}" | cut -d ":" -f 2 | xargs) -api_def_dir=$(mktemp -d) -git clone https://github.com/googleapis/googleapis.git "${api_def_dir}" -pushd "${api_def_dir}" -git checkout "${googleapis_commitish}" -cp -r google/ grafeas/ "${repo_root_dir}/output" -popd - -# run hermetic code generation docker image. -docker run \ - --rm \ - -u "$(id -u):$(id -g)" \ - -v "$(pwd):${workspace_name}" \ - gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ - --baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ - --current-generation-config-path="${workspace_name}/${generation_config}" - -# remove api definitions after generation -rm -rf "${api_def_dir}" - -# commit the change to the pull request. -rm -rdf output googleapis "${baseline_generation_config}" -git add --all -- ':!pr_description.txt' ':!hermetic_library_generation.sh' -changed_files=$(git diff --cached --name-only) -if [[ "${changed_files}" != "" ]]; then - echo "Commit changes..." - git commit -m "${message}" - git push -else - echo "There is no generated code change, skip commit." -fi - -# set pr body if pr_description.txt is generated. -if [[ -f "pr_description.txt" ]]; then - pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") - gh pr edit "${pr_num}" --body "$(cat pr_description.txt)" -fi diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 51a087f8e5..9399ebef23 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -18,30 +18,28 @@ on: pull_request: env: - HEAD_REF: ${{ github.head_ref }} REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }} GITHUB_REPOSITORY: ${{ github.repository }} - jobs: library_generation: runs-on: ubuntu-latest steps: + - name: Determine whether the pull request comes from a fork + run: | + if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then + echo "This PR comes from a fork. Skip library generation." + echo "SHOULD_RUN=false" >> $GITHUB_ENV + else + echo "SHOULD_RUN=true" >> $GITHUB_ENV + fi - uses: actions/checkout@v4 + if: env.SHOULD_RUN == 'true' with: fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - name: Generate changed libraries - shell: bash - run: | - set -ex - if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then - echo "This PR comes from a fork. Generation will be skipped" - exit 0 - fi - [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" - [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" - bash .github/scripts/hermetic_library_generation.sh \ - --target_branch ${{ github.base_ref }} \ - --current_branch $HEAD_REF - env: - GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - uses: googleapis/sdk-platform-java/.github/scripts@v2.47.0 + if: env.SHOULD_RUN == 'true' + with: + base_ref: ${{ github.base_ref }} + head_ref: ${{ github.head_ref }} + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 276675e75b..67c14d6183 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -14,6 +14,6 @@ jobs: shell: bash run: .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.36.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.37.0 with: bom-path: google-cloud-bigtable-bom/pom.xml diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index b448b1374d..e698054b2d 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.37.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 1df13c4bd6..ca9e250966 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.37.0" } env_vars: { diff --git a/CHANGELOG.md b/CHANGELOG.md index ffe38c778b..45ee54f09e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.45.1](https://github.com/googleapis/java-bigtable/compare/v2.45.0...v2.45.1) (2024-10-14) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.47.0 ([cdc2cc7](https://github.com/googleapis/java-bigtable/commit/cdc2cc7e085af42a2078373098b5f8ef8c752ea7)) + + +### Dependencies + +* Update sdk-platform-java dependencies ([#2378](https://github.com/googleapis/java-bigtable/issues/2378)) ([2499a3c](https://github.com/googleapis/java-bigtable/commit/2499a3cd5e0d0404666c7f9cf0c74f9edb90d894)) + ## [2.45.0](https://github.com/googleapis/java-bigtable/compare/v2.44.1...v2.45.0) (2024-10-03) diff --git a/README.md b/README.md index db9a8510e3..c2463cc12f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: If you are using Maven without the BOM, add this to your dependencies: - ```xml @@ -50,22 +49,21 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.47.0') +implementation platform('com.google.cloud:libraries-bom:26.48.0') implementation 'com.google.cloud:google-cloud-bigtable' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigtable:2.45.0' +implementation 'com.google.cloud:google-cloud-bigtable:2.45.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.45.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.45.1" ``` - ## Authentication @@ -545,7 +543,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.45.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.45.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/generation_config.yaml b/generation_config.yaml index afd2786fa1..d3a36ac301 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ -gapic_generator_version: 2.46.1 -googleapis_commitish: 16a1580c06b3b32e8ab33c39d846bba7e21bfae3 -libraries_bom_version: 26.47.0 +gapic_generator_version: 2.47.0 +googleapis_commitish: de509e38d37a2a9d8b95e1ce78831189f4f3c0f4 +libraries_bom_version: 26.48.0 template_excludes: - .gitignore - .kokoro/presubmit/integration.cfg diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index c7206d0a2b..678fc4bb9b 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 2.45.0 + 2.45.1 pom com.google.cloud sdk-platform-java-config - 3.36.1 + 3.37.0 @@ -63,37 +63,37 @@ com.google.cloud google-cloud-bigtable - 2.45.0 + 2.45.1 com.google.cloud google-cloud-bigtable-emulator - 0.182.0 + 0.182.1 com.google.cloud google-cloud-bigtable-emulator-core - 0.182.0 + 0.182.1 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.45.0 + 2.45.1 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.45.0 + 2.45.1 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.45.0 + 2.45.1 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.45.0 + 2.45.1 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index ea48a6f451..660269361c 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -7,13 +7,13 @@ com.google.cloud sdk-platform-java-config - 3.36.1 + 3.37.0 com.google.cloud google-cloud-bigtable-deps-bom - 2.45.0 + 2.45.1 pom @@ -77,7 +77,7 @@ com.google.cloud gapic-libraries-bom - 1.45.0 + 1.46.0 pom import diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml index 773bcced61..517b18d76f 100644 --- a/google-cloud-bigtable-emulator-core/pom.xml +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -7,11 +7,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.45.0 + 2.45.1 google-cloud-bigtable-emulator-core - 0.182.0 + 0.182.1 A Java wrapper for the Cloud Bigtable emulator. diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index 775ce5c3b4..97aed04a3d 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.182.0 + 0.182.1 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.45.0 + 2.45.1 scm:git:git@github.com:googleapis/java-bigtable.git @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.45.0 + 2.45.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.45.0 + 2.45.1 pom import @@ -99,7 +99,7 @@ com.google.cloud google-cloud-bigtable-emulator-core - 0.182.0 + 0.182.1 diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 8f93502873..2e5b017159 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.45.0 + 2.45.1 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.45.0 + 2.45.1 - 2.45.0 + 2.45.1 google-cloud-bigtable @@ -52,14 +52,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.45.0 + 2.45.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.45.0 + 2.45.1 pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index c3005eb13e..796d1234be 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -20,6 +20,6 @@ @InternalApi("For internal use only") public final class Version { // {x-version-update-start:google-cloud-bigtable:current} - public static String VERSION = "2.45.0"; + public static String VERSION = "2.45.1"; // {x-version-update-end} } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java index 4f8ff4e4c9..636042f5d9 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java @@ -38,7 +38,7 @@ import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants; import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsView; import com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider; -import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.CloudEnv; import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import com.google.cloud.monitoring.v3.MetricServiceClient; @@ -116,7 +116,16 @@ public void setup() throws IOException { assume() .withMessage("Builtin metrics integration test is not supported by emulator") .that(testEnvRule.env()) - .isNotInstanceOf(EmulatorEnv.class); + .isInstanceOf(CloudEnv.class); + + String appProfileId = testEnvRule.env().getDataClientSettings().getAppProfileId(); + + assume() + .withMessage( + "Builtin metrics integration test needs to be able to use a custom app profile and the app profile is currently forced to " + + appProfileId) + .that(appProfileId) + .isEmpty(); // Create a cloud monitoring client metricClient = MetricServiceClient.create(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java index fd363099d9..5e6244efbe 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java @@ -51,8 +51,6 @@ public enum ConnectionMode { public abstract BigtableDataClient getDataClient(); - public abstract BigtableDataClient getDataClientForInstance(String instanceId) throws IOException; - public abstract BigtableTableAdminClient getTableAdminClient(); public abstract BigtableTableAdminClient getTableAdminClientForInstance(String instanceId) diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java index d7b9523b83..c623053094 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java @@ -27,7 +27,6 @@ import com.google.cloud.bigtable.data.v2.BigtableDataClient; import com.google.cloud.bigtable.data.v2.BigtableDataSettings; import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; -import com.google.common.base.Joiner; import com.google.common.base.MoreObjects; import com.google.common.base.Predicate; import com.google.common.base.Predicates; @@ -43,12 +42,11 @@ import io.grpc.ManagedChannelBuilder; import io.grpc.Metadata; import io.grpc.MethodDescriptor; +import io.grpc.Status; import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Optional; import javax.annotation.Nullable; @@ -63,7 +61,7 @@ *
  • {@code bigtable.table} * */ -class CloudEnv extends AbstractTestEnv { +public class CloudEnv extends AbstractTestEnv { private static final Predicate DIRECT_PATH_IPV6_MATCHER = new Predicate() { @Override @@ -84,6 +82,7 @@ public boolean apply(InetSocketAddress input) { private static final String PROJECT_PROPERTY_NAME = "bigtable.project"; private static final String INSTANCE_PROPERTY_NAME = "bigtable.instance"; + private static final String APP_PROFILE_PROPERTY_NAME = "bigtable.app_profile"; private static final String TABLE_PROPERTY_NAME = "bigtable.table"; private static final String CMEK_KMS_KEY_PROPERTY_NAME = "bigtable.kms_key_name"; @@ -92,12 +91,12 @@ public boolean apply(InetSocketAddress input) { private final String projectId; private final String instanceId; private final String tableId; - private final String tracingCookie; private final String kmsKeyName; private final BigtableDataSettings.Builder dataSettings; private final BigtableTableAdminSettings.Builder tableAdminSettings; private final BigtableInstanceAdminSettings.Builder instanceAdminSettings; + @Nullable private final String appProfileId; private BigtableDataClient dataClient; private BigtableTableAdminClient tableAdminClient; @@ -110,6 +109,7 @@ static CloudEnv fromSystemProperties() { getOptionalProperty(CMEK_KMS_KEY_PROPERTY_NAME, ""), getRequiredProperty(PROJECT_PROPERTY_NAME), getRequiredProperty(INSTANCE_PROPERTY_NAME), + getOptionalProperty(APP_PROFILE_PROPERTY_NAME), getRequiredProperty(TABLE_PROPERTY_NAME), getOptionalProperty(TRACING_COOKIE_PROPERTY_NAME)); } @@ -120,12 +120,13 @@ private CloudEnv( @Nullable String kmsKeyName, String projectId, String instanceId, + @Nullable String appProfileId, String tableId, @Nullable String tracingCookie) { this.projectId = projectId; this.instanceId = instanceId; + this.appProfileId = appProfileId; this.tableId = tableId; - this.tracingCookie = tracingCookie; this.kmsKeyName = kmsKeyName; this.dataSettings = @@ -133,6 +134,9 @@ private CloudEnv( if (!Strings.isNullOrEmpty(dataEndpoint)) { dataSettings.stubSettings().setEndpoint(dataEndpoint); } + if (!Strings.isNullOrEmpty(appProfileId)) { + dataSettings.setAppProfileId(appProfileId); + } configureConnection(dataSettings.stubSettings()); configureUserAgent(dataSettings.stubSettings()); @@ -193,6 +197,9 @@ private void configureConnection(StubSettings.Builder stubSettings) { throw new IllegalStateException("Unexpected ConnectionMode: " + getConnectionMode()); } + final ClientInterceptor appProfileInterceptor = + appProfileId != null ? new AppProfileInterceptor() : null; + // Inject the interceptor into the channel provider, taking care to preserve existing channel // configurator InstantiatingGrpcChannelProvider.Builder channelProvider = @@ -211,7 +218,11 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder builder) { if (oldConfigurator != null) { builder = oldConfigurator.apply(builder); } - return builder.intercept(interceptor); + builder = builder.intercept(interceptor); + if (appProfileInterceptor != null) { + builder = builder.intercept(appProfileInterceptor); + } + return builder; } }; channelProvider.setChannelConfigurator(newConfigurator); @@ -255,25 +266,35 @@ public void onHeaders(Metadata headers) { }; } - private void configureUserAgent(EnhancedBigtableStubSettings.Builder stubSettings) { - List parts = new ArrayList<>(); - parts.add("java-bigtable-int-test"); - - switch (getConnectionMode()) { - case DEFAULT: - // nothing special - break; - case REQUIRE_CFE: - parts.add("bigtable-directpath-disable"); - break; - case REQUIRE_DIRECT_PATH: - case REQUIRE_DIRECT_PATH_IPV4: - parts.add("bigtable-directpath-enable"); - break; - default: - throw new IllegalStateException("Unexpected connectionMode: " + getConnectionMode()); + private class AppProfileInterceptor implements ClientInterceptor { + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + return new SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + String reqParams = + headers.get( + Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER)); + if (!reqParams.contains("app_profile_id=" + appProfileId)) { + responseListener.onClose( + Status.FAILED_PRECONDITION.withDescription( + "Integration test was configured to run with app profile: " + + appProfileId + + ", but found a different app profile in the headers: " + + reqParams), + new Metadata()); + return; + } + super.start(responseListener, headers); + } + }; } - String newUserAgent = Joiner.on(" ").join(parts); + } + + private void configureUserAgent(EnhancedBigtableStubSettings.Builder stubSettings) { + String newUserAgent = "java-bigtable-int-test"; // Use the existing user-agent to use as a prefix Map existingHeaders = @@ -309,19 +330,6 @@ public BigtableDataClient getDataClient() { return dataClient; } - @Override - public BigtableDataClient getDataClientForInstance(String instanceId) throws IOException { - BigtableDataSettings.Builder settings = - BigtableDataSettings.newBuilder() - .setProjectId(dataSettings.getProjectId()) - .setInstanceId(instanceId); - settings - .stubSettings() - .setEndpoint(dataSettings.stubSettings().getEndpoint()) - .setTransportChannelProvider(dataSettings.stubSettings().getTransportChannelProvider()); - return BigtableDataClient.create(settings.build()); - } - @Override public BigtableTableAdminClient getTableAdminClient() { return tableAdminClient; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java index bec3e0eef2..232536a76a 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java @@ -119,11 +119,6 @@ public BigtableDataClient getDataClient() { return dataClient; } - @Override - public BigtableDataClient getDataClientForInstance(String instanceId) throws IOException { - throw new UnsupportedOperationException("Could not create a data client for another instance."); - } - @Override public BigtableTableAdminClient getTableAdminClient() { return tableAdminClient; diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index c5a2a05390..f88f750858 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.45.0 + 2.45.1 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.45.0 + 2.45.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.45.0 + 2.45.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.45.0 + 2.45.1 pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index 840387af63..c93286716f 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.45.0 + 2.45.1 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.45.0 + 2.45.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.45.0 + 2.45.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.45.0 + 2.45.1 pom import diff --git a/pom.xml b/pom.xml index fbd2eed2e0..867e1b770c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.45.0 + 2.45.1 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.36.1 + 3.37.0 @@ -153,27 +153,27 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.45.0 + 2.45.1 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.45.0 + 2.45.1 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.45.0 + 2.45.1 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.45.0 + 2.45.1 com.google.cloud google-cloud-bigtable - 2.45.0 + 2.45.1 diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index ba54b21a67..d9949d197b 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.45.0 + 2.45.1 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.45.0 + 2.45.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.45.0 + 2.45.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.45.0 + 2.45.1 pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index 64ca962c1b..fdd0a27b57 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.45.0 + 2.45.1 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.45.0 + 2.45.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.45.0 + 2.45.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.45.0 + 2.45.1 pom import diff --git a/renovate.json b/renovate.json index 837f09eaa2..3c5874c1a2 100644 --- a/renovate.json +++ b/renovate.json @@ -73,10 +73,11 @@ }, { "packagePatterns": [ + "^com.google.api:gapic-generator-java", "^com.google.cloud:sdk-platform-java-config", "^com.google.cloud:gapic-libraries-bom" ], - "groupName": "shared dependencies" + "groupName": "sdk-platform-java dependencies" } ], "regexManagers": [ @@ -108,6 +109,16 @@ "matchStrings": ["uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n"], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" + }, + { + "fileMatch": [ + ".github/workflows/hermetic_library_generation.yaml" + ], + "matchStrings": [ + "uses: googleapis/sdk-platform-java/.github/scripts@v(?.+?)\\n" + ], + "depNameTemplate": "com.google.api:gapic-generator-java", + "datasourceTemplate": "maven" } ], "semanticCommits": true, diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fa21aa6e47..71414af391 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.45.0 + 2.45.1 diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml index 89a0436b9c..f351f56a97 100644 --- a/test-proxy/pom.xml +++ b/test-proxy/pom.xml @@ -12,11 +12,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.45.0 + 2.45.1 - 2.45.0 + 2.45.1 diff --git a/versions.txt b/versions.txt index b05c4b4482..c652f2e783 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.45.0:2.45.0 -grpc-google-cloud-bigtable-admin-v2:2.45.0:2.45.0 -grpc-google-cloud-bigtable-v2:2.45.0:2.45.0 -proto-google-cloud-bigtable-admin-v2:2.45.0:2.45.0 -proto-google-cloud-bigtable-v2:2.45.0:2.45.0 -google-cloud-bigtable-emulator:0.182.0:0.182.0 -google-cloud-bigtable-emulator-core:0.182.0:0.182.0 +google-cloud-bigtable:2.45.1:2.45.1 +grpc-google-cloud-bigtable-admin-v2:2.45.1:2.45.1 +grpc-google-cloud-bigtable-v2:2.45.1:2.45.1 +proto-google-cloud-bigtable-admin-v2:2.45.1:2.45.1 +proto-google-cloud-bigtable-v2:2.45.1:2.45.1 +google-cloud-bigtable-emulator:0.182.1:0.182.1 +google-cloud-bigtable-emulator-core:0.182.1:0.182.1