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

Enable a function to be emulated in multiple regions #3364

Merged
merged 6 commits into from
May 19, 2021

Conversation

kmcnellis
Copy link
Member

@kmcnellis kmcnellis commented May 13, 2021

Description

Enable function emulation for all the regions listed in the .region('us-central1','europe-west1') config (not just the first one)

Scenarios Tested

  • Hosting function rewrites
  • Firestore background trigger
  • Directly calling function url

Changed output

✔  functions[us-central1-express]: http function initialized (http://localhost:5001/test-project/us-central1/express).
✔  functions[europe-west1-test]: http function initialized (http://localhost:5001/test-project/europe-west1/test).
✔  functions[europe-west2-test]: http function initialized (http://localhost:5001/test-project/europe-west2/test).
✔  functions[europe-west1-fire3]: firestore function initialized.
✔  functions[europe-west2-fire3]: firestore function initialized.
✔  functions[us-central1-fire4]: firestore function initialized.
✔  functions[europe-west2-fire4]: firestore function initialized.

@kmcnellis kmcnellis requested a review from samtstern May 13, 2021 06:56
@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label May 13, 2021
@kmcnellis kmcnellis force-pushed the multiregion-function-emulation branch from 79bd13d to a95fe7b Compare May 13, 2021 06:56
@kmcnellis kmcnellis marked this pull request as ready for review May 13, 2021 07:07
src/emulator/functionsEmulator.ts Outdated Show resolved Hide resolved
src/emulator/functionsEmulatorShared.ts Outdated Show resolved Hide resolved
src/emulator/functionsEmulatorShared.ts Show resolved Hide resolved
src/emulator/functionsEmulatorShared.ts Outdated Show resolved Hide resolved
@kmcnellis kmcnellis force-pushed the multiregion-function-emulation branch 2 times, most recently from 35087cf to 8ec122a Compare May 18, 2021 05:05
@kmcnellis kmcnellis requested a review from samtstern May 18, 2021 05:05
@samtstern
Copy link
Contributor

@kmcnelis approved, just have to deal with the test failures

@kmcnellis
Copy link
Member Author

Oh, odd. I ran npm run test, but I guess that doesn't include everything

@kmcnellis kmcnellis force-pushed the multiregion-function-emulation branch from 285e4fe to 97934d1 Compare May 19, 2021 01:30
@samtstern samtstern merged commit 92e1809 into master May 19, 2021
@kmcnellis kmcnellis deleted the multiregion-function-emulation branch May 19, 2021 18:12
@jirizavadil
Copy link

Hi,
although nice addition, this broke every firebase.functions().httpsCallable('lala') for me 🙃

Emulator now expects firebase.functions().httpsCallable('region-lala'), which differs from the cloud environment. I have most functions in europe-west1 and rest in us-central. No function is in multiple regions.

@samtstern
Copy link
Contributor

@jirizavadil oh no, thanks for filing this! I'll start a new issue.

@samtstern
Copy link
Contributor

@jirizavadil please comment on #3418 to let me know how to reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants