Make AGY installation optional in case we can't detect it.#10024
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 migration process by making the Antigravity IDE CLI (agy) dependency optional. Previously, the absence of 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
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 successfully makes the Antigravity IDE (agy) installation optional by checking for its existence and skipping prompts if it's not found, rather than throwing an error. The logic is sound and is supported by a new test case. My feedback includes suggestions to enhance code consistency by using existing logging utilities and to align with the repository's TypeScript style guide by avoiding the use of any.
| fetchStub.resolves({ | ||
| ok: true, | ||
| json: async () => [], | ||
| } as any); |
There was a problem hiding this comment.
According to the repository's style guide, any should not be used as an escape hatch. You can cast this to Response instead, which is a globally available type.
| } as any); | |
| } as Response); |
References
- The style guide states: 'Never use
anyorunknownas an escape hatch. Define proper interfaces/types or use type guards.' (link)
| } as any); | ||
|
|
||
| // Mock filesystem | ||
| sandbox.stub(fs, "readFile").callsFake(async (p: any) => { |
There was a problem hiding this comment.
To adhere to the style guide which prohibits using any, please provide a more specific type for the p parameter. You can use Parameters<typeof fs.readFile>[0] to infer the correct type from the fs.readFile function signature without needing extra imports.
| sandbox.stub(fs, "readFile").callsFake(async (p: any) => { | |
| sandbox.stub(fs, "readFile").callsFake(async (p: Parameters<typeof fs.readFile>[0]) => { |
References
- The style guide states: 'Never use
anyorunknownas an escape hatch. Define proper interfaces/types or use type guards.' (link)
| logger.info( | ||
| `⚠️ Antigravity IDE CLI (agy) not found in your PATH. To ensure a seamless migration, please download and install Antigravity: ${downloadLink}`, | ||
| ); |
There was a problem hiding this comment.
For consistency with how warnings are logged elsewhere in the codebase and to use the appropriate log level, please use the utils.logWarning helper function instead of logger.info. This also aligns with the best practice of using existing utilities.
| logger.info( | |
| `⚠️ Antigravity IDE CLI (agy) not found in your PATH. To ensure a seamless migration, please download and install Antigravity: ${downloadLink}`, | |
| ); | |
| utils.logWarning( | |
| `Antigravity IDE CLI (agy) not found in your PATH. To ensure a seamless migration, please download and install Antigravity: ${downloadLink}`, | |
| ); |
References
- The style guide encourages looking for existing utilities in
src/utils.tsbefore writing new helper functions.utils.logWarningis the established helper for logging warnings. (link)
joehan
left a comment
There was a problem hiding this comment.
npm run format, but lgtm otherwise
| fetchStub.resolves({ | ||
| ok: true, | ||
| json: async () => [], | ||
| } as any); |
* Make AGY insatllation optional in case we can't detect it.
Make AGY installation optional in case we can't detect it.