You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enabling indexes in databases is a common practice. Many projects dedicate a separate CI step to DB schema/index changes before deploying new application code.
Firebase problem
Firebase provides the following functionality to deploy indexes:
The command does not wait for the end of index deployment in the database. This may result in the following failure:
Run firebase deploy --only=firestore:indexes --force, which is asynchronous operation.
Deploy frontend or backend applications with queries requiring new Firstore indexes.
⚠️ Step 2 is completed, while indexes deployment is still in progress. At runtime, users will see Firestore query errors that require enabling new indexes.
Current workarounds
It is possible to run gcloud firestore operations list command in a loop and check for the related command status completion.
The CI code is challenging for beginners and error-prone for experienced programmers. Adding new database indexes is a common practice, and it will benefit many Firestore users.
where --wait-all will force the command to wait for all operations to complete, in this case, indexes deployment.
It is hard to choose the right argument name. For example, firebase deploy --only functions is a synchronous operation that waits for the end of function deployments.
I found several requests for that feature in Stackoverflow and Google community but did not find it in Github. I'm sorry if I missed it. The feature request is also submitted via support page.
The text was updated successfully, but these errors were encountered:
I'd suggest not adding a flag for this - deploy should be polling on any operations that it starts. I'd want to double check this with Firestore folks, but IMO this should just be the default behavior
Hi @joehan,
Do you mean the cli deploy command should poll the operation and wait till the end of the deployment,
or should developers write additional custom scripts to check the operation status?
Generally, I think the deploy command should poll the operation and wait till the end of the deployment.
Ideally, deploy should only return once everything is fully deployed.
Description
Enabling indexes in databases is a common practice. Many projects dedicate a separate CI step to DB schema/index changes before deploying new application code.
Firebase problem
Firebase provides the following functionality to deploy indexes:
The command does not wait for the end of index deployment in the database. This may result in the following failure:
firebase deploy --only=firestore:indexes --force
, which is asynchronous operation.Current workarounds
It is possible to run
gcloud firestore operations list
command in a loop and check for the related command status completion.The CI code is challenging for beginners and error-prone for experienced programmers. Adding new database indexes is a common practice, and it will benefit many Firestore users.
Proposal
Introduce
where
--wait-all
will force the command to wait for all operations to complete, in this case, indexes deployment.It is hard to choose the right argument name. For example,
firebase deploy --only functions
is a synchronous operation that waits for the end of function deployments.I found several requests for that feature in Stackoverflow and Google community but did not find it in Github. I'm sorry if I missed it. The feature request is also submitted via support page.
The text was updated successfully, but these errors were encountered: