New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firestore, datastore: make DetectProjectID work with the emulator #2598
Conversation
43f3855
to
5cad77d
Compare
We can use any project ID when the emulator is being used. Try to look detect a real-looking one, and fallback to a dummy ID. Fixes #1751.
5cad77d
to
04bac27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! @BenWhitehead could you take a quick look as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems okay to me, do we have any tests that use either of the emulators?
I wonder if this is something that we should be implementing at a higher level in the cloud.google.com/go module? The detect logic that is. Right now firestore and datastore both do this. The intent was to support this detection in all of the manual layers looking at #1294. There were a handful of CLs that got closed out when we migrated to GitHub. It would be nice if all of our clients honored the same rules with this detection strategy. |
Discussed offline with @codyoss -- we are going to merge this change for now to resolve the immediate issue, and follow up on consistency in projectID detection later |
…pis#2598) We can use any project ID when the emulator is being used. Try to look detect a real-looking one, and fallback to a dummy ID. Fixes googleapis#1751. Co-authored-by: Chris Cotter <cjcotter@google.com>
We can use any project ID when the emulator is being used.
Try to look detect a real-looking one, and fallback to a dummy ID.
Fixes #1751.