summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <angelos.evripiotis@gmail.com>2019-01-29 12:08:07 +0000
committerAngelos Evripiotis <angelos.evripiotis@gmail.com>2019-01-29 12:08:07 +0000
commitaae35e13e8f5ed550d7ccdd6611482c225a4ff81 (patch)
tree7f36de0d6db55b5f9ca62e22c413638657f883f3
parent6a4c86118380d95bdedd11e60f3a771fdae225a3 (diff)
parent86c8e4146ffd870b71cedf0031881cc4dc998c15 (diff)
downloadbuildstream-aae35e13e8f5ed550d7ccdd6611482c225a4ff81.tar.gz
Merge branch 'aevri/are_you_sure' into 'master'
BREAK:remove unconditional 'are you sure?' prompts See merge request BuildStream/buildstream!1061
-rw-r--r--NEWS11
-rw-r--r--buildstream/_context.py14
-rw-r--r--buildstream/_frontend/cli.py10
-rw-r--r--buildstream/data/userconfig.yaml16
4 files changed, 5 insertions, 46 deletions
diff --git a/NEWS b/NEWS
index ae1485dc5..449a23ff1 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,11 @@ buildstream 1.3.1
an error message and a hint instead, to avoid bothering folks that just
made a mistake.
+ o BREAKING CHANGE: The unconditional 'Are you sure?' prompts have been
+ removed. These would always ask you if you were sure when running
+ 'bst workspace close --remove-dir' or 'bst workspace reset'. They got in
+ the way too often.
+
o Failed builds are included in the cache as well.
`bst checkout` will provide anything in `%{install-root}`.
A build including cached fails will cause any dependant elements
@@ -87,12 +92,6 @@ buildstream 1.3.1
instead of just a specially-formatted build-root with a `root` and `scratch`
subdirectory.
- o The buildstream.conf file learned new
- 'prompt.really-workspace-close-remove-dir' and
- 'prompt.really-workspace-reset-hard' options. These allow users to suppress
- certain confirmation prompts, e.g. double-checking that the user meant to
- run the command as typed.
-
o Due to the element `build tree` being cached in the respective artifact their
size in some cases has significantly increased. In *most* cases the build trees
are not utilised when building targets, as such by default bst 'pull' & 'build'
diff --git a/buildstream/_context.py b/buildstream/_context.py
index 29a016065..1d049f7a6 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -122,17 +122,9 @@ class Context():
self.pull_buildtrees = None
# Boolean, whether we double-check with the user that they meant to
- # remove a workspace directory.
- self.prompt_workspace_close_remove_dir = None
-
- # Boolean, whether we double-check with the user that they meant to
# close the workspace when they're using it to access the project.
self.prompt_workspace_close_project_inaccessible = None
- # Boolean, whether we double-check with the user that they meant to do
- # a hard reset of a workspace, potentially losing changes.
- self.prompt_workspace_reset_hard = None
-
# Whether elements must be rebuilt when their dependencies have changed
self._strict_build_plan = None
@@ -260,16 +252,10 @@ class Context():
prompt = _yaml.node_get(
defaults, Mapping, 'prompt')
_yaml.node_validate(prompt, [
- 'really-workspace-close-remove-dir',
'really-workspace-close-project-inaccessible',
- 'really-workspace-reset-hard',
])
- self.prompt_workspace_close_remove_dir = _node_get_option_str(
- prompt, 'really-workspace-close-remove-dir', ['ask', 'yes']) == 'ask'
self.prompt_workspace_close_project_inaccessible = _node_get_option_str(
prompt, 'really-workspace-close-project-inaccessible', ['ask', 'yes']) == 'ask'
- self.prompt_workspace_reset_hard = _node_get_option_str(
- prompt, 'really-workspace-reset-hard', ['ask', 'yes']) == 'ask'
# Load per-projects overrides
self._project_overrides = _yaml.node_get(defaults, Mapping, 'projects', default_value={})
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 34217aee5..163a05790 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -841,11 +841,6 @@ def workspace_close(app, remove_dir, all_, elements):
if nonexisting:
raise AppError("Workspace does not exist", detail="\n".join(nonexisting))
- if app.interactive and remove_dir and app.context.prompt_workspace_close_remove_dir:
- if not click.confirm('This will remove all your changes, are you sure?'):
- click.echo('Aborting', err=True)
- sys.exit(-1)
-
for element_name in elements:
app.stream.workspace_close(element_name, remove_dir=remove_dir)
@@ -879,11 +874,6 @@ def workspace_reset(app, soft, track_, all_, elements):
if all_ and not app.stream.workspace_exists():
raise AppError("No open workspaces to reset")
- if app.interactive and not soft and app.context.prompt_workspace_reset_hard:
- if not click.confirm('This will remove all your changes, are you sure?'):
- click.echo('Aborting', err=True)
- sys.exit(-1)
-
if all_:
elements = tuple(element_name for element_name, _ in app.context.get_workspaces().list())
diff --git a/buildstream/data/userconfig.yaml b/buildstream/data/userconfig.yaml
index 6351619aa..0834b93f6 100644
--- a/buildstream/data/userconfig.yaml
+++ b/buildstream/data/userconfig.yaml
@@ -112,14 +112,6 @@ logging:
#
prompt:
- # Whether to really proceed with 'bst workspace close --remove-dir' removing
- # a workspace directory, potentially losing changes.
- #
- # ask - Ask the user if they are sure.
- # yes - Always remove, without asking.
- #
- really-workspace-close-remove-dir: ask
-
# Whether to really proceed with 'bst workspace close' when doing so would
# stop them from running bst commands in this workspace.
#
@@ -127,11 +119,3 @@ prompt:
# yes - Always close, without asking.
#
really-workspace-close-project-inaccessible: ask
-
- # Whether to really proceed with 'bst workspace reset' doing a hard reset of
- # a workspace, potentially losing changes.
- #
- # ask - Ask the user if they are sure.
- # yes - Always hard reset, without asking.
- #
- really-workspace-reset-hard: ask