-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Add firestore:operations:*
comamnds
#8982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
, andcancel
. 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 tosrc/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
-
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. ↩
There was a problem hiding this 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.
/gemini review |
There was a problem hiding this 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.
/gemini review |
There was a problem hiding this 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 Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
Adds the following commands: