diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml deleted file mode 100644 index 77cf60878..000000000 --- a/.github/.OwlBot.lock.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2022 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/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:edae91ccdd2dded2f572ec341a768ad180305a3e8fbfd93064b28e237d35920a diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml deleted file mode 100644 index d266a05ce..000000000 --- a/.github/.OwlBot.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# 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/cloud-devrel-public-resources/owlbot-java:latest" - -deep-remove-regex: -- "/samples/snippets/generated" -- "/grpc-google-.*/src" -- "/proto-google-.*/src" -- "/google-.*/src" - -deep-preserve-regex: -- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" -- "/proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageName.java" -- "/google-cloud-vision/src/test/java/com/google/cloud/vision/it/ITSystemTest.java" -- "/google-cloud-vision/src/test/resources/city.jpg" -- "/google-cloud-vision/src/test/resources/face_no_surprise.jpg" -- "/google-cloud-vision/src/test/resources/landmark.jpg" -- "/google-cloud-vision/src/test/resources/logos.png" -- "/google-cloud-vision/src/test/resources/puppies.jpg" -- "/google-cloud-vision/src/test/resources/text.jpg" -- "/google-cloud-vision/src/test/resources/wakeupcat.jpg" - -deep-copy-regex: -- source: "/google/cloud/vision/(v.*)/.*-java/proto-google-.*/src" - dest: "/owl-bot-staging/$1/proto-google-cloud-vision-$1/src" -- source: "/google/cloud/vision/(v.*)/.*-java/grpc-google-.*/src" - dest: "/owl-bot-staging/$1/grpc-google-cloud-vision-$1/src" -- source: "/google/cloud/vision/(v.*)/.*-java/gapic-google-.*/src" - dest: "/owl-bot-staging/$1/google-cloud-vision/src" -- source: "/google/cloud/vision/(v.*)/.*-java/samples/snippets/generated" - dest: "/owl-bot-staging/$1/samples/snippets/generated" diff --git a/owlbot.py b/owlbot.py deleted file mode 100644 index e1009a43a..000000000 --- a/owlbot.py +++ /dev/null @@ -1,236 +0,0 @@ -# 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 - - -# restore deprecated resource name helpers -# TODO: remove in version 2.0.0 -DEPRECATED_RESOURCE_NAME_HELPERS = """ - -private static final PathTemplate LOCATION_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - -private static final PathTemplate PRODUCT_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/products/{product}"); - -private static final PathTemplate PRODUCT_SET_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/productSets/{product_set}"); - -private static final PathTemplate REFERENCE_IMAGE_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}"); - -/** - * Formats a string containing the fully-qualified path to represent a location resource. - * - * @deprecated Use the {@link LocationName} class instead. - */ -@Deprecated -public static final String formatLocationName(String project, String location) { - return LOCATION_PATH_TEMPLATE.instantiate( - "project", project, - "location", location); -} - -/** - * Formats a string containing the fully-qualified path to represent a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String formatProductName(String project, String location, String product) { - return PRODUCT_PATH_TEMPLATE.instantiate( - "project", project, - "location", location, - "product", product); -} - -/** - * Formats a string containing the fully-qualified path to represent a product_set resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String formatProductSetName( - String project, String location, String productSet) { - return PRODUCT_SET_PATH_TEMPLATE.instantiate( - "project", project, - "location", location, - "product_set", productSet); -} - -/** - * Formats a string containing the fully-qualified path to represent a reference_image resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String formatReferenceImageName( - String project, String location, String product, String referenceImage) { - return REFERENCE_IMAGE_PATH_TEMPLATE.instantiate( - "project", project, - "location", location, - "product", product, - "reference_image", referenceImage); -} - -/** - * Parses the project from the given fully-qualified path which represents a location resource. - * - * @deprecated Use the {@link LocationName} class instead. - */ -@Deprecated -public static final String parseProjectFromLocationName(String locationName) { - return LOCATION_PATH_TEMPLATE.parse(locationName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a location resource. - * - * @deprecated Use the {@link LocationName} class instead. - */ -@Deprecated -public static final String parseLocationFromLocationName(String locationName) { - return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); -} - -/** - * Parses the project from the given fully-qualified path which represents a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String parseProjectFromProductName(String productName) { - return PRODUCT_PATH_TEMPLATE.parse(productName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String parseLocationFromProductName(String productName) { - return PRODUCT_PATH_TEMPLATE.parse(productName).get("location"); -} - -/** - * Parses the product from the given fully-qualified path which represents a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String parseProductFromProductName(String productName) { - return PRODUCT_PATH_TEMPLATE.parse(productName).get("product"); -} - -/** - * Parses the project from the given fully-qualified path which represents a product_set resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String parseProjectFromProductSetName(String productSetName) { - return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a product_set - * resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String parseLocationFromProductSetName(String productSetName) { - return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("location"); -} - -/** - * Parses the product_set from the given fully-qualified path which represents a product_set - * resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String parseProductSetFromProductSetName(String productSetName) { - return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("product_set"); -} - -/** - * Parses the project from the given fully-qualified path which represents a reference_image - * resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseProjectFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a reference_image - * resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseLocationFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("location"); -} - -/** - * Parses the product from the given fully-qualified path which represents a reference_image - * resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseProductFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("product"); -} - -/** - * Parses the reference_image from the given fully-qualified path which represents a - * reference_image resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseReferenceImageFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("reference_image"); -} -""" - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.replace( - "owl-bot-staging/v1/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java", - "private final OperationsClient operationsClient;", - f"private final OperationsClient operationsClient;\n{DEPRECATED_RESOURCE_NAME_HELPERS}" - ) - s.replace( - "owl-bot-staging/v1/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java", - "import com.google.api.gax.rpc.UnaryCallable;", - "import com.google.api.gax.rpc.UnaryCallable;\nimport com.google.api.pathtemplate.PathTemplate;" - ) - s.move(library) - -s.remove_staging_dirs() -java.common_templates(excludes=[ - '.kokoro/nightly/integration.cfg' -])