fix(gengapic): Ensure stable order of dynamic routing header parameters#1661
Merged
bhshkh merged 2 commits intogoogleapis:mainfrom Nov 3, 2025
Merged
fix(gengapic): Ensure stable order of dynamic routing header parameters#1661bhshkh merged 2 commits intogoogleapis:mainfrom
bhshkh merged 2 commits intogoogleapis:mainfrom
Conversation
hongalex
reviewed
Nov 3, 2025
| @@ -458,12 +457,24 @@ func (g *generator) insertDynamicRequestHeaders(m *descriptorpb.MethodDescriptor | |||
| g.printf(" routingHeadersMap[%q] = %s", headerName, regexHelper) | |||
Member
There was a problem hiding this comment.
What if we just built routingHeaders like before at this line? Is routingHeadersMap needed to be constructed here (and if not can we get rid of this)
Maybe de-duplication is necessary but I didn't catch that from the description.
16d677c to
8c35986
Compare
hongalex
approved these changes
Nov 3, 2025
This was referenced Nov 4, 2025
bhshkh
added a commit
to googleapis/google-cloud-go
that referenced
this pull request
Nov 10, 2025
#13283) Changes in this PR: 1. firestore_client.go : Updated generated client as per googleapis/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 #13194) and string split (pending from #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](http://go/firestore-query-tracker) for the list of functions. Java reference: - https://github.com/googleapis/java-firestore/blob/ccaf9d4fac5bd87a4da3d37493ca66fdc7681bc3/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Expression.java Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281 - #13282 - googleapis/gapic-generator-go#1661
bhshkh
added a commit
to googleapis/google-cloud-go
that referenced
this pull request
Nov 10, 2025
add collection and collectiongroup stage options similar to Java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/CollectionGroupOptions.java#L34-L36 https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/CollectionOptions.java#L34-L36 https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/CollectionHints.java#L34-L40 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13282 - googleapis/gapic-generator-go#1661
bhshkh
added a commit
to googleapis/google-cloud-go
that referenced
this pull request
Nov 10, 2025
Add ExecuteOptions similar to query run options which was introduced in #10164. GetRawData and GetText implementation similar to Java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/PipelineExecuteOptions.java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/ExplainOptions.java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ExplainStats.java#L42-L71 https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java#L2474-L2498 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281 - #13282 - googleapis/gapic-generator-go#1661 - #13283
shollyman
added a commit
that referenced
this pull request
Nov 13, 2025
This reverts commit 6b4035e.
shollyman
added a commit
that referenced
this pull request
Nov 13, 2025
bhshkh
added a commit
to googleapis/google-cloud-go
that referenced
this pull request
Nov 13, 2025
Add CreateFrom() and Pipeline() similar to Java. https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineSource.java#L140-L164 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281 - #13282 - googleapis/gapic-generator-go#1661 - #13283 - #13274 - #13338
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR fixes an intermittent InvalidArgument error in the Go client library for Firestore when calling the ExecutePipeline RPC.
Problem:
The Firestore backend now enforces a strict order for the parameters in the x-goog-request-params routing header. This was causing intermittent InvalidArgument errors in the Go client library for Firestore, as the ExecutePipeline RPC was failing with the following error:
The root cause of this issue is that the Go client generator was using a map to store the routing header parameters, which does not preserve the order of the parameters. This resulted in the project_id and database_id parameters being sent in a random order, leading to the intermittent failures.
Solution:
This PR fixes the issue by using a slice of strings to store the routing header parameters, which preserves the order in which they are added. This ensures that the x-goog-request-params header is always sent in the correct format, with project_id appearing before database_id.
It also ensures that existing behaviour of last value being used for the header is preserved. For e.g., if there are 2 "foo_name" keys, the last value will be used similar to existing flow.
This fix is based on the AIP for client libraries, which states that the order of fields in the routing header should be stable.
Bug: b/456536006