Skip to content

Conversation

@chrstnb
Copy link
Collaborator

@chrstnb chrstnb commented Oct 14, 2025

TLDR

Includes a list of valid tags, which we will add to the gallery for filtering by relevant tag. This isn't totally required to be added to the extensions logic, but we can use it for validation to restrict tags to only the ones we are using in the gallery. This list will have to be kept in-sync, but that seems OK for now.

Dive Deeper

Reviewer Test Plan

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Fixes #11111

@chrstnb chrstnb requested a review from a team as a code owner October 14, 2025 20:07
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chrstnb, 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 introduces a new tags field to the extension manifest, gemini-extension.json, along with a description field. The primary purpose of the tags field is to enable better categorization and filtering of extensions within a gallery. To maintain data integrity and consistency, a strict validation mechanism has been implemented to ensure that only a predefined set of tags can be used. This change also includes updated documentation and comprehensive unit tests to cover the new functionality.

Highlights

  • New tags field for extensions: Introduced a new tags field in the gemini-extension.json manifest to categorize extensions for gallery filtering.
  • Tag validation and ValidTags enum: Added a ValidTags enum to define a controlled list of acceptable tags and implemented validation logic to ensure only these predefined tags are used, throwing an error for invalid ones.
  • Documentation updates: Updated the extension documentation to reflect the new tags and description fields, explaining their purpose and listing supported tag values.
  • Enhanced testing: Added new unit tests to verify the correct loading of valid tags and the proper error handling for invalid tags within extension configurations.
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
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 adds support for tags and description to the extension manifest, which will be used for filtering in the extension gallery. The changes correctly update the documentation, configuration logic, and tests. I've found one high-severity issue in the configuration parsing that could lead to a crash with a poor error message if the tags property is malformed. My feedback includes a specific suggestion to make the parsing more robust.

Comment on lines 705 to 711
if (rawConfig.tags) {
for (const tag of rawConfig.tags) {
if (!Object.values(ValidTags).includes(tag)) {
throw new Error(`Invalid tag "${tag}" in extension config`);
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current implementation assumes that rawConfig.tags is an array. If a user provides a non-array value for tags in gemini-extension.json (e.g., a string or an object), the for...of loop on line 706 will throw a TypeError. This will be caught by the outer try...catch block, but it will result in a generic and unhelpful error message for the user.

To improve robustness and provide a better user experience, you should validate that tags is an array before iterating over it.

    if (rawConfig.tags) {
      if (!Array.isArray(rawConfig.tags)) {
        throw new Error('The "tags" property in the extension config must be an array.');
      }
      for (const tag of rawConfig.tags) {
        if (!Object.values(ValidTags).includes(tag)) {
          throw new Error(`Invalid tag "${tag}" in extension config`);
        }
      }
    }

@github-actions
Copy link

github-actions bot commented Oct 14, 2025

Size Change: +698 B (0%)

Total Size: 17.8 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 17.8 MB +698 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 830 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@chrstnb chrstnb requested a review from richieforeman October 16, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add extension tags, in coordination with list of gallery tags

2 participants