From 24e1b7f408c0b752e0ad0fd0bad475e45ac9aa75 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 14 Jun 2021 12:54:05 -0400 Subject: [PATCH] chore: migrate to owlbot (#116) feat: Add/Update API definitions for Cloud Channel API, including feat: Update descriptions of APIs. feat: Add additional_bindings to HTTP annotations of Customer related APIs (list/create/get/update/delete). feat: Add a new LookupOffer RPC and LookupOfferRequest proto. feat: Add a new enum value LICENSE_CAP_CHANGED to enum EntitlementEvent.Type --- .github/.OwlBot.lock.yaml | 3 + .github/.OwlBot.yaml | 29 ++++++++++ google-cloud-channel-bom/pom.xml | 13 ++--- google-cloud-channel/pom.xml | 4 +- .../stub/CloudChannelServiceStubSettings.java | 7 +++ .../v1/CloudChannelServiceClientTest.java | 2 +- owlbot.py | 24 ++++++++ pom.xml | 4 +- .../clirr-ignored-differences.xml | 55 ++----------------- synth.py | 32 ----------- versions.txt | 2 +- 11 files changed, 80 insertions(+), 95 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 00000000..ba57534a --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:689e998ca8b33117d8607b1c3df12b9cfebd68b621ba5ab6ce17be8715506203 + image: gcr.io/repo-automation-bots/owlbot-java:latest diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..e6e0cae7 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,29 @@ +# 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-copy-regex: +- source: "/google/cloud/channel/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-channel-$1/src" +- source: "/google/cloud/channel/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-channel-$1/src" +- source: "/google/cloud/channel/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-channel/src" diff --git a/google-cloud-channel-bom/pom.xml b/google-cloud-channel-bom/pom.xml index 498752f7..6d115aaf 100644 --- a/google-cloud-channel-bom/pom.xml +++ b/google-cloud-channel-bom/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -64,7 +64,6 @@ - com.google.cloud google-cloud-channel @@ -72,13 +71,13 @@ com.google.api.grpc - proto-google-cloud-channel-v1 - 2.2.2-SNAPSHOT + grpc-google-cloud-channel-v1 + 2.2.2-SNAPSHOT com.google.api.grpc - grpc-google-cloud-channel-v1 - 2.2.2-SNAPSHOT + proto-google-cloud-channel-v1 + 2.2.2-SNAPSHOT @@ -94,4 +93,4 @@ - \ No newline at end of file + diff --git a/google-cloud-channel/pom.xml b/google-cloud-channel/pom.xml index b3c67bc7..06d0f1ee 100644 --- a/google-cloud-channel/pom.xml +++ b/google-cloud-channel/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -108,4 +108,4 @@ - \ No newline at end of file + diff --git a/google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStubSettings.java b/google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStubSettings.java index fdd0448d..c148b16f 100644 --- a/google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStubSettings.java +++ b/google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStubSettings.java @@ -1215,6 +1215,11 @@ public static String getDefaultEndpoint() { return "cloudchannel.googleapis.com:443"; } + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudchannel.mtls.googleapis.com:443"; + } + /** Returns the default service scopes. */ public static List getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; @@ -1679,6 +1684,8 @@ private static Builder createDefault() { builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } diff --git a/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java b/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java index def18194..905a2755 100644 --- a/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java +++ b/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java @@ -63,8 +63,8 @@ public class CloudChannelServiceClientTest { private static MockCloudChannelService mockCloudChannelService; private static MockServiceHelper mockServiceHelper; - private CloudChannelServiceClient client; private LocalChannelProvider channelProvider; + private CloudChannelServiceClient client; @BeforeClass public static void startStaticServer() { diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 00000000..dca9d867 --- /dev/null +++ b/owlbot.py @@ -0,0 +1,24 @@ +# 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() diff --git a/pom.xml b/pom.xml index 44a921ff..0b759749 100644 --- a/pom.xml +++ b/pom.xml @@ -112,8 +112,8 @@ google-cloud-channel - proto-google-cloud-channel-v1 grpc-google-cloud-channel-v1 + proto-google-cloud-channel-v1 google-cloud-channel-bom @@ -186,4 +186,4 @@ - \ No newline at end of file + diff --git a/proto-google-cloud-channel-v1/clirr-ignored-differences.xml b/proto-google-cloud-channel-v1/clirr-ignored-differences.xml index 9b50721f..5b1692f1 100644 --- a/proto-google-cloud-channel-v1/clirr-ignored-differences.xml +++ b/proto-google-cloud-channel-v1/clirr-ignored-differences.xml @@ -2,63 +2,18 @@ - com/google/cloud/channel/v1/CreateChannelPartnerLinkRequest* - 7002 - * get*(*) - - - com/google/cloud/channel/v1/CreateChannelPartnerLinkRequest* - 7002 - * set*(*) - - - com/google/cloud/channel/v1/CreateChannelPartnerLinkRequest* - 7002 - * clear*(*) - - - com/google/cloud/channel/v1/TransferableSku* - 7002 + 7012 + com/google/cloud/channel/v1/*OrBuilder * get*(*) - - com/google/cloud/channel/v1/TransferableSku* - 7002 - * has*(*) - - - com/google/cloud/channel/v1/TransferableSku* - 7002 - * clear*(*) - - - com/google/cloud/channel/v1/TransferableSku* - 7002 - * set*(*) - - - com/google/cloud/channel/v1/TransferableSku* - 7002 - * merge*(*) - - - com/google/cloud/channel/v1/CreateChannelPartnerLinkRequest* - 6011 - *_FIELD_NUMBER - - - com/google/cloud/channel/v1/TransferableSku* - 6011 - *_FIELD_NUMBER - 7012 com/google/cloud/channel/v1/*OrBuilder - * has*(*) + boolean contains*(*) 7012 com/google/cloud/channel/v1/*OrBuilder - * get*(*) + boolean has*(*) - \ No newline at end of file + diff --git a/synth.py b/synth.py deleted file mode 100644 index 6f554745..00000000 --- a/synth.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2020 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 - -service = 'channel' -versions = ['v1'] - -for version in versions: - java.bazel_library( - service=service, - version=version, - proto_path=f'google/cloud/{service}/{version}', - bazel_target=f'//google/cloud/{service}/{version}:google-cloud-{service}-{version}-java', - ) - -java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt index 0475e925..15188f38 100644 --- a/versions.txt +++ b/versions.txt @@ -2,5 +2,5 @@ # module:released-version:current-version google-cloud-channel:2.2.1:2.2.2-SNAPSHOT +grpc-google-cloud-channel-v1:2.2.1:2.2.2-SNAPSHOT proto-google-cloud-channel-v1:2.2.1:2.2.2-SNAPSHOT -grpc-google-cloud-channel-v1:2.2.1:2.2.2-SNAPSHOT \ No newline at end of file