Firebase-tools: Setup a projet using Firestore

Created on 3 Jan 2019  路  7Comments  路  Source: firebase/firebase-tools

Version info

Version 1.2.0

Platform Information

OS X

Steps to reproduce

I init a Firebase project with the CLI, and enable the Hosting and Firestore features. But when I want to link my local project to the one created on the Cloud UI, its name doesn't appear in the CLI.

Why ? Because I did not enable Firestore in the Cloud UI.

Expected behavior

We can maybe display error/warning to the user in order to help him.

Two possible solutions:

  • when we display the list of projects, we can maybe display a warning message with all projects not eligible.
  • display all projects in the console and throw an error if we deploy an application with features not enabled in the UI.

Actual behavior

My project doesn't appear in the available project list.

feature request question

Most helpful comment

We're exploring integrating the new Project Management API into the CLI, but probably not in an "automatically add Firebase to stuff" way (there are too many times when that would be Not What People Want).

It's on our radar -- can't comment on timeline, but I've got a doc somewhere that I'm proposing how this should maybe work :smile:

All 7 comments

When you say "Cloud UI", are you referring to Google Cloud Console?

I ask because if so, you are correct: a project created in the Google Cloud Console will not show up in firebase init (or firebase list, for that matter). You would first have to go to the Firebase console and enable it there (or as you pointed out, enable one of the Firebase APIs which causes a cascade of things in the backend that does something similar).

I also think you're right that we could do better. I'm going to pass this along and leave it open to get that confirmation from you, but I can't say if/when this will be acted on. Thanks for the report and the suggestions!!

Yes. I mean the Google cloud console. :)

The CLI could also list the available projects that don't have Firebase enabled, separating them clearly somehow, and then automatically trigger the addFirebase method from the Project Management API if one of those is selected. I think that would be a good option as long as there's a clear warning shown to the user before performing that operation.

Unless the team is considering a different solution, I'd be happy to open a PR with these changes :-)

I thought I had responded to this, but evidently I didn't...

I'm passing this idea off to @mbleigh as he will have a better idea if this is feasible. I know it's _possible_, but there's sometimes reasons(tm) why the CLI does things it does.

We're exploring integrating the new Project Management API into the CLI, but probably not in an "automatically add Firebase to stuff" way (there are too many times when that would be Not What People Want).

It's on our radar -- can't comment on timeline, but I've got a doc somewhere that I'm proposing how this should maybe work :smile:

I used the latest version of the CLI last week for a codelab during Devfest Paris. And I had a different behavior I think.
I init with the CLI a firebase project with only the cloud function enabled. But I wanted to link this new project with the one created via GCP console, the name of the project did not appear.
I had to enable Firestore on the GCP console (even if I did not select Firestore with the CLI), in order to see it.

I think I hit the same bug with a new symptom. If I try firebase deploy without initializing Firestore, I get an error that the project doesn't exist rather than an error that Firestore hasn't been set up.

Was this page helpful?
0 / 5 - 0 ratings