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

--force does not apply to firebase deploy --only storage, so programmatically provision are not possible #7499

Closed
exetico opened this issue Jul 29, 2024 · 2 comments · Fixed by #7503

Comments

@exetico
Copy link

exetico commented Jul 29, 2024

Environment info

firebase-tools: 13.14.2 (also tested with 13.0.0)

Platform: macOS

Test case

I'd really like to provide this, but this is just a empty Firebase project, with nothing in it.

The steps to initate the Firebase project looks something like this:

  • Add Firestore to project: firebase projects:addfirebase "testproject-dev"
  • Use project: firebase use testproject-dev
  • Enable API's: gcloud services enable firestore.googleapis.com --project=testproject-dev
  • Create default Firestore DB: firebase firestore:databases:create "(default)" --location "eur3" --project "testproject-dev"
  • Setup the defaultLocation for Firestore with the API endpoint: /projects/${project_id}/defaultLocation:finalize?locationId=${location_id}
  • Initiate storage with firebase init storage --project testproject-dev
  • Now try and deploy the storage: firebase deploy --only storage --force --project testproject-dev

Steps to reproduce

  • Follow the steps in the test case to initate the Firebase project, where defaultLocation are set, and a Firestore database are created
  • Run firebase init storage --project testproject-dev to initate the Firebase Storage part
  • Run firebase deploy --only storage --force --project testproject-dev
  • See that a Y/n prompt shows up. That's my problem, as I've added --force to the statement

Expected behavior

I expect the --force param to force the IAM roles to be granted without user interaction (edit: fixed the missing 'out').

Actual behavior

I'm prompted with:

? Cloud Storage for Firebase needs an IAM Role to use cross-service rules. Grant the new role? (Y/n)

Even though the -f, --force states: "bypass interactive prompts:". I expect and need the prompt to be bypassed and answered with Yes (Y).

Right now, I'm unable to make a programmatically provisioned Firebase stack, which I'd like to do. For this project, I'm not going to use Terraform, due to a few known limits around Firebase V2 functions, but also other decisions. I also think the use of --force should be applied for this kind of yes/no questions.

If --force was not meant to handle the IAM Role specific prompt, I expect another flag to enforce a "yes" answer, on a prompt like firebase deploy storage. There's possibly other situations, where this applies, too.

@aalej
Copy link
Contributor

aalej commented Jul 29, 2024

Hey @exetico, thanks for the thorough report! This is appreciated. I was able to reproduce the behavior you mentioned. I’ll raise this to our engineering team so they can take a look.

@exetico
Copy link
Author

exetico commented Jul 30, 2024

Thank you, to both of you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants