Skip to content

feat(firestore): add firestore recursive delete sample#10263

Merged
iennae merged 4 commits into
GoogleCloudPlatform:mainfrom
alarconesparza:alarconesparza-firebase-delete-collection
May 11, 2026
Merged

feat(firestore): add firestore recursive delete sample#10263
iennae merged 4 commits into
GoogleCloudPlatform:mainfrom
alarconesparza:alarconesparza-firebase-delete-collection

Conversation

@alarconesparza
Copy link
Copy Markdown
Contributor

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • Appropriate changes to README are included in PR
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • Tests pass: mvn clean verify required
  • Lint passes: mvn -P lint checkstyle:check required
  • Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label May 9, 2026
Copy link
Copy Markdown
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 Java sample for recursively deleting Firestore collections, including the necessary Maven configuration, an integration test, and a utility class. Feedback focuses on improving resource management by using try-with-resources for Firestore instances, ensuring test stability by correctly restoring System.out, and maintaining assertion consistency by using JUnit 5 throughout the integration test.

Comment thread firebase/samples/src/test/java/com/example/firebase/DeleteCollectionIT.java Outdated
Comment thread firebase/samples/src/main/java/com/example/firebase/DeleteCollection.java Outdated

package com.example.firebase;

import static org.junit.Assert.assertTrue;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Mixing JUnit 4 and JUnit 5 assertions is discouraged. Since this test uses JUnit 5 (@Test, @BeforeAll), please use the JUnit 5 Assertions class for all assertions.

Suggested change
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;

Comment thread firebase/samples/src/test/java/com/example/firebase/Utils.java Outdated
Comment thread firebase/samples/src/main/java/com/example/firebase/DeleteCollection.java Outdated
@alarconesparza alarconesparza changed the title feat(firebase): add firebase recursive delete sample feat(firestore): add firebase recursive delete sample May 9, 2026
Comment thread firestore/samples/src/main/java/com/example/firestore/DeleteCollection.java Outdated
@alarconesparza alarconesparza changed the title feat(firestore): add firebase recursive delete sample feat(firestore): add firestore recursive delete sample May 9, 2026
@alarconesparza alarconesparza marked this pull request as ready for review May 9, 2026 05:36
@alarconesparza alarconesparza requested review from a team and yoshi-approver as code owners May 9, 2026 05:36
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented May 9, 2026

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label Bot added the api: firestore Issues related to the Firestore API. label May 9, 2026
@iennae iennae merged commit a630c7b into GoogleCloudPlatform:main May 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the Firestore API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants