Skip to content

Conversation

@ehsannas
Copy link
Contributor

No description provided.

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 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

  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 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-commenter
Copy link

Codecov Report

❌ Patch coverage is 61.36364% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.89%. Comparing base (f1c2d21) to head (b797847).
⚠️ Report is 40 commits behind head on master.

Files with missing lines Patch % Lines
src/commands/firestore-bulk-delete.ts 71.05% 8 Missing and 3 partials ⚠️
src/firestore/api.ts 0.00% 6 Missing ⚠️
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.
📢 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 self-assigned this Aug 15, 2025
@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 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.

@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 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.

@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 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.

@ehsannas ehsannas requested a review from joehan August 20, 2025 21:10
Copy link
Contributor

@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.

Add a changelog entry describing the new command, but lgtm otherwise

"--collection-ids <collectionIds>",
"A comma-separated list of collection group IDs to delete. Deletes all documents in the specified collection groups.",
)
.before(requirePermissions, ["datastore.databases.bulkDeleteDocuments"])
Copy link
Contributor

Choose a reason for hiding this comment

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

This command probably also needs .before(requireAuth)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually none of the firestore-* commands have requireAuth. They all use requirePermissions.

I realized the spec test doesn't need to use requireAuth either. Removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out reuireAuth is needed for spec tests. But it doesn't seem to be needed for the command itself since requirePermissions is a less restrictive and more accurate requirement. (for example: maybe you're not fully authenticated to do ALL firebase admin operations, but your service account does give you permission to do SOME firebase admin operations).

@ehsannas ehsannas merged commit 4b73b96 into master Sep 10, 2025
48 checks passed
@ehsannas ehsannas deleted the ehsann/bulk-delete branch September 10, 2025 17:29
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Sep 10, 2025
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