feat: support GOOGLE_CLOUD_PROJECT_ID fallback (fixes #2262)#2725
feat: support GOOGLE_CLOUD_PROJECT_ID fallback (fixes #2262)#2725swissspidy merged 1 commit intogoogle-gemini:mainfrom
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @Gosling-dude, 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 application's flexibility by adding support for an alternative environment variable (GOOGLE_CLOUD_PROJECT_ID) for specifying the Google Cloud project. This change addresses user confusion and potential authentication issues, providing a more robust and user-friendly experience without introducing breaking changes.
Highlights
- Environment Variable Fallback: Introduces support for
GOOGLE_CLOUD_PROJECT_IDas a fallback toGOOGLE_CLOUD_PROJECTfor Google Cloud project identification. - Backward Compatibility: Ensures existing users relying on
GOOGLE_CLOUD_PROJECTare not affected by the change. - Improved Robustness: Reduces potential user misconfiguration when authenticating with Google Cloud.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
The pull request effectively implements the fallback mechanism for GOOGLE_CLOUD_PROJECT_ID when GOOGLE_CLOUD_PROJECT is not set, aligning well with the stated objective of improving user experience and compatibility. The changes are minimal, well-contained, and consistently applied across the affected files. No critical or high-severity issues were identified during the review.
| //const gcpProject = process.env.GOOGLE_CLOUD_PROJECT || ''; | ||
|
|
There was a problem hiding this comment.
This leftover code should be removed :)
There was a problem hiding this comment.
Oops! Removed it now — thanks for the heads-up! 👍
There was a problem hiding this comment.
Happy to help! Just looks like you haven't pushed the change yet
There was a problem hiding this comment.
Just pushed the change now — thanks again for catching that! 🙌
swissspidy
left a comment
There was a problem hiding this comment.
We should also update the documentation, but otherwise LGTM
Hi @swissspidy, |
|
@swissspidy @google-gemini/gemini-cli-askmode-approvers : could someone approve the workflow and give final review for PR #2725? Thanks! |
|
@Gosling-dude Trying to get this merged and I'm seeing what feels like an unrelated test failure. Can you try and pull and test on windows? Thanks |
Head branch was pushed to by a user without write access
3b3e455 to
58e72d6
Compare
|
@mattKorwel Preparing to push a clean branch with a single focused commit (env-var + docs) to fix the CLA commit-limit and simplify review. Before I push: do you allow a force-push to |
you should be able to force push since the branch in on your fork. It will however reset the approval. |
58e72d6 to
d8a0a19
Compare
|
Hi @mattKorwel and @swissspidy, I've pushed the cleaned-up branch as discussed. The pull request now has a single, focused commit and should be ready for a final review. Could you please approve the workflows to run the CI checks? Thanks! |
abcfaea to
ad88f43
Compare
|
@mattKorwel @swissspidy This update resolves all the previous issues. I've squashed the commits, fixed the linting errors, and rebased onto the latest
|
|
Looks like you'll need to run Prettier again. |
69edd8e to
ac814b4
Compare
@swissspidy I've just pushed the fix for the formatting. All CI checks should be passing now. Ready for that final review! |
|
Hi @swissspidy and @mattKorwel, I was able to get the detailed logs for the merge queue failure. The failing job is This seems to confirm it's an unrelated test issue. Please let me know if there's anything else I can do to help! |
ac814b4 to
3c207da
Compare
This pull request enhances environment variable handling by introducing support for the GOOGLE_CLOUD_PROJECT_ID environment variable as a fallback to the existing GOOGLE_CLOUD_PROJECT variable.
What this fixes
Previously, the Gemini CLI only accepted GOOGLE_CLOUD_PROJECT for Google Cloud project identification. However, some users (especially those following other GCP tools or documentation) use GOOGLE_CLOUD_PROJECT_ID instead. This mismatch caused confusion and authentication issues, as highlighted in issue #2262.
What this PR does
Affected files
slashCommandProcessor.tssetup.tscontentGenerator.tsImpact
This small but important enhancement increases flexibility and improves developer experience without introducing breaking changes.
Fixes: #2262