Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(php): handle missing directories gracefully #1772

Merged
merged 5 commits into from
Mar 15, 2023
Merged

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Mar 7, 2023

This looks like a bigger change than it is. I just wrapped the "copy gapics" and "copy protos" sections in a conditional to see if those expected directories exist. Without this, synthtool throws an exception (a FileNotFoundError: [Errno 2] No such file or directory error) when src or proto/src doesn't exist.

Additionally, I added a log message if the required version_string doesn't exist, as this covers an edge case with proto-only copies (since the version_string is derived from the gapic path).

This is important for using OwlBot to generate our "Cloud Common Protos", which won't contain a GAPIC service, but for which we'd still like to use OwlBot (see googleapis/google-cloud-php#5935).

@bshaffer bshaffer marked this pull request as draft March 7, 2023 18:49
@bshaffer bshaffer merged commit 7899bce into master Mar 15, 2023
@bshaffer bshaffer deleted the bshaffer-patch-1 branch March 15, 2023 01:35
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.

3 participants