Skip to content

Commit 98aa464

Browse files
authored
chore(librarian): onboard google-cloud-workflows to Librarian (#14604)
This PR onboards the `google-cloud-workflows` package to librarian. Note that this package contains overlapping api-paths which requires the following: - Allow the cli tool to copy code into `owl-bot-staging` even if the directory exists. - Ensure that the order of the api paths is not changed i.e. the `google/cloud/workflows/executions` api paths are followed by `google/cloud/workflows/` api paths in `state.yaml` file. For the latter point, this solution is consistent to how the config is specified in `.Owlbot.yaml` to allow the post processor to override and use the correct package name in files such as `setup.py`. We may not need to care about the order of the api paths if the module name is specified as `google.cloud.workflows` for the executions api in its `BUILD.bazel` file. Alternatively, this can be passed down as a generator option to protoc in `.generator/cli.py`. This means that we'll need to hardcode such api paths within this file and add conditional logic which adds a little more complexity. This solution is more robust but can be done as a follow up if needed. Towards googleapis/librarian#762 🦕
1 parent 11a1844 commit 98aa464

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

.generator/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def _stage_gapic_library(tmp_dir: str, staging_dir: str) -> None:
741741
"""
742742
# For GAPIC, the generator output is flat in `tmp_dir` and includes all
743743
# necessary files like setup.py, client library, etc.
744-
shutil.copytree(tmp_dir, staging_dir)
744+
shutil.copytree(tmp_dir, staging_dir, dirs_exist_ok=True)
745745

746746

747747
def _generate_api(
@@ -775,7 +775,9 @@ def _generate_api(
775775
_run_protoc_command(command, source)
776776

777777
# 3. Determine staging location
778-
staging_child_directory = _get_staging_child_directory(api_path, is_proto_only_library)
778+
staging_child_directory = _get_staging_child_directory(
779+
api_path, is_proto_only_library
780+
)
779781
staging_dir = os.path.join(
780782
output, "owl-bot-staging", library_id, staging_child_directory
781783
)

.generator/test_cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,4 +1440,6 @@ def test_stage_gapic_library(mocker):
14401440
_stage_gapic_library(tmp_dir, staging_dir)
14411441

14421442
# Assertion: Check copytree was called exactly once with the correct arguments
1443-
mock_shutil_copytree.assert_called_once_with(tmp_dir, staging_dir)
1443+
mock_shutil_copytree.assert_called_once_with(
1444+
tmp_dir, staging_dir, dirs_exist_ok=True
1445+
)

.librarian/state.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,3 +1756,24 @@ libraries:
17561756
remove_regex:
17571757
- packages/google-cloud-data-fusion
17581758
tag_format: '{id}-v{version}'
1759+
- id: google-cloud-workflows
1760+
version: 1.18.2
1761+
last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6
1762+
apis:
1763+
- path: google/cloud/workflows/executions/v1
1764+
- path: google/cloud/workflows/executions/v1beta
1765+
- path: google/cloud/workflows/v1
1766+
- path: google/cloud/workflows/v1beta
1767+
source_roots:
1768+
- packages/google-cloud-workflows
1769+
preserve_regex:
1770+
- packages/google-cloud-workflows/CHANGELOG.md
1771+
- docs/CHANGELOG.md
1772+
- docs/README.rst
1773+
- samples/README.txt
1774+
- scripts/client-post-processing
1775+
- samples/snippets/README.rst
1776+
- tests/system
1777+
remove_regex:
1778+
- packages/google-cloud-workflows
1779+
tag_format: '{id}-v{version}'

scripts/configure_state_yaml/packages_to_onboard.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ packages_to_onboard: [
105105
"google-cloud-vpc-access",
106106
"google-cloud-webrisk",
107107
"google-cloud-websecurityscanner",
108+
"google-cloud-workflows",
108109
"google-cloud-workstations",
109110
"googleapis-common-protos",
110111
]

0 commit comments

Comments
 (0)