Skip to content

Commit

Permalink
chore: migrate to owl bot (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed Apr 23, 2021
1 parent 03f1b10 commit f3a7517
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 250 deletions.
4 changes: 4 additions & 0 deletions packages/google-cloud-tasks/.github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker:
digest: sha256:cfc0e802701262c211703c468874d767f65dabe6a1a71d0e07bfc8a3d5175f32
image: gcr.io/repo-automation-bots/owlbot-python:latest

26 changes: 26 additions & 0 deletions packages/google-cloud-tasks/.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/tasks/(v.*)/.*-py/(.*)
dest: /owl-bot-staging/$1/$2

begin-after-commit-hash: 130ce904e5d546c312943d10f48799590f9c0f66

4 changes: 2 additions & 2 deletions packages/google-cloud-tasks/.kokoro/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools
export PYTHONUNBUFFERED=1

# Move into the package, build the distribution and upload.
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password")
TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token")
cd github/python-tasks
python3 setup.py sdist bdist_wheel
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/*
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*
14 changes: 2 additions & 12 deletions packages/google-cloud-tasks/.kokoro/release/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ env_vars: {
value: "github/python-tasks/.kokoro/release.sh"
}

# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Tokens needed to report release status back to GitHub
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token"
}
13 changes: 12 additions & 1 deletion packages/google-cloud-tasks/docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}

/* Insert space between methods for readability */
dl.method {
padding-top: 10px;
padding-bottom: 10px
}

/* Insert empty space between classes */
dl.class {
padding-bottom: 50px
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,19 @@

logging.basicConfig(level=logging.DEBUG)

gapic = gcp.GAPICBazel()
common = gcp.CommonTemplates()
excludes = ["README.rst", "setup.py", "nox*.py", "docs/index.rst", "*.tar.gz"]

# ----------------------------------------------------------------------------
# Generate tasks GAPIC layer
# ----------------------------------------------------------------------------
for version in ["v2beta2", "v2beta3", "v2"]:
library = gapic.py_library(
service="tasks",
version=version,
bazel_target=f"//google/cloud/tasks/{version}:tasks-{version}-py",
include_protos=True,
)
default_version = "v2"

for library in s.get_staging_dirs(default_version):
# Fix docstring.
s.replace(library / "google/cloud/*/types/target.py", "X-Google-\*", "X-Google-\\*")
s.replace(library / "google/cloud/*/types/target.py", "X-AppEngine-\*", "X-AppEngine-\\*")

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

# Fix docstring.
s.replace("google/cloud/*/types/target.py", "X-Google-\*", "X-Google-\\*")
s.replace("google/cloud/*/types/target.py", "X-AppEngine-\*", "X-AppEngine-\\*")
s.remove_staging_dirs()

# ----------------------------------------------------------------------------
# Add templated files
Expand Down
220 changes: 0 additions & 220 deletions packages/google-cloud-tasks/synth.metadata

This file was deleted.

0 comments on commit f3a7517

Please sign in to comment.