Skip to content

Commit 900b485

Browse files
authored
feat: update to the latest version of the code generator (#147)
The compute protos are now [available in googleapis/googleapis](https://github.com/googleapis/googleapis/tree/master/google/cloud/compute/v1), and the generated code is also available in googleapis/googleapis-gen [here](https://github.com/googleapis/googleapis-gen/tree/master/google/cloud/compute/v1/compute-small-v1-py). This PR pulls in the latest version of the generated client from googleapis-gen, which may have significant differences. I've added the `do not merge` label while we discuss whether any differences could break user code. This PR also deletes `synth.py` and adds configuration files for owl bot. owl bot will save time for maintainers as it will automatically open PRs when there are updates in googleapis-gen without requiring maintainers to run synthtool to build the client from protos. Additionally, similar to autosynth, PRs will be automatically opened when there are updates to templated files. fix(deps): require google-api-core >=2.2.0 fix(deps): require proto-plus >=1.19.7 docs: list oneofs in docstring fix: add 'dict' annotation type to 'request' feat: support self-signed JWT flow for service accounts chore(samples): Merging usage bucket tests into one, to avoid race conditions
1 parent 27d95f1 commit 900b485

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

compute/compute/snippets/sample_default_values.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ def disable_usage_export(project_id: str) -> None:
112112
"""
113113
projects_client = compute_v1.ProjectsClient()
114114

115-
# Updating the setting with None will disable the
116-
# usage report generation.
115+
# Setting `usage_export_location_resource` to an
116+
# empty object will disable the usage report generation.
117117
operation = projects_client.set_usage_export_bucket(
118-
project=project_id, usage_export_location_resource=None)
118+
project=project_id, usage_export_location_resource={})
119119

120120
op_client = compute_v1.GlobalOperationsClient()
121121

compute/compute/snippets/test_sample_default_values.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ def test_set_usage_export_bucket_default(capsys: typing.Any,
5151
assert(uel.bucket_name == '')
5252
assert(uel.report_name_prefix == '')
5353

54-
55-
def test_set_usage_export_bucket_custom(capsys: typing.Any,
56-
temp_bucket: storage.Bucket) -> None:
54+
# Testing setting a custom export bucket. Keeping this in one test function
55+
# to avoid race conditions, as this is a global setting for the project.
5756
set_usage_export_bucket(project_id=PROJECT, bucket_name=temp_bucket.name,
5857
report_name_prefix=TEST_PREFIX)
5958
time.sleep(5) # To make sure the settings are properly updated

0 commit comments

Comments
 (0)