Skip to content

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Oct 1, 2025

Description

@jpreid7396 caught this one - firebase init should work even if firebase.json is an empty file.

Scenarios Tested

Tested init with an empty file, and with a populated one. Both work correctly.
Tested deploy with an empty file - it still errors out with 'Could not understand what targets to deploy/serve'

Copy link
Contributor

Summary of Changes

Hello @joehan, 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 resolves an issue where the firebase init command would fail if it encountered an empty firebase.json file. The changes introduce a check within the configuration loading logic to ensure that an empty file is treated as a valid, empty configuration, allowing the initialization process to proceed without errors and improving the robustness of the command.

Highlights

  • Empty firebase.json Handling: The 'firebase init' command now gracefully handles cases where the 'firebase.json' file exists but is empty, preventing previous initialization failures.
  • Configuration Loading Logic: Modified the configuration loading process to explicitly check if 'firebase.json' is empty. If so, it initializes an empty configuration object instead of attempting to parse a blank file.
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 addresses an issue where an empty firebase.json file would cause firebase init to fail. The change correctly handles this by checking if the file is empty before attempting to parse it. My review includes a suggestion to improve the performance of this check by using fs.statSync to check the file size instead of reading the entire file content, which avoids reading the file twice.

@joehan joehan requested a review from bkendall October 1, 2025 21:31
joehan and others added 2 commits October 1, 2025 14:32
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Contributor

@bkendall bkendall left a comment

Choose a reason for hiding this comment

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

You could add a test for this in src/config.spec.ts :)

@github-project-automation github-project-automation bot moved this to Changes Requested [PR] in [Cloud] Extensions + Functions Oct 1, 2025
@joehan joehan requested a review from bkendall October 3, 2025 22:11
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.

2 participants