Skip to content

Commit eddde49

Browse files
feat(v1): Update third party clodubuild.proto library to include git_source (#400)
* feat: Update third party clodubuild.proto library to include git_source Committer: @monicaliu PiperOrigin-RevId: 524851242 Source-Link: googleapis/googleapis@5333983 Source-Link: googleapis/googleapis-gen@41cced8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDFjY2VkODNmNzU5NGEzOWM1OTBjMzhkYzhjM2Y5MDU5ODVjNjk3OSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent b460e44 commit eddde49

File tree

7 files changed

+93
-2
lines changed

7 files changed

+93
-2
lines changed

packages/google-cloud-build/google/cloud/devtools/cloudbuild/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
from google.cloud.devtools.cloudbuild_v1.types.cloudbuild import GetBuildTriggerRequest
5959
from google.cloud.devtools.cloudbuild_v1.types.cloudbuild import GetWorkerPoolRequest
6060
from google.cloud.devtools.cloudbuild_v1.types.cloudbuild import GitHubEventsConfig
61+
from google.cloud.devtools.cloudbuild_v1.types.cloudbuild import GitSource
6162
from google.cloud.devtools.cloudbuild_v1.types.cloudbuild import Hash
6263
from google.cloud.devtools.cloudbuild_v1.types.cloudbuild import InlineSecret
6364
from google.cloud.devtools.cloudbuild_v1.types.cloudbuild import ListBuildsRequest
@@ -133,6 +134,7 @@
133134
"GetBuildTriggerRequest",
134135
"GetWorkerPoolRequest",
135136
"GitHubEventsConfig",
137+
"GitSource",
136138
"Hash",
137139
"InlineSecret",
138140
"ListBuildsRequest",

packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from .types.cloudbuild import GetBuildTriggerRequest
4747
from .types.cloudbuild import GetWorkerPoolRequest
4848
from .types.cloudbuild import GitHubEventsConfig
49+
from .types.cloudbuild import GitSource
4950
from .types.cloudbuild import Hash
5051
from .types.cloudbuild import InlineSecret
5152
from .types.cloudbuild import ListBuildsRequest
@@ -109,6 +110,7 @@
109110
"GetBuildTriggerRequest",
110111
"GetWorkerPoolRequest",
111112
"GitHubEventsConfig",
113+
"GitSource",
112114
"Hash",
113115
"InlineSecret",
114116
"ListBuildTriggersRequest",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
GetBuildTriggerRequest,
4040
GetWorkerPoolRequest,
4141
GitHubEventsConfig,
42+
GitSource,
4243
Hash,
4344
InlineSecret,
4445
ListBuildsRequest,
@@ -101,6 +102,7 @@
101102
"GetBuildTriggerRequest",
102103
"GetWorkerPoolRequest",
103104
"GitHubEventsConfig",
105+
"GitSource",
104106
"Hash",
105107
"InlineSecret",
106108
"ListBuildsRequest",

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"RetryBuildRequest",
3232
"RunBuildTriggerRequest",
3333
"StorageSource",
34+
"GitSource",
3435
"RepoSource",
3536
"StorageSourceManifest",
3637
"Source",
@@ -186,6 +187,49 @@ class StorageSource(proto.Message):
186187
)
187188

188189

