-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR migrates from autosynth to [owl bot](https://github.com/googleapis/repo-automation-bots/tree/master/packages/owl-bot). owl bot will save time for maintainers as it will automatically open PRs when there are updates in [googleapis-gen](https://github.com/googleapis/googleapis-gen/tree/master/google) without requiring maintainers to run `synthtool` to build the client from protos. Additionally, similar to autosynth, PRs will be automatically opened when there are template updates. With owl bot, on every PR, a post-processor image will run so that we won't have to ask contributors to run [blacken](https://github.com/googleapis/python-monitoring-dashboards/blob/master/synth.py#L80).
- Loading branch information
Showing
8 changed files
with
98 additions
and
268 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/google-cloud-monitoring-dashboards/.github/.OwlBot.lock.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker: | ||
digest: sha256:457583330eec64daa02aeb7a72a04d33e7be2428f646671ce4045dcbc0191b1e | ||
image: gcr.io/repo-automation-bots/owlbot-python:latest | ||
|
26 changes: 26 additions & 0 deletions
26
packages/google-cloud-monitoring-dashboards/.github/.OwlBot.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/monitoring/dashboard/(v.*)/.*-py/(.*) | ||
dest: /owl-bot-staging/$1/$2 | ||
|
||
begin-after-commit-hash: b06c9034cfcbce180ba732d03be6526e5c8ea1bc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ repos: | |
hooks: | ||
- id: black | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.0 | ||
rev: 3.9.1 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# 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 | ||
from synthtool.languages import python | ||
|
||
common = gcp.CommonTemplates() | ||
|
||
default_version = "v1" | ||
|
||
for library in s.get_staging_dirs(default_version): | ||
# Fix namespace | ||
s.replace(library / "google/monitoring/**/*.py", | ||
"google.monitoring.dashboard_{}".format(library.name), | ||
"google.cloud.monitoring_dashboard_{}".format(library.name), | ||
) | ||
|
||
s.replace(library / "tests/unit/gapic/**/*.py", | ||
"google.monitoring.dashboard_{}".format(library.name), | ||
"google.cloud.monitoring_dashboard_{}".format(library.name), | ||
) | ||
s.replace(library / "docs/**/*.rst", | ||
"google.monitoring.dashboard_{}".format(library.name), | ||
"google.cloud.monitoring_dashboard_{}".format(library.name), | ||
) | ||
|
||
s.move(library / "google/cloud/monitoring_dashboard_v1/proto") | ||
s.move(library / "google/monitoring/dashboard", "google/cloud/monitoring_dashboard") | ||
s.move(library / "google/monitoring/dashboard_v1", "google/cloud/monitoring_dashboard_v1") | ||
s.move(library / "tests") | ||
s.move(library / "scripts") | ||
s.move(library / "docs", excludes=["index.rst"]) | ||
|
||
s.remove_staging_dirs() | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Add templated files | ||
# ---------------------------------------------------------------------------- | ||
templated_files = common.py_library( | ||
samples=False, # set to True only if there are samples | ||
microgenerator=True, | ||
cov_level=96 | ||
) | ||
s.move(templated_files, excludes=[".coveragerc"]) # microgenerator has a good .coveragerc file | ||
|
||
|
||
# Temporarily disable warnings due to | ||
# https://github.com/googleapis/gapic-generator-python/issues/525 | ||
s.replace("noxfile.py", '[\"\']-W[\"\']', '# "-W"') | ||
|
||
s.shell.run(["nox", "-s", "blacken"], hide_output=False) |
160 changes: 0 additions & 160 deletions
160
packages/google-cloud-monitoring-dashboards/synth.metadata
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.