Skip to content
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

Merged
merged 2 commits into from Jul 29, 2020

Conversation

broady
Copy link
Contributor

@broady broady commented Jul 14, 2020

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.

@broady broady requested a review from tritone as a code owner July 14, 2020 06:52
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 14, 2020
@broady broady force-pushed the firestore-emulator branch 2 times, most recently from 43f3855 to 5cad77d Compare July 14, 2020 07:23
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.
@broady broady changed the title firestore: make DetectProjectID work with the emulator firestore, datastore: make DetectProjectID work with the emulator Jul 14, 2020
Copy link
Contributor

@tritone tritone left a 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?

Copy link

@BenWhitehead BenWhitehead left a 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?

@codyoss
Copy link
Member

codyoss commented Jul 23, 2020

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.

@codyoss codyoss added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Jul 23, 2020
@tritone
Copy link
Contributor

tritone commented Jul 29, 2020

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

@tritone tritone merged commit c1e8623 into master Jul 29, 2020
@tritone tritone deleted the firestore-emulator branch July 29, 2020 21:50
tritone added a commit to tritone/google-cloud-go that referenced this pull request Aug 25, 2020
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

firestore: detect-project-id overrides the emulator
5 participants