feat: Show GCP project from Code Assist endpoint in /about command#20683
feat: Show GCP project from Code Assist endpoint in /about command#20683AbdulTawabJuly wants to merge 10 commits intogoogle-gemini:mainfrom
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 /about command by introducing a more robust mechanism for displaying the Google Cloud Project ID. Previously, it only showed the project from an environment variable, which was insufficient for users authenticated with Code Assist (OAuth). The updated logic now prioritizes the project ID obtained from the Code Assist endpoint, falling back to the environment variable if the Code Assist project is not available, ensuring users see the correct and relevant project information. Highlights
Changelog
Activity
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 correctly implements the logic to display the GCP project from the Code Assist endpoint in the /about command, with a fallback to the environment variable. The new tests cover the different scenarios well. My main feedback is to align the new tests with the repository's testing conventions for handling environment variables to improve test reliability.
8176c46 to
e6adf13
Compare
e6adf13 to
99e36cc
Compare
|
Hi @sehoon38, I wanted to check in regarding the future of this PR. If this is something you’d prefer to handle internally, please let me know. I’d be happy to close it to avoid any unnecessary workload. |
|
Hi @sehoon38 , sorry to bother you again, but could you let me know if this pull request is still needed? Or should I go ahead and close it? |
Summary
Previously,
/aboutonly showed the GCP project from theGOOGLE_CLOUD_PROJECTenvironment variable. When users authenticated with OAuth (Code Assist), they couldn't see which GCP project was actually being used by the Code Assist APIThe
/aboutcommand now displays the Google Cloud Project ID from the Code Assist endpoint when using OAuth authentication, with a fallback to theGOOGLE_CLOUD_PROJECTenvironment variable.Details
Updated the GCP project resolution logic with the following priority:
GOOGLE_CLOUD_PROJECT)Changes
aboutCommand.ts: AddedgetGcpProject()helper that checks Code Assist server first, then falls back to env varaboutCommand.test.ts: Added 3 new test cases covering all scenarios:Related Issues
Fixes #20602
How to Validate
Log in with Google OAuth
/aboutcommandSwitch to API key authentication (use
/authcommand)export GOOGLE_CLOUD_PROJECT="my-test-project-from-env"/aboutcommandmy-test-project-from-envfrom environment variableUnset environment variable:
unset GOOGLE_CLOUD_PROJECT/aboutcommandLog in with Google OAuth (Code Assist active)
export GOOGLE_CLOUD_PROJECT="different-project"/aboutcommandcobalt-device-6tqG3), NOTdifferent-projectPre-Merge Checklist