Skip to content

Commit

Permalink
feat: Add optional field "SourceFetcher" to choose source fetcher tool (
Browse files Browse the repository at this point in the history
#11965)

- [ ] Regenerate this pull request now.

Committer: @ronanww
PiperOrigin-RevId: 578565021

Source-Link:
googleapis/googleapis@1bb99dc

Source-Link:
googleapis/googleapis-gen@19c44b3
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJ1aWxkLy5Pd2xCb3QueWFtbCIsImgiOiIxOWM0NGIzMzExMTIxNTczZTQzZmU4OWJiYzhhZTBhNmZmYTE1NTQ4In0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 2, 2023
1 parent 8971b02 commit bf00c56
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
24 changes: 12 additions & 12 deletions packages/google-cloud-build/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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``
=============
Expand Down Expand Up @@ -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``).

Expand Down Expand Up @@ -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
Expand All @@ -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


**********
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-build/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit bf00c56

Please sign in to comment.