Skip to content

Allow empty string to be used for the source and destination database#3645

Merged
ninjaAB-5 merged 9 commits intoGoogleCloudPlatform:mainfrom
le-michael:patch-1
Apr 9, 2026
Merged

Allow empty string to be used for the source and destination database#3645
ninjaAB-5 merged 9 commits intoGoogleCloudPlatform:mainfrom
le-michael:patch-1

Conversation

@le-michael
Copy link
Copy Markdown
Contributor

An INVALID_ARGUMENT is thrown when (default) is used as the source or destination database.

Response message:

com.google.datastore.v1.client.DatastoreException: (default) is not a valid databaseId. Please use the empty string to denote the (default) database

An INVALID_ARGUMENT is thrown when `(default)` is used as the source or destination database.

```
com.google.datastore.v1.client.DatastoreException: (default) is not a valid databaseId. Please use the empty string to denote the (default) database
```
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 updates the Firestore-to-Firestore template to align with API requirements regarding the default database. By allowing empty strings as valid inputs for database identifiers and updating the associated documentation, the change resolves an issue where using '(default)' caused an invalid argument error.

Highlights

  • Documentation Update: Updated help text for source and destination database options to correctly instruct users to use an empty string instead of '(default)' for the default database.
  • Validation Logic Change: Modified the validation logic to allow empty strings for source and destination database IDs, as empty strings are now the required format for the default database.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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.

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

@pacoavila808 pacoavila808 left a comment

Choose a reason for hiding this comment

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

Could you add a test case using default databases to v2/firestore-to-firestore/src/test/java/com/google/cloud/teleport/v2/templates/FirestoreToFirestoreIT.java ?

@pull-request-size pull-request-size Bot added size/M and removed size/XS labels Apr 8, 2026
@le-michael
Copy link
Copy Markdown
Contributor Author

Could you add a test case using default databases to v2/firestore-to-firestore/src/test/java/com/google/cloud/teleport/v2/templates/FirestoreToFirestoreIT.java ?

Done.

@ninjaAB-5 ninjaAB-5 self-requested a review April 8, 2026 16:41
ninjaAB-5
ninjaAB-5 previously approved these changes Apr 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.47%. Comparing base (2ffe370) to head (aa24d5c).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...ud/teleport/v2/templates/FirestoreToFirestore.java 0.00% 5 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #3645       +/-   ##
=============================================
+ Coverage     33.32%   52.47%   +19.14%     
- Complexity      481     5791     +5310     
=============================================
  Files           215     1057      +842     
  Lines         12862    63983    +51121     
  Branches       1262     7052     +5790     
=============================================
+ Hits           4286    33573    +29287     
- Misses         8236    28134    +19898     
- Partials        340     2276     +1936     
Components Coverage Δ
spanner-templates 72.30% <ø> (∅)
spanner-import-export 68.76% <ø> (∅)
spanner-live-forward-migration 80.86% <ø> (∅)
spanner-live-reverse-replication 78.22% <ø> (∅)
spanner-bulk-migration 89.31% <ø> (∅)
gcs-spanner-dv 85.73% <ø> (∅)
Files with missing lines Coverage Δ
...ud/teleport/v2/templates/FirestoreToFirestore.java 0.00% <0.00%> (ø)

... and 863 files with indirect coverage changes

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

ninjaAB-5
ninjaAB-5 previously approved these changes Apr 8, 2026
ninjaAB-5
ninjaAB-5 previously approved these changes Apr 8, 2026
ninjaAB-5
ninjaAB-5 previously approved these changes Apr 8, 2026
@le-michael
Copy link
Copy Markdown
Contributor Author

Note for debugging tomorrow

2026-04-08T22:04:44.2614405Z Caused by: java.util.concurrent.ExecutionException: com.google.api.gax.rpc.FailedPreconditionException: io.grpc.StatusRuntimeException: FAILED_PRECONDITION: The Cloud Firestore API is not available for Firestore in Datastore Mode database projects/cloud-teleport-testing/databases/(default).
2026-04-08T22:04:44.2616907Z 	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:592)
2026-04-08T22:04:44.2618027Z 	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:571)
2026-04-08T22:04:44.2619000Z 	at com.google.api.core.AbstractApiFuture.get(AbstractApiFuture.java:53)
2026-04-08T22:04:44.2620599Z 	at org.apache.beam.it.gcp.firestore.FirestoreResourceManager.deleteCollection(FirestoreResourceManager.java:127)
2026-04-08T22:04:44.2622430Z 	at org.apache.beam.it.gcp.firestore.FirestoreResourceManager.cleanupAll(FirestoreResourceManager.java:108)
2026-04-08T22:04:44.2623350Z 	... 26 more
2026-04-08T22:04:44.2625045Z Caused by: com.google.api.gax.rpc.FailedPreconditionException: io.grpc.StatusRuntimeException: FAILED_PRECONDITION: The Cloud Firestore API is not available for Firestore in Datastore Mode database projects/cloud-teleport-testing/databases/(default).

@pull-request-size pull-request-size Bot added size/S and removed size/L labels Apr 9, 2026
@ninjaAB-5 ninjaAB-5 merged commit be7ffcb into GoogleCloudPlatform:main Apr 9, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants