Skip to content

feat(firestore): [PQ] general, key, type, logical and object functions#13283

Merged
bhshkh merged 6 commits intogoogleapis:feature/fs-pipeline-queriesfrom
bhshkh:feat/fspq-general-key-logical-object
Nov 10, 2025
Merged

feat(firestore): [PQ] general, key, type, logical and object functions#13283
bhshkh merged 6 commits intogoogleapis:feature/fs-pipeline-queriesfrom
bhshkh:feat/fspq-general-key-logical-object

Conversation

@bhshkh
Copy link
Copy Markdown
Contributor

@bhshkh bhshkh commented Nov 1, 2025

Changes in this PR:

  1. firestore_client.go : Updated generated client as per fix(gengapic): Ensure stable order of dynamic routing header parameters gapic-generator-go#1661 . Removed retries from tests since the headers have now been fixed.
  2. Remove Equivalent since it was removed from backend.
  3. Add/update comments
  4. Add timestamp truncate (pending from feat(firestore): [PQ] Add all Aggregation and Timestamp functions #13194) and string split (pending from feat(firestore): [PQ] add all array, string and vector functions #13245) functions.
  5. add all the private preview general, key, logical (except iferror), type and object functions.
    See "Firestore Features (Pipeline)" sheet in go/firestore-query-tracker for the list of functions.
    Java reference:

Previous pull requests

@product-auto-label product-auto-label Bot added the api: firestore Issues related to the Firestore API. label Nov 1, 2025
@bhshkh
Copy link
Copy Markdown
Contributor Author

bhshkh commented Nov 1, 2025

/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 comprehensive set of new pipeline functions for Firestore, including general, key, logical, and object manipulation functions. The changes are well-structured, with corresponding updates to interfaces, implementations, and extensive integration tests. The code quality is high, but I've identified a couple of areas for improvement: one related to a potentially leftover testing change in the integration test setup, and another concerning code duplication that could be refactored for better maintainability. Overall, this is a solid contribution that significantly enhances the pipeline query capabilities.

Comment thread firestore/integration_test.go Outdated
Comment thread firestore/pipeline_function.go Outdated
@bhshkh bhshkh force-pushed the feature/fs-pipeline-queries branch 2 times, most recently from 75ef6c1 to a2fb94c Compare November 3, 2025 22:14
@bhshkh bhshkh force-pushed the feat/fspq-general-key-logical-object branch from 48bb423 to 5c23efa Compare November 3, 2025 22:18
@bhshkh bhshkh force-pushed the feat/fspq-general-key-logical-object branch from 5c23efa to b865ed6 Compare November 3, 2025 22:33
@bhshkh
Copy link
Copy Markdown
Contributor Author

bhshkh commented Nov 4, 2025

/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 several new pipeline functions for Firestore, including general, key, logical, and object functions, along with corresponding integration tests. The changes are a good addition to the feature set. My review focuses on improving performance, ensuring deterministic behavior, adhering to Go conventions, and fixing some minor issues in the tests. I've identified a couple of high-severity issues related to performance and potential bugs that should be addressed. Other comments are of medium severity and aim to improve code quality and maintainability.

Comment thread firestore/apiv1/firestore_client.go
Comment thread firestore/pipeline_function.go
Comment thread firestore/integration_test.go Outdated
Comment thread firestore/pipeline_expr.go Outdated
Comment thread firestore/pipeline_expr.go Outdated
Comment thread firestore/pipeline_function.go
Comment thread firestore/pipeline_integration_test.go Outdated
Comment thread firestore/pipeline_integration_test.go Outdated
@bhshkh
Copy link
Copy Markdown
Contributor Author

bhshkh commented Nov 5, 2025

/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 significant number of new pipeline functions for Firestore, including general, key, logical, and object functions, along with their corresponding integration tests. The changes are extensive and well-tested. My review focuses on improving code efficiency, fixing a critical compilation error, and addressing a bug in the test suite. Overall, this is a great addition, and with a few adjustments, it will be even better.

Comment thread firestore/pipeline_stage.go Outdated
Comment thread firestore/pipeline_integration_test.go Outdated
Comment thread firestore/apiv1/firestore_client.go
Comment thread firestore/pipeline_function.go Outdated
Comment thread firestore/pipeline_integration_test.go Outdated
@bhshkh bhshkh changed the title feat(firestore): [PQ] general, key, logical and object functions feat(firestore): [PQ] general, key, type, logical and object functions Nov 5, 2025
@bhshkh bhshkh marked this pull request as ready for review November 5, 2025 19:55
@bhshkh bhshkh requested review from a team November 5, 2025 19:55
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

func typeFuncs(t *testing.T) {
t.Parallel()
h := testHelper{t}
client := integrationClient(t)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

consider adding defer client.Close line in tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All the tests use the same client

// integrationClient should be called by integration tests to get a valid client. It will never
// return nil. If integrationClient returns, an integration test can proceed without
// further checks.
func integrationClient(t *testing.T) *Client {
if testing.Short() {
t.Skip("Integration tests skipped in short mode")
}
if iClient == nil {
t.SkipNow() // log message printed in initIntegrationTest
}
return iClient
}

The client is closed here after all the tests run:

@bhshkh bhshkh merged commit b80712a into googleapis:feature/fs-pipeline-queries Nov 10, 2025
9 of 10 checks passed
@bhshkh bhshkh deleted the feat/fspq-general-key-logical-object branch November 10, 2025 19:50
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