Skip to content

Commit bf00c56

Browse files
feat: Add optional field "SourceFetcher" to choose source fetcher tool (#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>
1 parent 8971b02 commit bf00c56

File tree

4 files changed

+41
-13
lines changed

4 files changed

+41
-13
lines changed

packages/google-cloud-build/CONTRIBUTING.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@ Using a Development Checkout
3535
You'll have to create a development environment using a Git checkout:
3636

3737
- While logged into your GitHub account, navigate to the
38-
``python-cloudbuild`` `repo`_ on GitHub.
38+
``google-cloud-python`` `repo`_ on GitHub.
3939

40-
- Fork and clone the ``python-cloudbuild`` repository to your GitHub account by
40+
- Fork and clone the ``google-cloud-python`` repository to your GitHub account by
4141
clicking the "Fork" button.
4242

43-
- Clone your fork of ``python-cloudbuild`` from your GitHub account to your local
43+
- Clone your fork of ``google-cloud-python`` from your GitHub account to your local
4444
computer, substituting your account username and specifying the destination
45-
as ``hack-on-python-cloudbuild``. E.g.::
45+
as ``hack-on-google-cloud-python``. E.g.::
4646

4747
$ cd ${HOME}
48-
$ git clone [email protected]:USERNAME/python-cloudbuild.git hack-on-python-cloudbuild
49-
$ cd hack-on-python-cloudbuild
50-
# Configure remotes such that you can pull changes from the googleapis/python-cloudbuild
48+
$ git clone [email protected]:USERNAME/google-cloud-python.git hack-on-google-cloud-python
49+
$ cd hack-on-google-cloud-python
50+
# Configure remotes such that you can pull changes from the googleapis/google-cloud-python
5151
# repository into your local repository.
52-
$ git remote add upstream [email protected]:googleapis/python-cloudbuild.git
52+
$ git remote add upstream [email protected]:googleapis/google-cloud-python.git
5353
# fetch and merge changes from upstream into main
5454
$ git fetch upstream
5555
$ git merge upstream/main
@@ -60,7 +60,7 @@ repo, from which you can submit a pull request.
6060
To work on the codebase and run the tests, we recommend using ``nox``,
6161
but you can also use a ``virtualenv`` of your own creation.
6262

63-
.. _repo: https://github.com/googleapis/python-cloudbuild
63+
.. _repo: https://github.com/googleapis/google-cloud-python
6464

6565
Using ``nox``
6666
=============
@@ -113,7 +113,7 @@ Coding Style
113113
export GOOGLE_CLOUD_TESTING_BRANCH="main"
114114

115115
By doing this, you are specifying the location of the most up-to-date
116-
version of ``python-cloudbuild``. The
116+
version of ``google-cloud-python``. The
117117
remote name ``upstream`` should point to the official ``googleapis``
118118
checkout and the branch should be the default branch on that remote (``main``).
119119

@@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the
209209
``README``. Due to the reStructuredText (``rst``) parser used by
210210
PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst``
211211
instead of
212-
``https://github.com/googleapis/python-cloudbuild/blob/main/CONTRIBUTING.rst``)
212+
``https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst``)
213213
may cause problems creating links or rendering the description.
214214

215215
.. _description on PyPI: https://pypi.org/project/google-cloud-build
@@ -236,7 +236,7 @@ We support:
236236

237237
Supported versions can be found in our ``noxfile.py`` `config`_.
238238

239-
.. _config: https://github.com/googleapis/python-cloudbuild/blob/main/packages/google-cloud-build/noxfile.py
239+
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-build/noxfile.py
240240

241241

242242
**********

packages/google-cloud-build/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
html_theme_options = {
157157
"description": "Google Cloud Client Libraries for google-cloud-build",
158158
"github_user": "googleapis",
159-
"github_repo": "python-cloudbuild",
159+
"github_repo": "google-cloud-python",
160160
"github_banner": True,
161161
"font_family": "'Roboto', Georgia, sans",
162162
"head_font_family": "'Roboto', Georgia, serif",

packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/types/cloudbuild.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,28 @@ class StorageSource(proto.Message):
175175
Cloud Storage generation for the object. If
176176
the generation is omitted, the latest generation
177177
will be used.
178+
source_fetcher (google.cloud.devtools.cloudbuild_v1.types.StorageSource.SourceFetcher):
179+
Option to specify the tool to fetch the
180+
source file for the build.
178181
"""
179182

183+
class SourceFetcher(proto.Enum):
184+
r"""Specifies the tool to fetch the source file for the build.
185+
186+
Values:
187+
SOURCE_FETCHER_UNSPECIFIED (0):
188+
Unspecified. Defaults to GSUTIL.
189+
GSUTIL (1):
190+
Use the "gsutil" tool to download the source
191+
file.
192+
GCS_FETCHER (2):
193+
Use the Cloud Storage Fetcher tool to
194+
download the source file.
195+
"""
196+
SOURCE_FETCHER_UNSPECIFIED = 0
197+
GSUTIL = 1
198+
GCS_FETCHER = 2
199+
180200
bucket: str = proto.Field(
181201
proto.STRING,
182202
number=1,
@@ -189,6 +209,11 @@ class StorageSource(proto.Message):
189209
proto.INT64,
190210
number=3,
191211
)
212+
source_fetcher: SourceFetcher = proto.Field(
213+
proto.ENUM,
214+
number=5,
215+
enum=SourceFetcher,
216+
)
192217

193218

194219
class GitSource(proto.Message):

packages/google-cloud-build/tests/unit/gapic/cloudbuild_v1/test_cloud_build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5251,6 +5251,7 @@ def test_create_build_rest(request_type):
52515251
"bucket": "bucket_value",
52525252
"object_": "object__value",
52535253
"generation": 1068,
5254+
"source_fetcher": 1,
52545255
},
52555256
"repo_source": {
52565257
"project_id": "project_id_value",
@@ -7277,6 +7278,7 @@ def test_create_build_trigger_rest(request_type):
72777278
"bucket": "bucket_value",
72787279
"object_": "object__value",
72797280
"generation": 1068,
7281+
"source_fetcher": 1,
72807282
},
72817283
"repo_source": {},
72827284
"git_source": {
@@ -8798,6 +8800,7 @@ def test_update_build_trigger_rest(request_type):
87988800
"bucket": "bucket_value",
87998801
"object_": "object__value",
88008802
"generation": 1068,
8803+
"source_fetcher": 1,
88018804
},
88028805
"repo_source": {},
88038806
"git_source": {

0 commit comments

Comments
 (0)