Skip to content

feat(library_generation): generic grouping folder for unversioned libraries staging paths#13341

Open
blakeli0 wants to merge 1 commit into
googleapis:mainfrom
blakeli0:fix/generic-unversioned-owlbot-staging-path
Open

feat(library_generation): generic grouping folder for unversioned libraries staging paths#13341
blakeli0 wants to merge 1 commit into
googleapis:mainfrom
blakeli0:fix/generic-unversioned-owlbot-staging-path

Conversation

@blakeli0
Copy link
Copy Markdown
Contributor

@blakeli0 blakeli0 commented Jun 2, 2026

Use dynamically resolved grouping folder names (instead of the static 'unversioned' directory placeholder) in OwlBot staging paths for unversioned libraries.

@blakeli0 blakeli0 requested review from a team as code owners June 2, 2026 22:15
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for generating OwlBot configurations for unversioned and proto-only libraries, including corresponding unit tests and golden files. The feedback suggests a more robust extraction of the unversioned directory name from the proto path to handle potential trailing slashes and avoid malformed paths.

else f"{library_path}/.github/{owlbot_yaml_file}"
)
if not os.path.exists(path_to_owlbot_yaml_file):
unversioned_dir = remove_version_from(proto_path).split("/")[-1]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If proto_path contains a trailing slash (e.g., google/cloud/baremetalsolution/), remove_version_from(proto_path) may also retain it. Splitting by / and taking the last element [-1] would then result in an empty string "", leading to malformed paths in the rendered OwlBot configuration. Stripping trailing slashes or using os.path.basename makes this extraction much more robust.

Suggested change
unversioned_dir = remove_version_from(proto_path).split("/")[-1]
unversioned_dir = os.path.basename(remove_version_from(proto_path).rstrip("/"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant