Skip to content

Commit

Permalink
chore: migrate to owl bot (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed May 10, 2021
1 parent 3e4edc5 commit 31fcfa5
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 206 deletions.
4 changes: 4 additions & 0 deletions packages/google-cloud-kms/.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-kms/.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/kms/(v.*)/.*-py/(.*)
dest: /owl-bot-staging/$1/$2

begin-after-commit-hash: b06c9034cfcbce180ba732d03be6526e5c8ea1bc

2 changes: 1 addition & 1 deletion packages/google-cloud-kms/.github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-kms/.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-kms
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-kms/.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-kms/.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"
}
14 changes: 14 additions & 0 deletions packages/google-cloud-kms/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.
#
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
Expand Down
13 changes: 12 additions & 1 deletion packages/google-cloud-kms/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
}
13 changes: 13 additions & 0 deletions packages/google-cloud-kms/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# -*- coding: utf-8 -*-
# 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.
#
# google-cloud-kms documentation build configuration file
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,56 +21,42 @@

logging.basicConfig(level=logging.DEBUG)

client_library_version = "0.1.0"

gapic = gcp.GAPICBazel()
common = gcp.CommonTemplates()
version = "v1"

# ----------------------------------------------------------------------------
# Generate kms GAPIC layer
# ----------------------------------------------------------------------------
library = gapic.py_library(
service="kms",
version=version,
bazel_target="//google/cloud/kms/v1:kms-v1-py",
include_protos=True,
)
default_version = "v1"

s.move(library, excludes=["README.rst", "setup.py", "nox*.py", "docs/index.rst"])
for library in s.get_staging_dirs(default_version):
# Escape single '_' which RST treats as target names
s.replace(library / "google/**/resources.py", '''"(.*?)_((SIGN)|(DECRYPT))_"''', '''"\g<1>_\g<2>\_"''')

# Escape single '_' which RST treats as target names
s.replace("google/**/resources.py", '''"(.*?)_((SIGN)|(DECRYPT))_"''', '''"\g<1>_\g<2>\_"''')
# Docstrings of *_iam_policy() methods are formatted poorly and must be fixed
# in order to avoid docstring format warnings in docs.
s.replace(library / "google/**/*client.py",
r"(\s+)Args:",
"\n\g<1>Args:"
)
s.replace(library / "google/**/*client.py",
r"(\s+)\*\*JSON Example\*\*\s+::",
"\n\g<1>**JSON Example**::\n",
)
s.replace(library / "google/**/*client.py",
r"(\s+)\*\*YAML Example\*\*\s+::",
"\n\g<1>**YAML Example**::\n",
)
s.replace(library / "google/**/*client.py",
r"(\s+)For a description of IAM and its features, see",
"\n\g<0>",
)

# Docstrings of *_iam_policy() methods are formatted poorly and must be fixed
# in order to avoid docstring format warnings in docs.
s.replace(
"google/**/*client.py",
r"(\s+)Args:",
"\n\g<1>Args:"
)
s.replace(
"google/**/*client.py",
r"(\s+)\*\*JSON Example\*\*\s+::",
"\n\g<1>**JSON Example**::\n",
)
s.replace(
"google/**/*client.py",
r"(\s+)\*\*YAML Example\*\*\s+::",
"\n\g<1>**YAML Example**::\n",
)
s.replace(
"google/**/*client.py",
r"(\s+)For a description of IAM and its features, see",
"\n\g<0>",
)
# Rename `format_` to `format` to avoid breaking change
s.replace(library / "google/**/types/*.py",
"format_",
"format"
)

# Rename `format_` to `format` to avoid breaking change
s.replace(
"google/**/types/*.py",
"format_",
"format"
)
s.move(library, excludes=["README.rst", "setup.py", "nox*.py", "docs/index.rst"])

s.remove_staging_dirs()

# ----------------------------------------------------------------------------
# Add templated files
Expand Down
5 changes: 4 additions & 1 deletion packages/google-cloud-kms/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"extends": [
"config:base", ":preserveSemverRanges"
],
"ignorePaths": [".pre-commit-config.yaml"]
"ignorePaths": [".pre-commit-config.yaml"],
"pip_requirements": {
"fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"]
}
}
145 changes: 0 additions & 145 deletions packages/google-cloud-kms/synth.metadata

This file was deleted.

0 comments on commit 31fcfa5

Please sign in to comment.