-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
build: cater for packages without gapic_version.py in release please config action #13436
Conversation
@@ -70,6 +76,8 @@ def configure_release_please_manifest( | |||
with open(release_please_manifest, "r") as f: | |||
manifest_json = json.load(f) | |||
for package_dir in package_dirs: | |||
if not package_supports_gapic_version(package_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the case when gapic_version
is supported by the package, we first verify it on line 79 and then again on line 85.
Does the github action fail at line 81? If so, Would it suffice if we move the condition at line 85 above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 67cf899
gapic_version_file = next(package_dir.rglob("**/gapic_version.py"), None) | ||
if gapic_version_file is None: | ||
raise Exception("Failed to find gapic_version.py") | ||
if package_supports_gapic_version(package_dir): | ||
raise Exception("Failed to find gapic_version.py") | ||
else: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm my thought was that we simply continue if gapic_version.py
file doesn't exist instead of raising an exception + another check for a supported package. But if we do want to be explicit, how about we only check for a gapic_version_file
if it is a supported package?
gapic_version_file = next(package_dir.rglob("**/gapic_version.py"), None) | |
if gapic_version_file is None: | |
raise Exception("Failed to find gapic_version.py") | |
if package_supports_gapic_version(package_dir): | |
raise Exception("Failed to find gapic_version.py") | |
else: | |
continue | |
if not package_supports_gapic_version(package_dir): | |
continue | |
gapic_version_file = next(package_dir.rglob("**/gapic_version.py"), None) | |
if gapic_version_file is None: | |
raise Exception("Failed to find gapic_version.py") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 13bef06
The Github Action that updates the release please configuration recently started failing after PRs #13425, #13426 and #13427 were merged. The reason is that the action expects packages to have a file called
gapic_version.py
, however these packages do not. This PR updates the release please configuration script to exclude packages which do not have this file.