proposed break: change non-interactive prompt behaviour
This is a proposed breaking change.
I count five places where we assume choices on behalf of the user when we're non-interactive:
- Element failure. This is controlled by
- SIGINT, we assume the user chooses 'terminate'.
- Not being able to find
project.conf, we assume the user chooses not to create a
bst reset, we assume the user chooses 'yes' when asked if they are sure.
bst workspace close --remove-dir, we assume the user chooses 'yes' when asked if they are sure.
I think (4, 5) changing their behaviour when non-interactive is surprising. They go from 'safe' when interactive to 'unsafe' when non-interactive. That being said, inverting the non-interactive behaviour would be silly - if they were 'safe' when non-interactive then they wouldn't do anything, and wouldn't be scriptable.
We are looking to configure the interactive behaviour of (3, 4, 5) with
prompt.* options in
buildstream.conf with !887 (merged).
In #726 (closed), we also consider introducing
-y options for (4, 5).
When both of those changes are made, it seems to me that for (4) and (5) we will have a chance to change the behaviour to stay useful and yet also be unsurprising. It would be a breaking change however.
Relevant logs and/or screenshots
prompt.workspace-close-remove-dir is set to
ask and the user does not specify
bst workspace --remove-dir should exit with an error if non-interactive.
The same goes for
bst workspace reset.
This would be a change in behaviour for folks that upgrade BuildStream without changing any arguments or config options - scripts that work now with (4, 5) would break.