Skip to content

feat(firestore): pipeline queries snippets#5506

Merged
grayside merged 7 commits intoGoogleCloudPlatform:mainfrom
bhshkh:feature/fspq
Apr 23, 2026
Merged

feat(firestore): pipeline queries snippets#5506
grayside merged 7 commits intoGoogleCloudPlatform:mainfrom
bhshkh:feature/fspq

Conversation

@bhshkh
Copy link
Copy Markdown
Contributor

@bhshkh bhshkh commented Apr 6, 2026

Description

This PR contains Firestore pipline queries snippets. These are 1:1 line conversions from Java's existing PipelineSnippets.java and new ones from googleapis/java-firestore#2365

Checklist

  • I have followed Contributing Guidelines from CONTRIBUTING.MD
  • Tests pass: go test -v ./.. (see Testing)
  • Code formatted: gofmt (see Formatting)
  • Vetting pass: go vet (see Formatting)
  • 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)
    Create a enterprise edition Firestore in Native mode database in test project named 'db-enterprise-01'
  • 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

@bhshkh bhshkh requested review from a team as code owners April 6, 2026 20:00
@product-auto-label product-auto-label Bot added api: firestore Issues related to the Firestore API. samples Issues that are directly related to samples. labels Apr 6, 2026
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Apr 6, 2026

Here is the summary of changes.

You are about to add 191 region tags.

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

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 comprehensive set of Go code snippets demonstrating Firestore pipeline features, including aggregations, array operations, logical expressions, and vector functions. It also adds a corresponding test suite and updates the system test configuration with a new environment variable. Review feedback highlights the need for robust error handling during document writes by using batch operations and emphasizes the importance of closing the Firestore client to prevent resource leaks.

Comment thread firestore/pipeline_snippets_aggregate.go Outdated
Comment thread firestore/pipeline_snippets_concepts.go Outdated
@bhshkh bhshkh enabled auto-merge (squash) April 6, 2026 21:26
Comment thread firestore/pipeline_snippets_aggregate.go Outdated
Comment thread firestore/pipeline_snippets_aggregate.go Outdated
Comment thread firestore/pipeline_snippets_aggregate.go Outdated
Comment thread firestore/pipeline_snippets_select.go Outdated
@bhshkh
Copy link
Copy Markdown
Contributor Author

bhshkh commented Apr 15, 2026

Hi @amcolin,
thanks for the review.
While the Quickstart uses log.Fatalf, it is a standalone main application. For these snippet files, which are designed to be used as examples and tested by capturing output via an io.Writer, the Google Cloud Samples Style Guide https://googlecloudplatform.github.io/samples-style-guide/ recommends: "If the sample can run into errors, write the error message to the provided io.Writer. Don't call log.Fatal or friends."

I have updated all the pipeline snippets to follow this pattern by printing the error message to the provided io.Writer before returning the error. This ensures they are idiomatic for samples and maintain compatibility with our test suite.

@bhshkh bhshkh requested a review from amcolin April 15, 2026 19:11
@amcolin amcolin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 15, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 16, 2026
Copy link
Copy Markdown
Contributor

@amcolin amcolin left a comment

Choose a reason for hiding this comment

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

Everything looks great! I really appreciate the attention to detail on the error handling. Solid approval from me.

@bhshkh
Copy link
Copy Markdown
Contributor Author

bhshkh commented Apr 17, 2026

Kokoro build failures are for packages not related to the changes in this PR. It passes for Firestore.
Screenshot 2026-04-17 at 9 38 24 AM
Screenshot 2026-04-17 at 9 38 12 AM

@grayside grayside disabled auto-merge April 23, 2026 21:57
@grayside grayside merged commit 2894025 into GoogleCloudPlatform:main Apr 23, 2026
9 of 10 checks passed
@bhshkh bhshkh deleted the feature/fspq branch April 23, 2026 22: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. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants