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 Antigravity migration process by introducing interactive prompts before configuring Firebase and Dart MCP servers. It also adds a prerequisite check for Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
The pull request modifies the setupAntigravityMcpServer function to introduce user prompts for configuring Firebase and Dart MCP servers, allowing users to opt-in or opt-out, and adds checks for npx and dart command availability. New test cases are included to cover these prompting and configuration scenarios. The review suggests refactoring repeated constant definitions in the new test cases to improve maintainability and reduce duplication, and also recommends refactoring the setupAntigravityMcpServer function to reduce nesting and improve readability by handling preconditions and edge cases earlier, aligning with the style guide.
| const mcpConfigDir = path.join(require("os").homedir(), ".gemini", "antigravity"); | ||
| const mcpConfigPath = path.join(mcpConfigDir, "mcp_config.json"); |
There was a problem hiding this comment.
| if (!mcpConfig.mcpServers["firebase"]) { | ||
| mcpConfig.mcpServers["firebase"] = { | ||
| command: "npx", | ||
| args: ["-y", "firebase-tools@latest", "mcp", "--dir", path.resolve(rootPath)], | ||
| }; | ||
| updated = true; | ||
| logger.info(`✅ Configured Firebase MCP server in ${mcpConfigPath}`); | ||
| if (utils.commandExistsSync("npx")) { | ||
| const confirmFirebase = await prompt.confirm({ | ||
| message: "Would you like to enable the Firebase MCP server for Antigravity?", | ||
| default: true, | ||
| }); | ||
|
|
||
| if (confirmFirebase) { | ||
| mcpConfig.mcpServers["firebase"] = { | ||
| command: "npx", | ||
| args: ["-y", "firebase-tools@latest", "mcp", "--dir", path.resolve(rootPath)], | ||
| }; | ||
| updated = true; | ||
| logger.info(`✅ Configured Firebase MCP server in ${mcpConfigPath}`); | ||
| } | ||
| } else { | ||
| logger.info("ℹ️ npx not found on PATH, skipping Firebase MCP server configuration."); | ||
| } | ||
| } else { | ||
| logger.info("ℹ️ Firebase MCP server already configured in Antigravity, skipping."); | ||
| } |
There was a problem hiding this comment.
This block of code has multiple levels of nesting. To improve readability and adhere to the style guide's preference for reduced nesting, consider refactoring to handle preconditions and edge cases early using an if-else if structure. This flattens the logic and makes it easier to follow.
if (mcpConfig.mcpServers["firebase"]) {
logger.info("ℹ️ Firebase MCP server already configured in Antigravity, skipping.");
} else if (!utils.commandExistsSync("npx")) {
logger.info("ℹ️ npx not found on PATH, skipping Firebase MCP server configuration.");
} else {
const confirmFirebase = await prompt.confirm({
message: "Would you like to enable the Firebase MCP server for Antigravity?",
default: true,
});
if (confirmFirebase) {
mcpConfig.mcpServers["firebase"] = {
command: "npx",
args: ["-y", "firebase-tools@latest", "mcp", "--dir", path.resolve(rootPath)],
};
updated = true;
logger.info(`✅ Configured Firebase MCP server in ${mcpConfigPath}`);
}
}References
- The repository style guide recommends reducing code nesting and handling edge cases early to improve readability. (link)
Description
As requested, check for npx and prompt before installing MCP servers.