-
Notifications
You must be signed in to change notification settings - Fork 950
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
Emulator does not use default
project, if multiple projects are found in .firebaserc
(and firebase use <alias>
requires a valid login session)
#7624
Comments
Hey @exetico, thanks for providing a detailed report and for sharing what you've tried so far! I think you should be able to pass a value to the I'm currently able to run the |
You're right! Maybe firebase emulators:exec --help
Usage: firebase emulators:exec [options] <script>
start the local Firebase emulators, run a test script, then shut down the emulators
Options:
--only <emulators> only specific emulators. This is a comma separated list of emulator names. Valid options are: ["auth","functions","firestore","database","hosting","pubsub","storage","eventarc","dataconnect","tasks"]
--inspect-functions [port] emulate Cloud Functions in debug mode with the node inspector on the given port (9229 if not specified)
--import [dir] import emulator data from a previous export (see emulators:export)
--export-on-exit [dir] automatically export emulator data (emulators:export) when the emulators make a clean exit (SIGINT), when no dir is provided the location of --import [dir] is used
--log-verbosity <verbosity> One of: DEBUG, INFO, QUIET, SILENT.
--ui run the Emulator UI
-h, --help output usage information With that said: The original issue, where I'm unable to run with the "default" project, if multiple projects listed in I'll use |
Hey @exetico. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Thanks for the feedback, just providing a quick update on this based on our discussions with the team.
Yes, we agree with you here, we should definitely update the output of
Similar to what you mentioned, we think that falling back to using the default project when no project is explicitly set would be the expected behavior here. In case we may have misunderstood your feedback in any way, please let us know. |
As this point, we're aligned.
|
Fixed the main issue here in #7804, which released yesterday with 13.21.0. The help text fix will come later - turns out the CLI pacakge we use (commander) makes this slightly more difficult than expected. |
Thank you joehan. That's much appreciated. |
[REQUIRED] Environment info
firebase-tools: 13.16.0
Platform: macOS, Ubuntu
[REQUIRED] Test case
.firebaserc
for the emulatorfirebase emulators:exec 'npm run __jest'
right now)No project active, but project aliases are available.
[REQUIRED] Steps to reproduce
Do above test-case to reproduce the scenario.
I'm facing the problem as part of a GitHub Workflow solution, where I run Jest in the emulated Firebase suite, and don't want to login, just in order to run the test.
However, having multiple projects in
.firebaserc
will trigger a "select a active project" prompt, but, usingfirebase use
requires a login. Stripping down.firebaserc
to only contain adefault
project, does fix the problem, as it's just starting the emulator, without promping me to set a active project.[REQUIRED] Expected behavior
firebase use
. Else, I'd like to force it to do so, with a flag (or similar).[REQUIRED] Actual behavior
Alternative solution
If I was able to execute
firebase use default
without having to deal with login, it was easy to work around.But right now,, I'm unable to execute
firebase use <alias>
without a env where I'm logged in.In other words, my only work-around right now, is simply to have a
.firebaserc
file with:As the emulator does pick up the default project in this scenario, and no other projects are listed in
.firebaserc
.But, maybe I've missed yet another alternative solution? It just a bit odd that having multiple projects in
.firebaserc
does end up as a problem, which I'm currently unable to fix, without logging in.The
firebase emulators:exec
does not give me a option to add "--project", which would also be another possible way of controlling this.The text was updated successfully, but these errors were encountered: