Skip to content

Commit

Permalink
chore: migrate to owl-bot (#124)
Browse files Browse the repository at this point in the history
* chore: migrate to owl bot

* chore: copy files from googleapis-gen ad5147b2c3694044935301527f68b951c2e1f419

* chore: run the post processor

* fix: proper quotes owlbot.py

Co-authored-by: Anthonios Partheniou <[email protected]>

Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
SurferJeffAtGoogle and parthea authored Apr 7, 2021
1 parent 967353d commit c34ccc0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 169 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker:
digest: sha256:612842ba5ccf62b4e3983fe6dc453cf66883c74bc168aa62da7acaed1e2fdc93
image: gcr.io/repo-automation-bots/owlbot-python:latest

26 changes: 26 additions & 0 deletions packages/google-cloud-bigquery-datatransfer/.github/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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-python:latest

deep-remove-regex:
- /owl-bot-staging

deep-copy-regex:
- source: /google/cloud/bigquery/datatransfer/(v.*)/.*-py/(.*)
dest: /owl-bot-staging/$1/$2

begin-after-commit-hash: ad5147b2c3694044935301527f68b951c2e1f419

Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,29 @@
from synthtool.languages import python


gapic = gcp.GAPICBazel()
common = gcp.CommonTemplates()
versions = ["v1"]

# ----------------------------------------------------------------------------
# Generate bigquery_datatransfer GAPIC layer
# ----------------------------------------------------------------------------
for version in versions:
library = gapic.py_library(
service="bigquery_datatransfer",
version=version,
bazel_target=(
f"//google/cloud/bigquery/datatransfer/{version}:"
"bigquery-datatransfer-v1-py"
),
include_protos=True,
for library in s.get_staging_dirs("v1"):
# Fix missing async client in datatransfer_v1
# https://github.com/googleapis/gapic-generator-python/issues/815
s.replace(
library / "google/cloud/bigquery_datatransfer_v1/__init__.py",
r"from \.services\.data_transfer_service import DataTransferServiceClient",
"\\g<0>\nfrom .services.data_transfer_service import DataTransferServiceAsyncClient",
)
s.replace(
library / "google/cloud/bigquery_datatransfer_v1/__init__.py",
r"'DataTransferServiceClient',",
'\\g<0>\n "DataTransferServiceAsyncClient"',
)

s.move(library, excludes=["*.tar.gz", "docs/index.rst", "README.rst", "setup.py"])

s.remove_staging_dirs()


# ----------------------------------------------------------------------------
# Add templated files
Expand All @@ -52,17 +56,4 @@

python.py_samples(skip_readmes=True)

# Fix missing async client in datatransfer_v1
# https://github.com/googleapis/gapic-generator-python/issues/815
s.replace(
"google/cloud/bigquery_datatransfer_v1/__init__.py",
r"from \.services\.data_transfer_service import DataTransferServiceClient",
"\\g<0>\nfrom .services.data_transfer_service import DataTransferServiceAsyncClient",
)
s.replace(
"google/cloud/bigquery_datatransfer_v1/__init__.py",
r"'DataTransferServiceClient',",
'\\g<0>\n "DataTransferServiceAsyncClient"',
)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
145 changes: 0 additions & 145 deletions packages/google-cloud-bigquery-datatransfer/synth.metadata

This file was deleted.

0 comments on commit c34ccc0

Please sign in to comment.