'Are you sure?' prompts don't suit all users
Summary
There are some scenarios where BuildStream will stop and ask the user a question. This behaviour does not suit all users in all situations.
Steps to reproduce
Some examples:
-
bst workspace close --remove-dir
, BuildStream asks 'Are you sure?' -
bst workspace reset
, BuildStream asks 'Are you sure?' - Running a bst command where a
project.conf
cannot be found, BuildStream asks 'Would you like to create a project?'
What is the current behavior?
bst workspace reset element.bst
This will remove all your changes, are you sure? [y/N]:
What is the expected correct behavior?
For folks that don't want the prompts, it should do the resetting without the prompts.
Possible fixes
- Allow users to selectively disable such prompts in
~/.config/buildstream.conf
. - Add
-y
and--assume-yes
options to commands that ask for extra confirmation of consequential actions.- BREAKing change: (#744 (closed)) Also change existing behaviour under
--non-interactive
to 'assume no' by default, unless overridden by--assume-yes
. We should exit with an error code if we end up assuming no, so that scripts can handle the error. This means that the safety aspect doesn't change just because it's non-interactive. - Add a convention to CONTRIBUTING specifying that such confirmations should have 'no' as safe / reversible.
- BREAKing change: (#744 (closed)) Also change existing behaviour under
- Add support for
BST_ASSUME_YES=1
environment variable to enable semi-persistent script-friendliness.
Edited by Angelos Evripiotis