Skip to content

build: cater for packages without gapic_version.py in release please config action#13436

Merged
parthea merged 4 commits intomainfrom
update-release-please-action
Jan 16, 2025
Merged

build: cater for packages without gapic_version.py in release please config action#13436
parthea merged 4 commits intomainfrom
update-release-please-action

Conversation

@parthea
Copy link
Copy Markdown
Contributor

@parthea parthea commented Jan 14, 2025

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.

@parthea parthea requested a review from a team January 14, 2025 00:57
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):
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.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 67cf899

@parthea parthea requested a review from ohmayr January 16, 2025 15:41
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
Copy link
Copy Markdown
Contributor

@ohmayr ohmayr Jan 16, 2025

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?

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")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 13bef06

@parthea parthea enabled auto-merge (squash) January 16, 2025 17:40
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 16, 2025
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 16, 2025
@parthea parthea merged commit f0e1b5d into main Jan 16, 2025
@parthea parthea deleted the update-release-please-action branch January 16, 2025 17:42
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.

2 participants