Skip to content

feat(firestore): [PQ] introduce pipeline snapshots#13588

Merged
bhshkh merged 9 commits intogoogleapis:feature/fs-pipeline-queriesfrom
bhshkh:feat/fspq-pipeline-snapshot
Jan 13, 2026
Merged

feat(firestore): [PQ] introduce pipeline snapshots#13588
bhshkh merged 9 commits intogoogleapis:feature/fs-pipeline-queriesfrom
bhshkh:feat/fspq-pipeline-snapshot

Conversation

@bhshkh
Copy link
Copy Markdown
Contributor

@bhshkh bhshkh commented Jan 13, 2026

In Java, Node and Python, Execute returns a Pipeline snapshot. This PR introduces similar structure in Go

https://github.com/googleapis/java-firestore/blob/6e30a6c11efe5d428607bfd78f82ba7b49497bd9/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java#L150-L159

It does not have execution time similar to Java yet. (Coming soon in GA)

@bhshkh bhshkh requested review from a team January 13, 2026 00:18
@bhshkh bhshkh requested a review from a team as a code owner January 13, 2026 00:18
@product-auto-label product-auto-label Bot added the api: firestore Issues related to the Firestore API. label Jan 13, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @bhshkh, 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 refactors the Firestore client's pipeline execution in Go to introduce a PipelineSnapshot type. This change standardizes the API by providing a single entry point for accessing both the streaming results and any associated query explanation statistics, mirroring the design in other language clients. This improves consistency and clarifies the separation of concerns for pipeline output.

Highlights

  • Introduction of PipelineSnapshot: A new PipelineSnapshot struct has been introduced to encapsulate the results of a pipeline execution, aligning the Go client with existing patterns in Java, Node, and Python clients.
  • API Signature Changes: The Execute methods on both Pipeline and Transaction now return a *PipelineSnapshot instead of directly returning a *PipelineResultIterator.
  • ExplainStats Relocation and Renaming: The ExplainStats functionality, including the ExplainStats struct and its associated methods (GetRawData, GetText), has been moved from PipelineResultIterator to the new PipelineSnapshot struct. The methods have also been renamed to RawData() and Text() respectively.
  • Accessing Pipeline Results: A new Results() method has been added to the PipelineSnapshot struct, allowing users to retrieve the underlying PipelineResultIterator.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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.

@bhshkh bhshkh requested a review from daniel-sanche January 13, 2026 00:19
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 the PipelineSnapshot type to align the Go Firestore client with other language versions, which is a good step for consistency. The implementation is mostly solid, with the new type correctly integrated into the Pipeline and Transaction Execute methods. I've identified a few minor areas for improvement in the new firestore/pipeline_snapshot.go file, mainly concerning comment clarity and a small code redundancy. The test updates correctly reflect the API changes.

Comment thread firestore/pipeline_snapshot.go Outdated
Comment thread firestore/pipeline_snapshot.go Outdated
Comment thread firestore/pipeline_snapshot.go Outdated
bhshkh and others added 4 commits January 12, 2026 16:27
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@daniel-sanche daniel-sanche left a comment

Choose a reason for hiding this comment

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

LGTM

@bhshkh
Copy link
Copy Markdown
Contributor Author

bhshkh commented Jan 13, 2026

/gemini review

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 PipelineSnapshot struct, which is now returned by Pipeline.Execute and Transaction.Execute. This change aligns the Go Firestore client with other language clients like Java and Python. The ExplainStats logic has been moved from PipelineResultIterator to the new PipelineSnapshot. The changes are well-implemented, including updates to tests. I have a couple of suggestions to improve documentation clarity.

Comment thread firestore/pipeline.go Outdated
Comment thread firestore/pipeline_snapshot.go Outdated
bhshkh and others added 3 commits January 12, 2026 16:51
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

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

Seems fine. I'm always a little itchy when chaining functions without intermediate checking, but from previous reviews I know this is designed for that callstyle.

@bhshkh bhshkh merged commit adb582c into googleapis:feature/fs-pipeline-queries Jan 13, 2026
8 checks passed
@bhshkh bhshkh deleted the feat/fspq-pipeline-snapshot branch January 13, 2026 17:06
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants