Skip to content

Commit

Permalink
feat: [google-cloud-build] Support for git proxy setup (#13520)
Browse files Browse the repository at this point in the history
BEGIN_COMMIT_OVERRIDE
feat: Add option to enable fetching dependencies
chore: Update gapic-generator-python to v1.22.1
fix(deps): Require grpc-google-iam-v1>=0.14.0
feat: Support for git proxy setup
docs: Updates to proto message comments
END_COMMIT_OVERRIDE

- [ ] Regenerate this pull request now.

docs: Updates to proto message comments

PiperOrigin-RevId: 726194972

Source-Link:
googleapis/googleapis@da30f52

Source-Link:
googleapis/googleapis-gen@5207ef8
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJ1aWxkLy5Pd2xCb3QueWFtbCIsImgiOiI1MjA3ZWY4YjhhYWVlZjljYjMxNTc3Yjc4YzYwODNkNjhjZWQxNTlhIn0=

BEGIN_NESTED_COMMIT
chore: [google-cloud-build] Update gapic-generator-python to v1.22.1
fix(deps): Require grpc-google-iam-v1>=0.14.0

PiperOrigin-RevId: 726142856

Source-Link:
googleapis/googleapis@25989cb

Source-Link:
googleapis/googleapis-gen@677041b
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJ1aWxkLy5Pd2xCb3QueWFtbCIsImgiOiI2NzcwNDFiOTFjZWYxNTk4Y2M1NTcyN2Q1OWEyODA0YjE5OGE1YmJmIn0=
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
feat: [google-cloud-build] Add option to enable fetching dependencies
PiperOrigin-RevId: 726044205

Source-Link:
googleapis/googleapis@8c65012

Source-Link:
googleapis/googleapis-gen@c576e37
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJ1aWxkLy5Pd2xCb3QueWFtbCIsImgiOiJjNTc2ZTM3MTcyZDg1ZDQ3NTYxNTFhY2UwNGRjYjFlODQ1NmJmMWRlIn0=
END_NESTED_COMMIT

---------

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 Feb 18, 2025
1 parent 0c5f868 commit 3fe8899
Show file tree
Hide file tree
Showing 9 changed files with 473 additions and 78 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-build/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ In order to use this library, you first need to go through the following steps:
1. `Select or create a Cloud Platform project.`_
2. `Enable billing for your project.`_
3. `Enable the Cloud Build.`_
4. `Setup Authentication.`_
4. `Set up Authentication.`_

.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
.. _Enable the Cloud Build.: https://cloud.google.com/cloud-build/docs/
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
.. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html

Installation
~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
DeleteBuildTriggerRequest,
DeleteWorkerPoolOperationMetadata,
DeleteWorkerPoolRequest,
Dependency,
FileHashes,
GetBuildRequest,
GetBuildTriggerRequest,
GetWorkerPoolRequest,
GitConfig,
GitFileSource,
GitHubEnterpriseConfig,
GitHubEnterpriseSecrets,
Expand Down Expand Up @@ -117,10 +119,12 @@
"DeleteBuildTriggerRequest",
"DeleteWorkerPoolOperationMetadata",
"DeleteWorkerPoolRequest",
"Dependency",
"FileHashes",
"GetBuildRequest",
"GetBuildTriggerRequest",
"GetWorkerPoolRequest",
"GitConfig",
"GitFileSource",
"GitHubEnterpriseConfig",
"GitHubEnterpriseSecrets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
DeleteBuildTriggerRequest,
DeleteWorkerPoolOperationMetadata,
DeleteWorkerPoolRequest,
Dependency,
FileHashes,
GetBuildRequest,
GetBuildTriggerRequest,
GetWorkerPoolRequest,
GitConfig,
GitFileSource,
GitHubEnterpriseConfig,
GitHubEnterpriseSecrets,
Expand Down Expand Up @@ -112,10 +114,12 @@
"DeleteBuildTriggerRequest",
"DeleteWorkerPoolOperationMetadata",
"DeleteWorkerPoolRequest",
"Dependency",
"FileHashes",
"GetBuildRequest",
"GetBuildTriggerRequest",
"GetWorkerPoolRequest",
"GitConfig",
"GitFileSource",
"GitHubEnterpriseConfig",
"GitHubEnterpriseSecrets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ class CloudBuildAsyncClient:
parse_github_enterprise_config_path = staticmethod(
CloudBuildClient.parse_github_enterprise_config_path
)
git_repository_link_path = staticmethod(CloudBuildClient.git_repository_link_path)
parse_git_repository_link_path = staticmethod(
CloudBuildClient.parse_git_repository_link_path
)
network_path = staticmethod(CloudBuildClient.network_path)
parse_network_path = staticmethod(CloudBuildClient.parse_network_path)
network_attachment_path = staticmethod(CloudBuildClient.network_attachment_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,30 @@ def parse_github_enterprise_config_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def git_repository_link_path(
project: str,
location: str,
connection: str,
git_repository_link: str,
) -> str:
"""Returns a fully-qualified git_repository_link string."""
return "projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}".format(
project=project,
location=location,
connection=connection,
git_repository_link=git_repository_link,
)

@staticmethod
def parse_git_repository_link_path(path: str) -> Dict[str, str]:
"""Parses a git_repository_link path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/connections/(?P<connection>.+?)/gitRepositoryLinks/(?P<git_repository_link>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def network_path(
project: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
DeleteBuildTriggerRequest,
DeleteWorkerPoolOperationMetadata,
DeleteWorkerPoolRequest,
Dependency,
FileHashes,
GetBuildRequest,
GetBuildTriggerRequest,
GetWorkerPoolRequest,
GitConfig,
GitFileSource,
GitHubEnterpriseConfig,
GitHubEnterpriseSecrets,
Expand Down Expand Up @@ -104,10 +106,12 @@
"DeleteBuildTriggerRequest",
"DeleteWorkerPoolOperationMetadata",
"DeleteWorkerPoolRequest",
"Dependency",
"FileHashes",
"GetBuildRequest",
"GetBuildTriggerRequest",
"GetWorkerPoolRequest",
"GitConfig",
"GitFileSource",
"GitHubEnterpriseConfig",
"GitHubEnterpriseSecrets",
Expand Down
Loading

0 comments on commit 3fe8899

Please sign in to comment.