Skip to content

Conversation

ehsannas
Copy link
Contributor

@ehsannas ehsannas commented Aug 15, 2025

Adds the following commands:

firestore:operations:list     [--database="(default)"][--limit=100]
firestore:operations:describe [--database="(default)"] <operation_name>
firestore:operations:cancel   [--database="(default)"] <operation_name>
image

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.

Summary of Changes

Hello @ehsannas, 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 significantly enhances the Firebase CLI's interaction with Cloud Firestore by introducing a new set of commands for managing long-running administrative operations. Users can now easily list, describe, and cancel these operations directly from the command line, providing greater control and visibility over background tasks like data imports/exports or index creations. This change streamlines the workflow for developers and administrators who frequently interact with Firestore's operational aspects.

Highlights

  • New Firestore Operations Commands: Three new commands have been introduced under firestore:operations: list, describe, and cancel. These commands provide direct CLI access to manage Cloud Firestore's long-running administrative operations.
  • API Integration: The underlying FirestoreApi has been extended with new methods (listOperations, describeOperation, cancelOperation) to facilitate communication with the Firestore backend for these administrative tasks.
  • Type Definitions: New TypeScript interfaces (Operation, ListOperationsResponse) have been added to src/firestore/api-types.ts to ensure type safety and clarity when handling Firestore operation data.
  • Operation Name Utility: A new utility function, getShortOperationName, was added to handle parsing of full or short operation names, improving flexibility for user input.
  • Enhanced User Experience and Error Handling: The cancel command now includes a confirmation prompt (unless --force is used) and improved error handling for cases where an operation is already completed.
  • New Unit Tests: Comprehensive unit tests have been added for each new command, ensuring their reliability and correct behavior across various scenarios.
  • Improved Console Output: New pretty-printing capabilities have been added to display Firestore operations in a human-readable, tabular format in the console, enhancing output readability.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 introduces new commands for managing Cloud Firestore long-running operations: list, describe, and cancel. The implementation is well-structured, adding new API helpers, command definitions, and corresponding tests.

My review has identified a few issues:

  • A critical typo in the command registration that would prevent the describe command from working.
  • Some leftover debugging console.log statements in the API client.
  • An inaccurate command description for the cancel command.
  • An opportunity to improve the output format of the list command for better readability and consistency with other CLI commands.

Additionally, there is a small typo in the pull request title ('comamnds').

After addressing these points, this will be a great addition to the Firestore CLI tooling.

@ehsannas
Copy link
Contributor Author

/gemini review

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 adds new commands for managing Firestore long-running operations (list, describe, cancel). The implementation is well-structured and includes corresponding tests. I've provided a few suggestions to improve code consistency, documentation, and error handling robustness. Overall, this is a great addition.

@ehsannas
Copy link
Contributor Author

/gemini review

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 adds three new commands for managing Firestore long-running operations: list, describe, and cancel. The implementation includes the command definitions, corresponding API calls, and unit tests. The code is well-structured and the new commands are a valuable addition. My feedback includes a couple of suggestions to improve the implementation for better error handling, to avoid dead code, and to fix a bug in option parsing.

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 70.87379% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.71%. Comparing base (00ae2e4) to head (abac692).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/firestore/api.ts 0.00% 16 Missing ⚠️
src/firestore/pretty-print.ts 0.00% 13 Missing ⚠️
src/commands/firestore-operations-cancel.ts 96.15% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8982      +/-   ##
==========================================
+ Coverage   49.55%   49.71%   +0.15%     
==========================================
  Files         673      677       +4     
  Lines       38477    38579     +102     
  Branches     7676     7681       +5     
==========================================
+ Hits        19066    19178     +112     
+ Misses      17879    17862      -17     
- Partials     1532     1539       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ehsannas ehsannas marked this pull request as ready for review August 20, 2025 20:35
@ehsannas ehsannas requested a review from joehan August 20, 2025 21:10
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