Skip to content

Enable a function to be emulated in multiple regions#3364

Merged
samtstern merged 6 commits into
masterfrom
multiregion-function-emulation
May 19, 2021
Merged

Enable a function to be emulated in multiple regions#3364
samtstern merged 6 commits into
masterfrom
multiregion-function-emulation

Conversation

@kmcnellis

@kmcnellis kmcnellis commented May 13, 2021

Copy link
Copy Markdown
Member

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
Comment thread src/emulator/functionsEmulator.ts Outdated
Comment thread src/emulator/functionsEmulatorShared.ts Outdated
Comment thread src/emulator/functionsEmulatorShared.ts
Comment thread src/emulator/functionsEmulatorShared.ts Outdated
@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
Copy Markdown
Contributor

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

@kmcnellis

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Contributor

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

@samtstern

Copy link
Copy Markdown
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