Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
chore: migrate to owl bot (#13)
Browse files Browse the repository at this point in the history
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.

fix: add async client
chore: add autogenerated snippets
chore: remove auth, policy, and options from the reserved names list
feat: support self-signed JWT flow for service accounts
chore: enable GAPIC metadata generation
  • Loading branch information
parthea committed May 15, 2021
1 parent 4a7df0b commit cb785b5
Show file tree
Hide file tree
Showing 33 changed files with 1,303 additions and 1,058 deletions.
4 changes: 4 additions & 0 deletions .github/.OwlBot.lock.yaml
@@ -0,0 +1,4 @@
docker:
digest: sha256:457583330eec64daa02aeb7a72a04d33e7be2428f646671ce4045dcbc0191b1e
image: gcr.io/repo-automation-bots/owlbot-python:latest

26 changes: 26 additions & 0 deletions .github/.OwlBot.yaml
@@ -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/api/servicemanagement/(v.*)/.*-py/(.*)
dest: /owl-bot-staging/$1/$2

begin-after-commit-hash: 6acf4a0a797f1082027985c55c4b14b60f673dd7

2 changes: 1 addition & 1 deletion .github/header-checker-lint.yml
@@ -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 .kokoro/release.sh
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-service-management
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 .kokoro/release/common.cfg
Expand Up @@ -23,18 +23,8 @@ env_vars: {
value: "github/python-service-management/.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"
}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -26,6 +26,6 @@ repos:
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.1
hooks:
- id: flake8
16 changes: 1 addition & 15 deletions CONTRIBUTING.rst
Expand Up @@ -160,21 +160,7 @@ Running System Tests
auth settings and change some configuration in your project to
run all the tests.

- System tests will be run against an actual project and
so you'll need to provide some environment variables to facilitate
authentication to your project:

- ``GOOGLE_APPLICATION_CREDENTIALS``: The path to a JSON key file;
Such a file can be downloaded directly from the developer's console by clicking
"Generate new JSON key". See private key
`docs <https://cloud.google.com/storage/docs/authentication#generating-a-private-key>`__
for more details.

- Once you have downloaded your json keys, set the environment variable
``GOOGLE_APPLICATION_CREDENTIALS`` to the absolute path of the json file::

$ export GOOGLE_APPLICATION_CREDENTIALS="/Users/<your_username>/path/to/app_credentials.json"

- System tests will be run against an actual project. You should use local credentials from gcloud when possible. See `Best practices for application authentication <https://cloud.google.com/docs/authentication/best-practices-applications#local_development_and_testing_with_the>`__. Some tests require a service account. For those tests see `Authenticating as a service account <https://cloud.google.com/docs/authentication/production>`__.

*************
Test Coverage
Expand Down
13 changes: 12 additions & 1 deletion docs/_static/custom.css
@@ -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
}
1 change: 0 additions & 1 deletion docs/servicemanagement_v1/service_manager.rst
Expand Up @@ -5,7 +5,6 @@ ServiceManager
:members:
:inherited-members:


.. automodule:: google.cloud.servicemanagement_v1.services.service_manager.pagers
:members:
:inherited-members:
20 changes: 10 additions & 10 deletions google/cloud/servicemanagement/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,12 +14,13 @@
# limitations under the License.
#

from google.cloud.servicemanagement_v1.services.service_manager.async_client import (
ServiceManagerAsyncClient,
)
from google.cloud.servicemanagement_v1.services.service_manager.client import (
ServiceManagerClient,
)
from google.cloud.servicemanagement_v1.services.service_manager.async_client import (
ServiceManagerAsyncClient,
)

from google.cloud.servicemanagement_v1.types.resources import ChangeReport
from google.cloud.servicemanagement_v1.types.resources import ConfigFile
from google.cloud.servicemanagement_v1.types.resources import ConfigRef
Expand Down Expand Up @@ -84,15 +84,20 @@
)

__all__ = (
"ServiceManagerClient",
"ServiceManagerAsyncClient",
"ChangeReport",
"ConfigFile",
"ConfigRef",
"ConfigSource",
"Diagnostic",
"ManagedService",
"OperationMetadata",
"Rollout",
"CreateServiceConfigRequest",
"CreateServiceRequest",
"CreateServiceRolloutRequest",
"DeleteServiceRequest",
"Diagnostic",
"DisableServiceRequest",
"DisableServiceResponse",
"EnableServiceRequest",
Expand All @@ -108,11 +113,6 @@
"ListServiceRolloutsResponse",
"ListServicesRequest",
"ListServicesResponse",
"ManagedService",
"OperationMetadata",
"Rollout",
"ServiceManagerAsyncClient",
"ServiceManagerClient",
"SubmitConfigSourceRequest",
"SubmitConfigSourceResponse",
"UndeleteServiceRequest",
Expand Down
7 changes: 4 additions & 3 deletions google/cloud/servicemanagement_v1/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,6 +15,8 @@
#

from .services.service_manager import ServiceManagerClient
from .services.service_manager import ServiceManagerAsyncClient

from .types.resources import ChangeReport
from .types.resources import ConfigFile
from .types.resources import ConfigRef
Expand Down Expand Up @@ -48,8 +49,8 @@
from .types.servicemanager import UndeleteServiceRequest
from .types.servicemanager import UndeleteServiceResponse


__all__ = (
"ServiceManagerAsyncClient",
"ChangeReport",
"ConfigFile",
"ConfigRef",
Expand Down Expand Up @@ -77,9 +78,9 @@
"ManagedService",
"OperationMetadata",
"Rollout",
"ServiceManagerClient",
"SubmitConfigSourceRequest",
"SubmitConfigSourceResponse",
"UndeleteServiceRequest",
"UndeleteServiceResponse",
"ServiceManagerClient",
)
173 changes: 173 additions & 0 deletions google/cloud/servicemanagement_v1/gapic_metadata.json
@@ -0,0 +1,173 @@
{
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
"language": "python",
"libraryPackage": "google.cloud.servicemanagement_v1",
"protoPackage": "google.api.servicemanagement.v1",
"schema": "1.0",
"services": {
"ServiceManager": {
"clients": {
"grpc": {
"libraryClient": "ServiceManagerClient",
"rpcs": {
"CreateService": {
"methods": [
"create_service"
]
},
"CreateServiceConfig": {
"methods": [
"create_service_config"
]
},
"CreateServiceRollout": {
"methods": [
"create_service_rollout"
]
},
"DeleteService": {
"methods": [
"delete_service"
]
},
"DisableService": {
"methods": [
"disable_service"
]
},
"EnableService": {
"methods": [
"enable_service"
]
},
"GenerateConfigReport": {
"methods": [
"generate_config_report"
]
},
"GetService": {
"methods": [
"get_service"
]
},
"GetServiceConfig": {
"methods": [
"get_service_config"
]
},
"GetServiceRollout": {
"methods": [
"get_service_rollout"
]
},
"ListServiceConfigs": {
"methods": [
"list_service_configs"
]
},
"ListServiceRollouts": {
"methods": [
"list_service_rollouts"
]
},
"ListServices": {
"methods": [
"list_services"
]
},
"SubmitConfigSource": {
"methods": [
"submit_config_source"
]
},
"UndeleteService": {
"methods": [
"undelete_service"
]
}
}
},
"grpc-async": {
"libraryClient": "ServiceManagerAsyncClient",
"rpcs": {
"CreateService": {
"methods": [
"create_service"
]
},
"CreateServiceConfig": {
"methods": [
"create_service_config"
]
},
"CreateServiceRollout": {
"methods": [
"create_service_rollout"
]
},
"DeleteService": {
"methods": [
"delete_service"
]
},
"DisableService": {
"methods": [
"disable_service"
]
},
"EnableService": {
"methods": [
"enable_service"
]
},
"GenerateConfigReport": {
"methods": [
"generate_config_report"
]
},
"GetService": {
"methods": [
"get_service"
]
},
"GetServiceConfig": {
"methods": [
"get_service_config"
]
},
"GetServiceRollout": {
"methods": [
"get_service_rollout"
]
},
"ListServiceConfigs": {
"methods": [
"list_service_configs"
]
},
"ListServiceRollouts": {
"methods": [
"list_service_rollouts"
]
},
"ListServices": {
"methods": [
"list_services"
]
},
"SubmitConfigSource": {
"methods": [
"submit_config_source"
]
},
"UndeleteService": {
"methods": [
"undelete_service"
]
}
}
}
}
}
}
}

0 comments on commit cb785b5

Please sign in to comment.