pacoavila808 opened a new issue, #36894:
URL: https://github.com/apache/beam/issues/36894

   ### What happened?
   
   There are 3 places that can currently set Firestore project ID (and 2 for 
database ID), and they are not all used consistently.
   
   GcpOptions.projectID is used for the routing header: 
https://github.com/apache/beam/blob/c8d7ca02867ced1cb3cd0476dbcaed48cedd8884/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreStatefulComponentFactory.java#L100
   
   FirestoreOptions.projectId used for RPC requests, but not routing header. 
https://github.com/apache/beam/commit/4df89c704b066b9708d10ff36b8bca6af645c9ab
   
   Database configured in WriteFn used for RPC requests if set (but not used in 
routing header). 
https://github.com/apache/beam/blob/c8d7ca02867ced1cb3cd0476dbcaed48cedd8884/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1WriteFn.java#L376
   
   Fix needed here is to ensure that the precedence of WriteFn -> 
FirestoreOptions -> GcpOptions is respected for the routing header.
   
   Can be reproduced by running the integration test with -PfirestoreDb set to 
anything other than "firestoredb", which is the value hard coded into the 
BaseFirestoreIT.
   
   ```
   ./gradlew integrationTest -p sdks/java/io/google-cloud-platform 
-PgcpProject=<project_id> -PfirestoreDb="(default)" 
--tests=org.apache.beam.sdk.io.gcp.firestore.it.FirestoreV1IT
   ```
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [x] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to