chore: migrate java-firestore to google-cloud-java#12659
chore: migrate java-firestore to google-cloud-java#12659suztomo wants to merge 2075 commits intogoogleapis:mainfrom
Conversation
…v to v1.30.0 (googleapis#2022) * deps: update dependency io.opentelemetry.semconv:opentelemetry-semconv to v1.30.0 * Fix the SERVICE_NAME static import. * Remove unnecessary test dependency. --------- Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com> Co-authored-by: Ehsan Nasiri <ehsann@google.com>
* chore(main): release 3.30.9 * chore: generate libraries at Wed Feb 26 15:28:23 UTC 2025 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore(main): release 3.30.10 * chore: generate libraries at Thu Mar 6 18:28:36 UTC 2025 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
…plugin to v3.1.4 (googleapis#2029) Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com>
…is#2043) Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com>
googleapis#2044) * chore: Update generation configuration at Thu Mar 13 19:45:54 UTC 2025 * chore: generate libraries at Thu Mar 13 19:46:27 UTC 2025 * chore: Update generation configuration at Fri Mar 14 02:27:50 UTC 2025
…v3.45.1 (googleapis#2038) Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com>
googleapis#2045) * chore: Update generation configuration at Sat Mar 15 02:26:49 UTC 2025 * chore: Update generation configuration at Mon Mar 17 02:30:04 UTC 2025 * chore: Update generation configuration at Tue Mar 18 02:29:28 UTC 2025 * chore: Update generation configuration at Wed Mar 19 02:29:06 UTC 2025
* chore(main): release 3.30.11 * chore: generate libraries at Thu Mar 20 00:02:24 UTC 2025 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
… to v0.34.0 (googleapis#2046) Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com>
googleapis#2338) * chore: Update generation configuration at Wed Mar 11 02:50:50 UTC 2026 * chore: Update generation configuration at Thu Mar 12 02:54:23 UTC 2026 * chore: Update generation configuration at Fri Mar 13 02:52:48 UTC 2026 * chore: Update generation configuration at Sat Mar 14 02:51:50 UTC 2026 * chore: generate libraries at Sat Mar 14 02:52:19 UTC 2026 * chore: Update generation configuration at Tue Mar 17 02:54:35 UTC 2026 * chore: Update generation configuration at Wed Mar 18 02:57:59 UTC 2026 * chore: generate libraries at Wed Mar 18 02:58:30 UTC 2026 * chore: Update generation configuration at Thu Mar 19 02:58:17 UTC 2026 * chore: Update generation configuration at Fri Mar 20 02:54:02 UTC 2026 * chore: Update generation configuration at Sat Mar 21 02:49:43 UTC 2026 * chore: Update generation configuration at Sun Mar 22 02:58:18 UTC 2026 --------- Co-authored-by: Lawrence Qiu <lawrenceqiu@google.com>
* chore(main): release 3.39.0 * chore: generate libraries at Mon Mar 23 15:27:04 UTC 2026 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* Add timestamp expressions * chore: generate libraries at Fri Mar 20 14:34:46 UTC 2026 --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
… error (googleapis#2351) * Add support for the parent expression * chore: generate libraries at Mon Mar 30 16:02:57 UTC 2026 * Fix integration tests error due to changes in backend implementation * chore: generate libraries at Mon Mar 30 18:21:43 UTC 2026 * Fix nested field aggregations --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
* chore: add a simple verify skill * feat: DML prototype * make options and returns internal, add update stage (googleapis#2335) * make options and returns internal, add update stage * chore: generate libraries at Wed Mar 4 16:26:17 UTC 2026 --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com> * Add pipeline DML tests and fix update verification * Delete upsert() from Pipeline.java and tests * Delete insert() --------- Co-authored-by: Daniel La Rocque <dlarocque@google.com> Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
* save work * Fix breaking tests * Fix testSingleLookupScalarSubquery * Fix broken tests * change syntax for define and return type of as function * add documentation and overload for getField() * change proto * chore: generate libraries at Thu Feb 26 19:35:06 UTC 2026 * format code * add tests for toArrayExpression * move the subquery test to independent file * Add tests for subcollection * Format code * refactor PipelineExpression * Address feedbacks * Improve documentation * change the test * Test subcollection used within Union stage * replace mapGet with getField * support subcollection in test * chore: generate libraries at Wed Mar 11 18:14:28 UTC 2026 * improve error message * chore: generate libraries at Tue Mar 24 17:04:45 UTC 2026 * add decode support * Make the subquery test only run in nightly environment * address feedbacks * chore: generate libraries at Fri Mar 27 22:19:12 UTC 2026 * remove beta annotation --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
73c4357 to
2aae2ef
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces the Java Firestore SDK, including the core library and admin client, along with Kokoro configurations, documentation, and metadata. The implementation supports features like bulk writes, aggregate queries, and data pipelines. Feedback focuses on several potential NullPointerException vulnerabilities in FirestoreBundle, DocumentSnapshot, and PipelineResult when processing nullable timestamps or non-document results. Additionally, a security concern was raised regarding the exposure of sensitive tokens in a script's git configuration, and improvements were suggested for error handling in scripts and the replacement of deprecated Double constructors.
| fi | ||
|
|
||
| if [ -z "${pr_num}" ]; then | ||
| git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" |
There was a problem hiding this comment.
| latestReadTime = documentSnapshot.getReadTime(); | ||
| } |
There was a problem hiding this comment.
Potential NullPointerException when calling documentSnapshot.getReadTime().compareTo(...) because getReadTime() is @Nullable. The code should use the snapReadTime variable calculated earlier (on line 89), which correctly handles the null case by defaulting to Timestamp.MIN_VALUE.
if (snapReadTime.compareTo(
Timestamp.fromProto(originalDocument.getMetadata().getReadTime()))
> 0) {
latestReadTime = snapReadTime;
}| .setCreateTime(createTime.toProto()) | ||
| .setUpdateTime(updateTime.toProto()); |
There was a problem hiding this comment.
Potential NullPointerException in toDocumentPb() if createTime or updateTime are null. These fields are @Nullable and can be null if the snapshot was created from an object (e.g., via fromObject).
if (createTime != null) {
document.setCreateTime(createTime.toProto());
}
if (updateTime != null) {
document.setUpdateTime(updateTime.toProto());
}| public String getId() { | ||
| return docRef.getId(); | ||
| } |
There was a problem hiding this comment.
| .putAllFields(fields) | ||
| .setCreateTime(createTime.toProto()) | ||
| .setUpdateTime(updateTime.toProto()); | ||
| } |
There was a problem hiding this comment.
Potential NullPointerException in toDocumentPb() if docRef, createTime, or updateTime are null. These fields can be null for non-document results or results without timestamps (like those from aggregations).
if (docRef != null) {
document.setName(docRef.getName());
}
document.putAllFields(fields);
if (createTime != null) {
document.setCreateTime(createTime.toProto());
}
if (updateTime != null) {
document.setUpdateTime(updateTime.toProto());
}| echo "The latest version of ${group_id}:${artifact_id} is empty." | ||
| echo "The returned json from maven.org is invalid: ${json_content}" |
There was a problem hiding this comment.
The error message uses an undefined variable ${json_content} and incorrectly refers to the response as JSON, while the URL on line 19 points to an XML file (maven-metadata.xml). It should use ${xml_content} instead.
| echo "The latest version of ${group_id}:${artifact_id} is empty." | |
| echo "The returned json from maven.org is invalid: ${json_content}" | |
| echo "The latest version of ${group_id}:${artifact_id} is empty." | |
| echo "The returned XML from maven.org is invalid: ${xml_content}" | |
| exit 1 |
| /** | ||
| * Set the initial maximum number of operations per second allowed by the throttler. | ||
| * | ||
| * @param initialOpsPerSecond The initial maximum number of operations per second allowed by the |
There was a problem hiding this comment.
Use of deprecated new Double(double) constructor. It is recommended to use Double.valueOf(double) instead for better performance and future compatibility.
| * @param initialOpsPerSecond The initial maximum number of operations per second allowed by the | |
| return setInitialOpsPerSecond(Double.valueOf(initialOpsPerSecond)); |
| /** | ||
| * Set the maximum number of operations per second allowed by the throttler. | ||
| * | ||
| * @param maxOpsPerSecond The maximum number of operations per second allowed by the throttler. |
There was a problem hiding this comment.
ff638e1 to
9d0df5d
Compare
9d0df5d to
e8326fb
Compare
b/477663340