-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Add extension tags to manifest #11141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @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 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. 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.
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.
packages/cli/src/config/extension.ts
Outdated
| if (rawConfig.tags) { | ||
| for (const tag of rawConfig.tags) { | ||
| if (!Object.values(ValidTags).includes(tag)) { | ||
| throw new Error(`Invalid tag "${tag}" in extension config`); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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`);
}
}
}|
Size Change: +698 B (0%) Total Size: 17.8 MB ℹ️ View Unchanged
|
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
Linked issues / bugs
Fixes #11111