Skip to content

fix(hermetic-build): do not add release please comments on vertexai poms#12559

Merged
blakeli0 merged 1 commit intomainfrom
hermetic-build/omit-release-please-comment-in-vertexai
Apr 2, 2026
Merged

fix(hermetic-build): do not add release please comments on vertexai poms#12559
blakeli0 merged 1 commit intomainfrom
hermetic-build/omit-release-please-comment-in-vertexai

Conversation

@diegomarquezp
Copy link
Copy Markdown
Contributor

No description provided.

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 implements logic to exclude 'vertexai' artifacts from version update comments in both parent and BOM POM files and adds a unit test for the BOM update. Feedback includes suggestions to refactor the duplicated exclusion logic, add test coverage for the parent POM update, and move inline imports in the test file to the top to comply with PEP 8.

new_dependency.append(new_artifact)
new_dependency.append(new_version)
new_dependency.append(comment)
if "vertexai" not in m.artifact_id:
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

The logic to exclude 'vertexai' artifacts from receiving 'release please' comments is duplicated here and in update_bom_pom (line 314). Consider refactoring this into a shared constant or a helper function to improve maintainability and ensure consistency across different POM update functions.

for sub_dir in sub_dirs:
self.__remove_file_in_subdir(ad_manager_resource, sub_dir)

def test_update_bom_pom_excludes_vertexai_comment(self):
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

The new test case test_update_bom_pom_excludes_vertexai_comment only verifies the logic for update_bom_pom. Since the exclusion logic was also added to update_parent_pom, consider adding a corresponding test case to ensure that function also correctly handles 'vertexai' artifacts.

Comment on lines +39 to +41
import tempfile
from library_generation.owlbot.src.poms.module import Module
from library_generation.owlbot.src.fix_poms import update_bom_pom
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

According to PEP 8, imports should be placed at the top of the file. Importing modules like tempfile, Module, and update_bom_pom inside a test method is generally discouraged as it can lead to redundant imports and reduced readability. Please move these to the top of the file.

References
  1. PEP 8: Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants. (link)

self.assertIn("x-version-update:google-cloud-datastore:current", content)

finally:
import os
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

Similar to the imports at the beginning of the method, import os should be moved to the top of the file to adhere to PEP 8 standards.

References
  1. PEP 8: Imports are always put at the top of the file. (link)

@diegomarquezp diegomarquezp marked this pull request as ready for review April 2, 2026 00:27
@diegomarquezp diegomarquezp requested a review from a team as a code owner April 2, 2026 00:27
@blakeli0 blakeli0 merged commit 5e161a7 into main Apr 2, 2026
123 of 124 checks passed
@blakeli0 blakeli0 deleted the hermetic-build/omit-release-please-comment-in-vertexai branch April 2, 2026 01:46
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