From bf00c5668231c5cbe839def93a210ceac5dd671d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 21:21:40 -0400 Subject: [PATCH] feat: Add optional field "SourceFetcher" to choose source fetcher tool (#11965) - [ ] Regenerate this pull request now. Committer: @ronanww PiperOrigin-RevId: 578565021 Source-Link: https://github.com/googleapis/googleapis/commit/1bb99dc2e2a7b4d6a3237f206a87bec81a8f0714 Source-Link: https://github.com/googleapis/googleapis-gen/commit/19c44b3311121573e43fe89bbc8ae0a6ffa15548 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJ1aWxkLy5Pd2xCb3QueWFtbCIsImgiOiIxOWM0NGIzMzExMTIxNTczZTQzZmU4OWJiYzhhZTBhNmZmYTE1NTQ4In0= --------- Co-authored-by: Owl Bot --- packages/google-cloud-build/CONTRIBUTING.rst | 24 +++++++++--------- packages/google-cloud-build/docs/conf.py | 2 +- .../cloudbuild_v1/types/cloudbuild.py | 25 +++++++++++++++++++ .../gapic/cloudbuild_v1/test_cloud_build.py | 3 +++ 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/packages/google-cloud-build/CONTRIBUTING.rst b/packages/google-cloud-build/CONTRIBUTING.rst index 9340ffe59fe0..b38835585c28 100644 --- a/packages/google-cloud-build/CONTRIBUTING.rst +++ b/packages/google-cloud-build/CONTRIBUTING.rst @@ -35,21 +35,21 @@ Using a Development Checkout You'll have to create a development environment using a Git checkout: - While logged into your GitHub account, navigate to the - ``python-cloudbuild`` `repo`_ on GitHub. + ``google-cloud-python`` `repo`_ on GitHub. -- Fork and clone the ``python-cloudbuild`` repository to your GitHub account by +- Fork and clone the ``google-cloud-python`` repository to your GitHub account by clicking the "Fork" button. -- Clone your fork of ``python-cloudbuild`` from your GitHub account to your local +- Clone your fork of ``google-cloud-python`` from your GitHub account to your local computer, substituting your account username and specifying the destination - as ``hack-on-python-cloudbuild``. E.g.:: + as ``hack-on-google-cloud-python``. E.g.:: $ cd ${HOME} - $ git clone git@github.com:USERNAME/python-cloudbuild.git hack-on-python-cloudbuild - $ cd hack-on-python-cloudbuild - # Configure remotes such that you can pull changes from the googleapis/python-cloudbuild + $ git clone git@github.com:USERNAME/google-cloud-python.git hack-on-google-cloud-python + $ cd hack-on-google-cloud-python + # Configure remotes such that you can pull changes from the googleapis/google-cloud-python # repository into your local repository. - $ git remote add upstream git@github.com:googleapis/python-cloudbuild.git + $ git remote add upstream git@github.com:googleapis/google-cloud-python.git # fetch and merge changes from upstream into main $ git fetch upstream $ git merge upstream/main @@ -60,7 +60,7 @@ repo, from which you can submit a pull request. To work on the codebase and run the tests, we recommend using ``nox``, but you can also use a ``virtualenv`` of your own creation. -.. _repo: https://github.com/googleapis/python-cloudbuild +.. _repo: https://github.com/googleapis/google-cloud-python Using ``nox`` ============= @@ -113,7 +113,7 @@ Coding Style export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-cloudbuild``. The + version of ``google-cloud-python``. The remote name ``upstream`` should point to the official ``googleapis`` checkout and the branch should be the default branch on that remote (``main``). @@ -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-cloudbuild/blob/main/CONTRIBUTING.rst``) +``https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-build @@ -236,7 +236,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-cloudbuild/blob/main/packages/google-cloud-build/noxfile.py +.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-build/noxfile.py ********** diff --git a/packages/google-cloud-build/docs/conf.py b/packages/google-cloud-build/docs/conf.py index 6b7ae66d22a4..cc107bc88d72 100644 --- a/packages/google-cloud-build/docs/conf.py +++ b/packages/google-cloud-build/docs/conf.py @@ -156,7 +156,7 @@ html_theme_options = { "description": "Google Cloud Client Libraries for google-cloud-build", "github_user": "googleapis", - "github_repo": "python-cloudbuild", + "github_repo": "google-cloud-python", "github_banner": True, "font_family": "'Roboto', Georgia, sans", "head_font_family": "'Roboto', Georgia, serif", diff --git a/packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/types/cloudbuild.py b/packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/types/cloudbuild.py index 94526a5a295b..5dee1f28dc9f 100644 --- a/packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/types/cloudbuild.py +++ b/packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/types/cloudbuild.py @@ -175,8 +175,28 @@ class StorageSource(proto.Message): Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used. + source_fetcher (google.cloud.devtools.cloudbuild_v1.types.StorageSource.SourceFetcher): + Option to specify the tool to fetch the + source file for the build. """ + class SourceFetcher(proto.Enum): + r"""Specifies the tool to fetch the source file for the build. + + Values: + SOURCE_FETCHER_UNSPECIFIED (0): + Unspecified. Defaults to GSUTIL. + GSUTIL (1): + Use the "gsutil" tool to download the source + file. + GCS_FETCHER (2): + Use the Cloud Storage Fetcher tool to + download the source file. + """ + SOURCE_FETCHER_UNSPECIFIED = 0 + GSUTIL = 1 + GCS_FETCHER = 2 + bucket: str = proto.Field( proto.STRING, number=1, @@ -189,6 +209,11 @@ class StorageSource(proto.Message): proto.INT64, number=3, ) + source_fetcher: SourceFetcher = proto.Field( + proto.ENUM, + number=5, + enum=SourceFetcher, + ) class GitSource(proto.Message): diff --git a/packages/google-cloud-build/tests/unit/gapic/cloudbuild_v1/test_cloud_build.py b/packages/google-cloud-build/tests/unit/gapic/cloudbuild_v1/test_cloud_build.py index 7a0d2c52b81a..aa147f46d982 100644 --- a/packages/google-cloud-build/tests/unit/gapic/cloudbuild_v1/test_cloud_build.py +++ b/packages/google-cloud-build/tests/unit/gapic/cloudbuild_v1/test_cloud_build.py @@ -5251,6 +5251,7 @@ def test_create_build_rest(request_type): "bucket": "bucket_value", "object_": "object__value", "generation": 1068, + "source_fetcher": 1, }, "repo_source": { "project_id": "project_id_value", @@ -7277,6 +7278,7 @@ def test_create_build_trigger_rest(request_type): "bucket": "bucket_value", "object_": "object__value", "generation": 1068, + "source_fetcher": 1, }, "repo_source": {}, "git_source": { @@ -8798,6 +8800,7 @@ def test_update_build_trigger_rest(request_type): "bucket": "bucket_value", "object_": "object__value", "generation": 1068, + "source_fetcher": 1, }, "repo_source": {}, "git_source": {