-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Firestore managed bulk delete #8974
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 introduces a new firestore:bulk-delete
command to the Firebase CLI, enabling users to perform managed bulk deletion of documents within Firestore databases. This feature provides a streamlined way to delete documents from specified collection groups or all collection groups, enhancing data management capabilities for Firestore users.
Highlights
- New CLI Command: Implements
firebase firestore:bulk-delete
for initiating managed bulk document deletions. - Configurable Deletion Scope: Allows users to specify a comma-separated list of collection group IDs to delete, or to delete all collection groups if none are specified.
- Confirmation Prompt: Includes a mandatory confirmation step before executing destructive bulk delete operations.
- Firestore API Integration: Adds new API types and a method within the Firestore API client to interact with the backend's bulk delete service.
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 a new firestore:bulk-delete
command for managed bulk deletion of documents in Firestore. The changes include the command implementation, corresponding API types and methods, and unit tests.
My review has identified a critical issue in the command's implementation where an optional flag is incorrectly treated as mandatory, preventing a core feature from working. I've also pointed out an unnecessary permission check that could cause issues for users, and a redundant test case that can be removed to improve maintainability. Please see the detailed comments for suggestions on how to address these points.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8974 +/- ##
==========================================
- Coverage 52.18% 50.89% -1.29%
==========================================
Files 418 515 +97
Lines 30694 33504 +2810
Branches 6348 6952 +604
==========================================
+ Hits 16018 17053 +1035
- Misses 13234 14949 +1715
- Partials 1442 1502 +60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
/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 introduces a new firestore:bulk-delete
command. The implementation has a significant issue where it contradicts its own documentation regarding the --collection-ids
flag, making it mandatory instead of optional. This prevents the 'delete all' functionality. My review includes suggestions to fix this logic in the command, the API layer, and the corresponding tests. I've also pointed out a redundant permission check and a duplicate test case to improve code quality.
/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 introduces a new firestore:bulk-delete
command to allow managed bulk deletion of documents from Firestore collection groups. The implementation includes the command logic, API integration, type definitions, and unit tests. The code is well-structured and follows existing patterns. My main feedback is a critical point about handling empty collection-ids
, which could lead to a confusing and dangerous user experience. I've suggested a change to make this behavior safer and more explicit.
/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 introduces a new firestore:bulk-delete
command, a valuable addition for managing Firestore data. The implementation is well-structured, including the core command logic, API integration, and corresponding tests. I've identified a couple of areas where the code can be improved for clarity and maintainability, specifically regarding some dead code and an opportunity for simplification in the API handling.
No description provided.