From 8e45181420f81dae463f1f06e820610a62c949c3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:55:16 +0000 Subject: [PATCH 1/7] chore(python): avoid `.nox` directories when building docs (#69) Source-Link: https://github.com/googleapis/synthtool/commit/7e1f6da50524b5d98eb67adbf6dd0805df54233d Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7..b771c37 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + digest: sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d diff --git a/docs/conf.py b/docs/conf.py index 5da91a5..835bba5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -110,6 +110,7 @@ # directories to ignore when looking for source files. exclude_patterns = [ "_build", + "**/.nox/**/*", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", "samples/snippets/README.rst", From 9968fb3df25504964830aedf252e09f94c7a0659 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:13:33 -0400 Subject: [PATCH 2/7] chore: drop mention of Python 2.7 from templates (#70) Source-Link: https://github.com/googleapis/synthtool/commit/facee4cc1ea096cd8bcc008bb85929daa7c414c0 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- noxfile.py | 12 +++++++++--- scripts/readme-gen/templates/install_deps.tmpl.rst | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b771c37..a9fcd07 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d + digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 diff --git a/noxfile.py b/noxfile.py index 94ee6a8..93ea9b1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406db..275d649 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash From 8acb90974f02833a8cf46724fab163e41b9da630 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Wed, 18 Aug 2021 07:40:49 -0600 Subject: [PATCH 3/7] chore: generate python samples templates in owlbot.py (#71) Generate python samples templates in owlbot.py --- owlbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owlbot.py b/owlbot.py index 25fab74..3e536b4 100644 --- a/owlbot.py +++ b/owlbot.py @@ -32,6 +32,7 @@ # Add templated files # ---------------------------------------------------------------------------- templated_files = common.py_library(cov_level=99, microgenerator=True) +python.py_samples(skip_readmes=True) s.move( templated_files, excludes=[".coveragerc"] ) # the microgenerator has a good coveragerc file From b62f7c720d198741673cc93d452d0ac9067cd3c3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 26 Aug 2021 18:30:31 +0000 Subject: [PATCH 4/7] feat: Add Canada regions and support compliance regime (#73) - [ ] Regenerate this pull request now. Committer: @ketanbshah PiperOrigin-RevId: 393142547 Source-Link: https://github.com/googleapis/googleapis/commit/4b6bb3dede843b93353dbebfee4d2758aeede96f Source-Link: https://github.com/googleapis/googleapis-gen/commit/f70128ac218486074082e7ffcbb2546afe866db9 fix: ResourceType CONSUMER_PROJECT is deprecated feat: ResourceType CONSUMER_FOLDER and KEYRING are added feat: display_name is added to ResourceSettings fix: billing_account is now optional in Workload feat: resource_settings is added to CreateWorkloadOperationMetadata --- .../types/assuredworkloads_v1beta1.py | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/google/cloud/assuredworkloads_v1beta1/types/assuredworkloads_v1beta1.py b/google/cloud/assuredworkloads_v1beta1/types/assuredworkloads_v1beta1.py index 2e651e9..9fc3daa 100644 --- a/google/cloud/assuredworkloads_v1beta1/types/assuredworkloads_v1beta1.py +++ b/google/cloud/assuredworkloads_v1beta1/types/assuredworkloads_v1beta1.py @@ -181,12 +181,12 @@ class Workload(proto.Message): Output only. Immutable. The Workload creation timestamp. billing_account (str): - Required. Input only. The billing account used for the - resources which are direct children of workload. This - billing account is initially associated with the resources - created as part of Workload creation. After the initial - creation of these resources, the customer can change the - assigned billing account. The resource name has the form + Input only. The billing account used for the resources which + are direct children of workload. This billing account is + initially associated with the resources created as part of + Workload creation. After the initial creation of these + resources, the customer can change the assigned billing + account. The resource name has the form ``billingAccounts/{billing_account_id}``. For example, ``billingAccounts/012345-567890-ABCDEF``. il4_settings (google.cloud.assuredworkloads_v1beta1.types.Workload.IL4Settings): @@ -211,11 +211,10 @@ class Workload(proto.Message): Optional. Labels applied to the workload. provisioned_resources_parent (str): Input only. The parent resource for the resources managed by - this Assured Workload. May be either an organization or a - folder. Must be the same or a child of the Workload parent. - If not specified all resources are created under the - Workload parent. Formats: folders/{folder_id} - organizations/{organization_id} + this Assured Workload. May be either empty or a folder + resource which is a child of the Workload parent. If not + specified all resources are created under the parent + organization. Format: folders/{folder_id} kms_settings (google.cloud.assuredworkloads_v1beta1.types.Workload.KMSSettings): Input only. Settings used to create a CMEK crypto key. When set a project with a KMS CMEK @@ -240,6 +239,7 @@ class ComplianceRegime(proto.Enum): HIPAA = 6 HITRUST = 7 EU_REGIONS_AND_SUPPORT = 8 + CA_REGIONS_AND_SUPPORT = 9 class ResourceInfo(proto.Message): r"""Represent the resources that are children of this Workload. @@ -255,7 +255,9 @@ class ResourceType(proto.Enum): r"""The type of resource.""" RESOURCE_TYPE_UNSPECIFIED = 0 CONSUMER_PROJECT = 1 + CONSUMER_FOLDER = 4 ENCRYPTION_KEYS_PROJECT = 2 + KEYRING = 3 resource_id = proto.Field(proto.INT64, number=1,) resource_type = proto.Field( @@ -345,12 +347,17 @@ class ResourceSettings(proto.Message): Indicates the type of resource. This field should be specified to correspond the id to the right project type (CONSUMER_PROJECT or ENCRYPTION_KEYS_PROJECT) + display_name (str): + User-assigned resource display name. + If not empty it will be used to create a + resource with the specified name. """ resource_id = proto.Field(proto.STRING, number=1,) resource_type = proto.Field( proto.ENUM, number=2, enum="Workload.ResourceInfo.ResourceType", ) + display_name = proto.Field(proto.STRING, number=3,) name = proto.Field(proto.STRING, number=1,) display_name = proto.Field(proto.STRING, number=2,) @@ -405,6 +412,10 @@ class CreateWorkloadOperationMetadata(proto.Message): Optional. Compliance controls that should be applied to the resources managed by the workload. + resource_settings (Sequence[google.cloud.assuredworkloads_v1beta1.types.Workload.ResourceSettings]): + Optional. Resource properties in the input + that are used for creating/customizing workload + resources. """ create_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) @@ -413,6 +424,9 @@ class CreateWorkloadOperationMetadata(proto.Message): compliance_regime = proto.Field( proto.ENUM, number=4, enum="Workload.ComplianceRegime", ) + resource_settings = proto.RepeatedField( + proto.MESSAGE, number=5, message="Workload.ResourceSettings", + ) __all__ = tuple(sorted(__protobuf__.manifest)) From 2e9f52736e723787bcfa64e150452410591d6eb5 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 27 Aug 2021 12:58:47 -0400 Subject: [PATCH 5/7] chore: migrate default branch from master to main (#75) --- .kokoro/build.sh | 2 +- .kokoro/test-samples-impl.sh | 2 +- CONTRIBUTING.rst | 12 ++++---- docs/conf.py | 10 +++---- owlbot.py | 53 ++++++++++++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 13 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 5a1825c..3c8ff8e 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox python3 -m nox --version # If this is a continuous build, send the test log to the FlakyBot. -# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then cleanup() { chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d5..8a324c9 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do EXIT=$? # If this is a periodic build, send the test log to the FlakyBot. - # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. + # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 7662bad..206709f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout: # Configure remotes such that you can pull changes from the googleapis/python-assured-workloads # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-assured-workloads.git - # fetch and merge changes from upstream into master + # fetch and merge changes from upstream into main $ git fetch upstream - $ git merge upstream/master + $ git merge upstream/main Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. @@ -110,12 +110,12 @@ Coding Style variables:: export GOOGLE_CLOUD_TESTING_REMOTE="upstream" - export GOOGLE_CLOUD_TESTING_BRANCH="master" + export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date version of ``python-assured-workloads``. The the suggested remote name ``upstream`` should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``master``). + the branch should be the main branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-assured-workloads/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-assured-workloads/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-assured-workloads @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-assured-workloads/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-assured-workloads/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/docs/conf.py b/docs/conf.py index 835bba5..497b6d2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,8 +76,8 @@ # The encoding of source files. # source_encoding = 'utf-8-sig' -# The master toctree document. -master_doc = "index" +# The root toctree document. +root_doc = "index" # General information about the project. project = "google-cloud-assured-workloads" @@ -280,7 +280,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( - master_doc, + root_doc, "google-cloud-assured-workloads.tex", "google-cloud-assured-workloads Documentation", author, @@ -315,7 +315,7 @@ # (source start file, name, description, authors, manual section). man_pages = [ ( - master_doc, + root_doc, "google-cloud-assured-workloads", "google-cloud-assured-workloads Documentation", [author], @@ -334,7 +334,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + root_doc, "google-cloud-assured-workloads", "google-cloud-assured-workloads Documentation", author, diff --git a/owlbot.py b/owlbot.py index 3e536b4..2f94977 100644 --- a/owlbot.py +++ b/owlbot.py @@ -36,6 +36,59 @@ s.move( templated_files, excludes=[".coveragerc"] ) # the microgenerator has a good coveragerc file +# Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged + +# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files +s.replace(".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main") + +# Customize CONTRIBUTING.rst to replace master with main +s.replace( + "CONTRIBUTING.rst", + "fetch and merge changes from upstream into master", + "fetch and merge changes from upstream into main", +) + +s.replace( + "CONTRIBUTING.rst", + "git merge upstream/master", + "git merge upstream/main", +) + +s.replace( + "CONTRIBUTING.rst", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""", +) + +s.replace( + "CONTRIBUTING.rst", + "remote \(``master``\)", + "remote (``main``)", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/CONTRIBUTING.rst", + "blob/main/CONTRIBUTING.rst", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/noxfile.py", + "blob/main/noxfile.py", +) + +s.replace( + "docs/conf.py", + "master_doc", + "root_doc", +) + +s.replace( + "docs/conf.py", + "# The master toctree document.", + "# The root toctree document.", +) s.shell.run(["nox", "-s", "blacken"], hide_output=False) From ab611dad3e0647e671bf08f036f3c626ea43a323 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 15:26:41 +0000 Subject: [PATCH 6/7] chore(python): disable dependency dashboard (#76) --- .github/.OwlBot.lock.yaml | 2 +- renovate.json | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a9fcd07..b75186c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 + digest: sha256:d6761eec279244e57fe9d21f8343381a01d3632c034811a72f68b83119e58c69 diff --git a/renovate.json b/renovate.json index c048955..9fa8816 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,8 @@ { "extends": [ - "config:base", ":preserveSemverRanges" + "config:base", + ":preserveSemverRanges", + ":disableDependencyDashboard" ], "ignorePaths": [".pre-commit-config.yaml"], "pip_requirements": { From e560eac7d9aef055f72a0f6999af12eff6ddaa2c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 10:00:35 +0000 Subject: [PATCH 7/7] chore: release 0.6.0 (#74) :robot: I have created a release \*beep\* \*boop\* --- ## [0.6.0](https://www.github.com/googleapis/python-assured-workloads/compare/v0.5.0...v0.6.0) (2021-08-30) ### Features * Add Canada regions and support compliance regime ([#73](https://www.github.com/googleapis/python-assured-workloads/issues/73)) ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) * display_name is added to ResourceSettings ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) * resource_settings is added to CreateWorkloadOperationMetadata ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) * ResourceType CONSUMER_FOLDER and KEYRING are added ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) ### Bug Fixes * billing_account is now optional in Workload ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) * ResourceType CONSUMER_PROJECT is deprecated ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 16 ++++++++++++++++ setup.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba7ef7d..1c71523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [0.6.0](https://www.github.com/googleapis/python-assured-workloads/compare/v0.5.0...v0.6.0) (2021-08-30) + + +### Features + +* Add Canada regions and support compliance regime ([#73](https://www.github.com/googleapis/python-assured-workloads/issues/73)) ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) +* display_name is added to ResourceSettings ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) +* resource_settings is added to CreateWorkloadOperationMetadata ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) +* ResourceType CONSUMER_FOLDER and KEYRING are added ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) + + +### Bug Fixes + +* billing_account is now optional in Workload ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) +* ResourceType CONSUMER_PROJECT is deprecated ([b62f7c7](https://www.github.com/googleapis/python-assured-workloads/commit/b62f7c720d198741673cc93d452d0ac9067cd3c3)) + ## [0.5.0](https://www.github.com/googleapis/python-assured-workloads/compare/v0.4.2...v0.5.0) (2021-07-28) diff --git a/setup.py b/setup.py index 762ebc4..b9ad5bb 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "0.5.0" +version = "0.6.0" package_root = os.path.abspath(os.path.dirname(__file__))