Conversation
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
| 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): |
There was a problem hiding this comment.
| import tempfile | ||
| from library_generation.owlbot.src.poms.module import Module | ||
| from library_generation.owlbot.src.fix_poms import update_bom_pom |
There was a problem hiding this comment.
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
- 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 |
There was a problem hiding this comment.
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
- PEP 8: Imports are always put at the top of the file. (link)
No description provided.