fix(cli): do not override GOOGLE_CLOUD_PROJECT in Cloud Shell when using Vertex AI#24455
fix(cli): do not override GOOGLE_CLOUD_PROJECT in Cloud Shell when using Vertex AI#24455DavidAPierce merged 20 commits intomainfrom
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 addresses an issue where the CLI's default behavior in Cloud Shell was overriding user-defined project settings. By introducing a check for the selected authentication type, the system now correctly respects user configurations when Vertex AI is in use, ensuring a more predictable environment setup. 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
|
|
Size Change: +1.61 kB (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request modifies the Cloud Shell environment setup to ensure that the GOOGLE_CLOUD_PROJECT environment variable is not overridden when the vertex-ai authentication type is selected. This change allows the CLI to respect the user's project configuration in Vertex AI environments. The update includes a new unit test to validate this logic. I have no feedback to provide.
Sweet, let me tackle the final piece here 👍 Thanks @JayadityaGit |
|
one final note I am including this issue #24505 , this was triaged as p3 (i feel this is a sub part of this PR) anyways thanks ! |
|
i apologise for not communicating this sooner., by default i actually use Alternate screen buffer mode, where with a successfull google sign in
i just switched to normal mode to check if it make any difference, in this mode after successful sign in
I just wanted to communicate this, thanks for making the cli better 💚. |
|
Howdy @jackwotherspoon this PR looks good and largely addresses two birds with one stone. LGTM. |
…ing Vertex AI (google-gemini#24455) Co-authored-by: David Pierce <davidapierce@google.com>
…ing Vertex AI (google-gemini#24455) Co-authored-by: David Pierce <davidapierce@google.com>

Summary
Fixes an issue where
GOOGLE_CLOUD_PROJECTwas being incorrectly overridden tocloudshell-gcain Cloud Shell even when the user had explicitly selected Vertex AI authentication.vertex.-.cloud.shell.mp4
Details
In Cloud Shell, the CLI normally overrides
GOOGLE_CLOUD_PROJECTto a default value (cloudshell-gca) to avoid using the project set viagcloud. However, when using Vertex AI, users often intend to use a specific project. This change ensures that ifselectedAuthTypeisvertex-ai, the override is skipped, respecting the existing environment or.envsettings.When in Cloud Shell, if a user switches to Vertex auth, it tells the user to restart to make sure the project gets picked up.
Related Issues
Fixes #24494
How to Validate
export CLOUD_SHELL=true).GOOGLE_CLOUD_PROJECT.GOOGLE_CLOUD_PROJECTremains as set by the user/env.Automated tests added in
packages/cli/src/config/settings.test.ts.Pre-Merge Checklist