From c7b61abcd80b31fa7b7362fe7d4e6ea3444cbbc3 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 1 Sep 2021 13:51:49 -0400 Subject: [PATCH] chore: migrate to owlbot (#1275) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: migrate to owlbot * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: keep template changes * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: make owlbot check required * chore: update docker image * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 3 + .github/.OwlBot.yaml | 86 +++++++++++++++++++ .github/sync-repo-settings.yaml | 1 + google-cloud-bigquerystorage-bom/pom.xml | 37 ++++---- google-cloud-bigquerystorage/pom.xml | 2 +- owlbot.py | 31 +++++++ pom.xml | 8 +- .../bigquerystorage/WriteCommittedStream.java | 2 +- .../bigquerystorage/WriteToDefaultStream.java | 2 +- synth.py | 43 ---------- versions.txt | 8 +- 11 files changed, 148 insertions(+), 75 deletions(-) create mode 100644 .github/.OwlBot.lock.yaml create mode 100644 .github/.OwlBot.yaml create mode 100644 owlbot.py delete mode 100644 synth.py diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 0000000000..843e882bb9 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:2595f321d9a9acf34c2d02e4dc5ec214ce07eecdb43978382d8a88476dec0c16 + image: gcr.io/repo-automation-bots/owlbot-java:latest diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 0000000000..8f342e33ce --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,86 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: "gcr.io/repo-automation-bots/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-preserve-regex: +- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v.*/BigQueryReadSettings.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v.*/BigQueryReadClient.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/util" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v.*/stub/BigQueryReadStubSettings.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v.*/stub/EnhancedBigQueryReadStub.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v.*/stub/EnhancedBigQueryReadStubSettings.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v.*/stub/readrows" +- "/google-cloud-bigquerystorage/src/test/proto" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v.*/stub" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v.*/it" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/util" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v.*/BigQueryReadClientTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/BigQueryStorageClientTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/it/SimpleRowReader.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/stub/EnhancedBigQueryStorageStubSettingsTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/stub/ResourceHeaderTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/stub/readrows/ReadRowsRetryTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptorTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BQV2ToBQStorageConverterTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BigDecimalByteStringEncoderTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/BigQueryReadClientTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoderTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/FakeBigQueryWrite.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/FakeBigQueryWriteImpl.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/FakeClock.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/FakeScheduledExecutorService.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriterTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/JsonToProtoMessageTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/ProtoSchemaConverterTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/SchemaCompatibilityTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2Test.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/BigQueryResource.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/it/SimpleRowReader.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/stub/EnhancedBigQueryReadStubSettingsTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/stub/ResourceHeaderTest.java" +- "/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/stub/readrows/ReadRowsRetryTest.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BigQueryStorageClient.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BigQueryStorageSettings.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/EnhancedBigQueryStorageStub.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/stub/EnhancedBigQueryStorageStubSettings.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BQTableSchemaToProtoDescriptor.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BQV2ToBQStorageConverter.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/BigDecimalByteStringEncoder.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/CivilTimeEncoder.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriter.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/JsonToProtoMessage.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/OnSchemaUpdateRunnable.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/ProtoSchemaConverter.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/SchemaCompatibility.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamConnection.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/Waiter.java" + +deep-copy-regex: +- source: "/google/cloud/bigquery/storage/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-bigquerystorage-$1/src" +- source: "/google/cloud/bigquery/storage/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-bigquerystorage-$1/src" +- source: "/google/cloud/bigquery/storage/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-bigquerystorage/src" diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 4509e8dd73..10bf818345 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -16,6 +16,7 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google + - OwlBot Post Processor - pattern: java7 isAdminEnforced: true requiredApprovingReviewCount: 1 diff --git a/google-cloud-bigquerystorage-bom/pom.xml b/google-cloud-bigquerystorage-bom/pom.xml index c40a806987..f6e662031d 100644 --- a/google-cloud-bigquerystorage-bom/pom.xml +++ b/google-cloud-bigquerystorage-bom/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -48,21 +48,11 @@ - + - com.google.api.grpc - proto-google-cloud-bigquerystorage-v1beta1 - 0.125.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-bigquerystorage-v1beta2 - 0.125.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-bigquerystorage-v1 - 2.1.2-SNAPSHOT + com.google.cloud + google-cloud-bigquerystorage + 2.1.2-SNAPSHOT com.google.api.grpc @@ -80,14 +70,19 @@ 2.1.2-SNAPSHOT - com.google.cloud - google-cloud-bigquerystorage - 2.1.2-SNAPSHOT + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1beta1 + 0.125.2-SNAPSHOT - com.google.apis - google-api-services-bigquery - v2-rev20210819-1.32.1 + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1beta2 + 0.125.2-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + 2.1.2-SNAPSHOT diff --git a/google-cloud-bigquerystorage/pom.xml b/google-cloud-bigquerystorage/pom.xml index 24f7fc5e81..b247b8e9ba 100644 --- a/google-cloud-bigquerystorage/pom.xml +++ b/google-cloud-bigquerystorage/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 0000000000..fc6eaf1ed8 --- /dev/null +++ b/owlbot.py @@ -0,0 +1,31 @@ +# Copyright 2021 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates( + excludes=[ + "renovate.json", + ".kokoro/build.sh", + ".kokoro/nightly/samples.cfg", + ".kokoro/presubmit/samples.cfg", + ] +) diff --git a/pom.xml b/pom.xml index 9644484b7d..e7c035963a 100644 --- a/pom.xml +++ b/pom.xml @@ -167,13 +167,13 @@ - proto-google-cloud-bigquerystorage-v1beta1 - proto-google-cloud-bigquerystorage-v1beta2 - proto-google-cloud-bigquerystorage-v1 + google-cloud-bigquerystorage grpc-google-cloud-bigquerystorage-v1beta1 grpc-google-cloud-bigquerystorage-v1beta2 grpc-google-cloud-bigquerystorage-v1 - google-cloud-bigquerystorage + proto-google-cloud-bigquerystorage-v1beta1 + proto-google-cloud-bigquerystorage-v1beta2 + proto-google-cloud-bigquerystorage-v1 google-cloud-bigquerystorage-bom diff --git a/samples/snippets/src/main/java/com/example/bigquerystorage/WriteCommittedStream.java b/samples/snippets/src/main/java/com/example/bigquerystorage/WriteCommittedStream.java index 4ebc44c2a5..ea1ac9ccd1 100644 --- a/samples/snippets/src/main/java/com/example/bigquerystorage/WriteCommittedStream.java +++ b/samples/snippets/src/main/java/com/example/bigquerystorage/WriteCommittedStream.java @@ -38,7 +38,7 @@ public static void runWriteCommittedStream() String projectId = "MY_PROJECT_ID"; String datasetName = "MY_DATASET_NAME"; String tableName = "MY_TABLE_NAME"; - + writeCommittedStream(projectId, datasetName, tableName); } diff --git a/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java b/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java index b85edd38bb..1f79c02a51 100644 --- a/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java +++ b/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java @@ -39,7 +39,7 @@ public static void runWriteToDefaultStream() String projectId = "MY_PROJECT_ID"; String datasetName = "MY_DATASET_NAME"; String tableName = "MY_TABLE_NAME"; - + writeToDefaultStream(projectId, datasetName, tableName); } diff --git a/synth.py b/synth.py deleted file mode 100644 index f02704dc7d..0000000000 --- a/synth.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.java as java -import os - -AUTOSYNTH_MULTIPLE_COMMITS = True - -gapic = gcp.GAPICGenerator() -service = 'bigquerystorage' -versions = ['v1beta1', 'v1beta2', 'v1'] - -for version in versions: - java.bazel_library( - service='bigquery-storage', - version=version, - package_pattern='com.google.cloud.bigquery.storage.{version}', - proto_path=f'google/cloud/bigquery/storage/{version}', - bazel_target=f'//google/cloud/bigquery/storage/{version}:google-cloud-bigquery-storage-{version}-java', - destination_name='bigquerystorage', - ) - -java.common_templates(excludes=[ - 'renovate.json', # excluding due to common-lang3 dep added to renovate.json - '.kokoro/build.sh', - '.kokoro/nightly/samples.cfg', - '.kokoro/presubmit/samples.cfg', -]) diff --git a/versions.txt b/versions.txt index 0dc237989f..582d53c402 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -proto-google-cloud-bigquerystorage-v1beta1:0.125.1:0.125.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1beta2:0.125.1:0.125.2-SNAPSHOT -proto-google-cloud-bigquerystorage-v1:2.1.1:2.1.2-SNAPSHOT +google-cloud-bigquerystorage:2.1.1:2.1.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta1:0.125.1:0.125.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1beta2:0.125.1:0.125.2-SNAPSHOT grpc-google-cloud-bigquerystorage-v1:2.1.1:2.1.2-SNAPSHOT -google-cloud-bigquerystorage:2.1.1:2.1.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1beta1:0.125.1:0.125.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1beta2:0.125.1:0.125.2-SNAPSHOT +proto-google-cloud-bigquerystorage-v1:2.1.1:2.1.2-SNAPSHOT