Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the daily testing infrastructure by introducing a mechanism to dynamically name VPC networks. This change aims to prevent naming collisions and improve the isolation of test environments by ensuring each VPC module receives a unique, test-specific name during the build process. The core of this update is a new Python script that modifies blueprint YAML files, integrated into the existing build steps. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a Python script to programmatically assign unique network names to VPC modules in test blueprints, aiming to fix network name collisions. The change also updates the test configuration to pass the necessary variables to the blueprint.
While the new script is a good approach, I've found a critical issue where its changes are immediately overwritten by an existing sed command in the build script, nullifying the fix.
Additionally, I've suggested a couple of improvements to the new Python script to make it more robust and user-friendly by adding better error handling and argument parsing. Please see the detailed comments.
| REGION="$${ZONE%-*}" | ||
| BUILD_ID_SHORT=$${BUILD_ID:0:6} | ||
| BLUEPRINT="/workspace/examples/h4d-vm.yaml" | ||
| python3 tools/modify_vpc.py "$${BLUEPRINT}" |
There was a problem hiding this comment.
The changes made by your new script tools/modify_vpc.py are being overwritten by a later sed command on line 87. Your script correctly assigns unique network names (e.g., $(vars.test_name)-0, $(vars.test_name)-1) to the VPC modules. However, the sed command on line 87 then resets the network_name for both VPC modules to the same value, $(vars.base_network_name), which will likely cause a resource name collision. You should probably remove the sed command on line 87 to allow your script's changes to persist.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This reverts commit 8f07f2d.
- Revert 'Fix the network name (GoogleCloudPlatform#5315)' - Apply python logic and fixes from GoogleCloudPlatform#5385 - Apply modify_vpc.py across all filestore integration tests
- Revert 'Fix the network name (GoogleCloudPlatform#5315)' - Apply python logic and fixes from GoogleCloudPlatform#5385 - Apply modify_vpc.py across all filestore integration tests
Setting the VPC name to test name.
Submission Checklist
NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.