Skip to content

Make AGY installation optional in case we can't detect it.#10024

Merged
christhompsongoogle merged 7 commits into
mainfrom
fixFalser
Mar 11, 2026
Merged

Make AGY installation optional in case we can't detect it.#10024
christhompsongoogle merged 7 commits into
mainfrom
fixFalser

Conversation

@christhompsongoogle
Copy link
Copy Markdown
Contributor

Make AGY installation optional in case we can't detect it.

@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 migration process by making the Antigravity IDE CLI (agy) dependency optional. Previously, the absence of agy would cause the migration to fail. Now, the system checks for agy's presence, logs a warning if it's missing, and adjusts subsequent prompts accordingly, allowing the migration to complete without interruption. This change improves the robustness and user experience of the migration tool.

Highlights

  • Optional AGY Installation: The system now gracefully handles cases where the Antigravity IDE CLI (agy) is not found in the user's PATH. Instead of halting the migration with an error, it logs a warning and proceeds.
  • Conditional Prompting: The prompt to open the project in Antigravity is now skipped if the agy CLI is detected as missing, providing a smoother experience for users without agy installed.
  • Improved Test Coverage: A new test case has been added to verify that the open prompt is correctly skipped when agy is not present on the system.

🧠 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
  • src/firebase_studio/migrate.spec.ts
    • Added a new test case to verify that the 'open in Antigravity' prompt is skipped when the agy CLI is not found.
  • src/firebase_studio/migrate.ts
    • Removed the import for FirebaseError as it is no longer thrown when agy is missing.
    • Modified assertSystemState to return a boolean indicating agy's presence and to log a warning instead of throwing an error if agy is not found.
    • Updated askToOpenAntigravity to accept an agyExists parameter, allowing the prompt to be conditionally skipped.
    • Adjusted the migrate function to capture the agyExists status from assertSystemState and pass it to askToOpenAntigravity.
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 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.

Comment thread src/firebase_studio/migrate.spec.ts Outdated
fetchStub.resolves({
ok: true,
json: async () => [],
} as any);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
} as any);
} as Response);
References
  1. The style guide states: 'Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards.' (link)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good suggestion, non blocking

} as any);

// Mock filesystem
sandbox.stub(fs, "readFile").callsFake(async (p: any) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
sandbox.stub(fs, "readFile").callsFake(async (p: any) => {
sandbox.stub(fs, "readFile").callsFake(async (p: Parameters<typeof fs.readFile>[0]) => {
References
  1. The style guide states: 'Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards.' (link)

Comment thread src/firebase_studio/migrate.ts Outdated
Comment on lines 219 to 221
logger.info(
`⚠️ Antigravity IDE CLI (agy) not found in your PATH. To ensure a seamless migration, please download and install Antigravity: ${downloadLink}`,
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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
  1. The style guide encourages looking for existing utilities in src/utils.ts before writing new helper functions. utils.logWarning is the established helper for logging warnings. (link)

Copy link
Copy Markdown
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

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

npm run format, but lgtm otherwise

Comment thread src/firebase_studio/migrate.spec.ts Outdated
fetchStub.resolves({
ok: true,
json: async () => [],
} as any);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good suggestion, non blocking

@christhompsongoogle christhompsongoogle merged commit 016e2ae into main Mar 11, 2026
47 checks passed
@christhompsongoogle christhompsongoogle deleted the fixFalser branch March 11, 2026 10:29
andrewbrook pushed a commit that referenced this pull request Mar 25, 2026
* Make AGY insatllation optional in case we can't detect it.
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.

3 participants