Skip to content

feat: Show GCP project from Code Assist endpoint in /about command#20683

Open
AbdulTawabJuly wants to merge 10 commits intogoogle-gemini:mainfrom
AbdulTawabJuly:feat/about-show-code-assist-gcp-project
Open

feat: Show GCP project from Code Assist endpoint in /about command#20683
AbdulTawabJuly wants to merge 10 commits intogoogle-gemini:mainfrom
AbdulTawabJuly:feat/about-show-code-assist-gcp-project

Conversation

@AbdulTawabJuly
Copy link
Copy Markdown
Contributor

@AbdulTawabJuly AbdulTawabJuly commented Feb 28, 2026

Summary

Previously, /about only showed the GCP project from the GOOGLE_CLOUD_PROJECT environment variable. When users authenticated with OAuth (Code Assist), they couldn't see which GCP project was actually being used by the Code Assist API
The /about command now displays the Google Cloud Project ID from the Code Assist endpoint when using OAuth authentication, with a fallback to the GOOGLE_CLOUD_PROJECT environment variable.

Details

Updated the GCP project resolution logic with the following priority:

  1. Code Assist server project ID (set during OAuth authentication flow)
  2. Environment variable (GOOGLE_CLOUD_PROJECT)
  3. Empty string (no project information available)

Changes

  • aboutCommand.ts: Added getGcpProject() helper that checks Code Assist server first, then falls back to env var
  • aboutCommand.test.ts: Added 3 new test cases covering all scenarios:
    • Code Assist project takes priority over env var
    • Falls back to env var when Code Assist unavailable
    • Returns empty when neither source available

Related Issues

Fixes #20602

How to Validate

  • Log in with Google OAuth

    • Run /about command
    • Verify GCP Project shows the project ID from Code Assist endpoint
  • Switch to API key authentication (use /auth command)

    • Set environment variable: export GOOGLE_CLOUD_PROJECT="my-test-project-from-env"
    • Run /about command
    • Verify GCP Project shows my-test-project-from-env from environment variable
  • Unset environment variable: unset GOOGLE_CLOUD_PROJECT

    • Run /about command
    • Verify GCP Project field is not displayed (empty string)
  • Log in with Google OAuth (Code Assist active)

    • Set environment variable: export GOOGLE_CLOUD_PROJECT="different-project"
    • Run /about command
    • Verify GCP Project shows Code Assist project (e.g., cobalt-device-6tqG3), NOT different-project

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@AbdulTawabJuly AbdulTawabJuly requested a review from a team as a code owner February 28, 2026 14:14
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • New GCP Project Resolution: Implemented a new logic to determine the GCP project ID displayed in the /about command, prioritizing the Code Assist server project ID over the GOOGLE_CLOUD_PROJECT environment variable.
  • Enhanced /about Command: The /about command now accurately reflects the GCP project being used by the Code Assist API when authenticated via OAuth.
  • Comprehensive Testing: Added three new test cases to validate the different scenarios of GCP project resolution, ensuring correct behavior for Code Assist priority, environment variable fallback, and no project availability.
Changelog
  • packages/cli/src/ui/commands/aboutCommand.test.ts
    • Added imports for getCodeAssistServer and CodeAssistServer type.
    • Mocked getCodeAssistServer for testing purposes.
    • Introduced three new test cases to verify the GCP project resolution logic, covering scenarios where Code Assist project takes precedence, fallback to environment variable, and no project is found.
  • packages/cli/src/ui/commands/aboutCommand.ts
    • Imported getCodeAssistServer from @google/gemini-cli-core.
    • Replaced direct environment variable access for gcpProject with a call to a new helper function.
    • Implemented a new getGcpProject helper function that retrieves the GCP project ID, prioritizing the Code Assist server project over the GOOGLE_CLOUD_PROJECT environment variable.
Activity
  • The author has completed the "Added/updated tests" item in the pre-merge checklist.
  • The author has validated the changes on MacOS using npm run and npx.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  1. 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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Feb 28, 2026
@AbdulTawabJuly AbdulTawabJuly force-pushed the feat/about-show-code-assist-gcp-project branch from 8176c46 to e6adf13 Compare February 28, 2026 19:47
@AbdulTawabJuly AbdulTawabJuly force-pushed the feat/about-show-code-assist-gcp-project branch from e6adf13 to 99e36cc Compare March 1, 2026 12:09
@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Mar 4, 2026
@AbdulTawabJuly
Copy link
Copy Markdown
Contributor Author

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.
I completely understand you’re managing a high volume of PRs right now, so I don’t want to add to the noise. Just looking for clarity so I can act accordingly. Thanks for your time

@AbdulTawabJuly
Copy link
Copy Markdown
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show google cloud project in /about fetched from code assist endpoint if env var is missing

1 participant