build: cater for packages without gapic_version.py in release please config action#13436
Merged
build: cater for packages without gapic_version.py in release please config action#13436
Conversation
ohmayr
reviewed
Jan 16, 2025
| 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): |
Contributor
There was a problem hiding this comment.
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?
ohmayr
approved these changes
Jan 16, 2025
Comment on lines
+82
to
+87
| 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 |
Contributor
There was a problem hiding this comment.
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?
Suggested change
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.