190+
class GitSource(proto.Message):
191+
r"""Location of the source in any accessible Git repository.
192+
193+
Attributes:
194+
url (str):
195+
Location of the Git repo to build.
196+
197+
This will be used as a ``git remote``, see
198+
https://git-scm.com/docs/git-remote.
199+
dir_ (str):
200+
Directory, relative to the source root, in which to run the
201+
build.
202+
203+
This must be a relative path. If a step's ``dir`` is
204+
specified and is an absolute path, this value is ignored for
205+
that step's execution.
206+
revision (str):
207+
The revision to fetch from the Git repository such as a
208+
branch, a tag, a commit SHA, or any Git ref.
209+
210+
Cloud Build uses ``git fetch`` to fetch the revision from
211+
the Git repository; therefore make sure that the string you
212+
provide for ``revision`` is parsable by the command. For
213+
information on string values accepted by ``git fetch``, see
214+
https://git-scm.com/docs/gitrevisions#_specifying_revisions.
215+
For information on ``git fetch``, see
216+
https://git-scm.com/docs/git-fetch.
217+
"""
218+
219+
url: str = proto.Field(
220+
proto.STRING,
221+
number=1,
222+
)
223+
dir_: str = proto.Field(
224+
proto.STRING,
225+
number=5,
226+
)
227+
revision: str = proto.Field(
228+
proto.STRING,
229+
number=6,
230+
)
231+
232+
189233
class RepoSource(proto.Message):
190234
r"""Location of the source in a Google Cloud Source Repository.
191235
@@ -328,6 +372,11 @@ class Source(proto.Message):
328372
If provided, get the source from this
329373
location in a Cloud Source Repository.
330374
375+
This field is a member of `oneof`_ ``source``.
376+
git_source (google.cloud.devtools.cloudbuild_v1.types.GitSource):
377+
If provided, get the source from this Git
378+
repository.
379+
331380
This field is a member of `oneof`_ ``source``.
332381
storage_source_manifest (google.cloud.devtools.cloudbuild_v1.types.StorageSourceManifest):
333382
If provided, get the source from this manifest in Google
@@ -349,6 +398,12 @@ class Source(proto.Message):
349398
oneof="source",
350399
message="RepoSource",
351400
)
401+
git_source: "GitSource" = proto.Field(
402+
proto.MESSAGE,
403+
number=5,
404+
oneof="source",
405+
message="GitSource",
406+
)
352407
storage_source_manifest: "StorageSourceManifest" = proto.Field(
353408
proto.MESSAGE,
354409
number=8,

packages/google-cloud-build/samples/generated_samples/snippet_metadata_google.devtools.cloudbuild.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-build",
11-
"version": "3.14.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-build/samples/generated_samples/snippet_metadata_google.devtools.cloudbuild.v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-build",
11-
"version": "3.14.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5884,6 +5884,11 @@ def test_create_build_rest(request_type):
58845884
"invert_regex": True,
58855885
"substitutions": {},
58865886
},
5887+
"git_source": {
5888+
"url": "url_value",
5889+
"dir_": "dir__value",
5890+
"revision": "revision_value",
5891+
},
58875892
"storage_source_manifest": {
58885893
"bucket": "bucket_value",
58895894
"object_": "object__value",
@@ -6223,6 +6228,11 @@ def test_create_build_rest_bad_request(
62236228
"invert_regex": True,
62246229
"substitutions": {},
62256230
},
6231+
"git_source": {
6232+
"url": "url_value",
6233+
"dir_": "dir__value",
6234+
"revision": "revision_value",
6235+
},
62266236
"storage_source_manifest": {
62276237
"bucket": "bucket_value",
62286238
"object_": "object__value",
@@ -7971,6 +7981,11 @@ def test_create_build_trigger_rest(request_type):
79717981
"generation": 1068,
79727982
},
79737983
"repo_source": {},
7984+
"git_source": {
7985+
"url": "url_value",
7986+
"dir_": "dir__value",
7987+
"revision": "revision_value",
7988+
},
79747989
"storage_source_manifest": {
79757990
"bucket": "bucket_value",
79767991
"object_": "object__value",
@@ -8376,6 +8391,11 @@ def test_create_build_trigger_rest_bad_request(
83768391
"generation": 1068,
83778392
},
83788393
"repo_source": {},
8394+
"git_source": {
8395+
"url": "url_value",
8396+
"dir_": "dir__value",
8397+
"revision": "revision_value",
8398+
},
83798399
"storage_source_manifest": {
83808400
"bucket": "bucket_value",
83818401
"object_": "object__value",
@@ -9577,6 +9597,11 @@ def test_update_build_trigger_rest(request_type):
95779597
"generation": 1068,
95789598
},
95799599
"repo_source": {},
9600+
"git_source": {
9601+
"url": "url_value",
9602+
"dir_": "dir__value",
9603+
"revision": "revision_value",
9604+
},
95809605
"storage_source_manifest": {
95819606
"bucket": "bucket_value",
95829607
"object_": "object__value",
@@ -9985,6 +10010,11 @@ def test_update_build_trigger_rest_bad_request(
998510010
"generation": 1068,
998610011
},
998710012
"repo_source": {},
10013+
"git_source": {
10014+
"url": "url_value",
10015+
"dir_": "dir__value",
10016+
"revision": "revision_value",
10017+
},
998810018
"storage_source_manifest": {
998910019
"bucket": "bucket_value",
999010020
"object_": "object__value",

0 commit comments

Comments
 (0)