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 lays the groundwork for supporting VPC direct connect by extending the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for VPC direct connect by introducing a networkInterface option. The changes are mostly in v2/options.ts to handle the new configuration and translate it to the manifest format. I've identified a few areas for improvement, including a high-severity type issue hidden by an as any cast which could lead to runtime problems, an unnecessary type cast, and a missing validation for the new networkInterface option. My review comments include suggestions to fix these issues.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for VPC direct connect by updating the Global Options, manifest definition, and related processing logic. The changes are generally well-structured and include corresponding tests. However, I've identified a couple of issues in the optionsToEndpoint function that could lead to incorrect manifest generation under certain conditions. My review comments provide specific suggestions to address these issues and improve the robustness of the VPC configuration handling.
| /** | ||
| * Network Interface to use with VPC Direct Connect | ||
| */ | ||
| networkInterface?: NetworkInterface | ResetValue; |
There was a problem hiding this comment.
I noticed that in manifest.ts, we support an array of network interfaces. But here we only expose a singular object. Is it something that was intentional or do we plan on something like networkInterfaces?: NetworkInterface | NetworkInterface[] in the future?
There was a problem hiding this comment.
Great question, and yes. The Google API is a plural but only supports arrays of size one. To support ergonomics, we will currently only accept a singular in our API and eventually support a plural if GCF ever supports one, but our wire format will always be plural to avoid mistakes.
This is part of the predictability principle that you should be forgiving in what you accept (e.g. singular or plural) but strict in what you produce (plural)
| convertIfPresent(endpoint, opts, "serviceAccountEmail", "serviceAccount"); | ||
| if (opts.vpcConnector !== undefined) { | ||
| if (opts.vpcConnector === null || opts.vpcConnector instanceof ResetValue) { | ||
| const vpcEgress = opts.vpcEgress ?? opts.vpcConnectorEgressSettings; |
There was a problem hiding this comment.
iiuc, it looks like we are silently prioritizing vpcEgress if both that and vpcConnectorEgressSettings are provided. Was curious if we want to log a warning if a user accidentally supplies both, or is the alias behavior intended to be a silent override?
Part 1 of 2 (will require CLI changes).
This adds the VPC direct connect settings (network interfaces) to the Global Options object. It also updates the way we create the "manifest" (proprietary IaC YAML) to emit this. This feature will only light up with a new version of the CLI that recognizes this YAML format and supports it.