Prompt or not to prompt? #5927
Replies: 27 comments 1 reply
-
We can use conventions as guidelines, but in the end, it is important that we consider the usefulness of prompting in our own terms. Also, there's no consistency on how to skip those questions ( A quick
From those prompts, I can point out the following:
With that being said:
|
Beta Was this translation helpful? Give feedback.
-
@dmpetrov @MrOutis nice summaries, thanks!! Just a few comments from the top of my head:
To my mind and in my experience aborting is very similar to prompting in terms of scripts. You have to take that into account and remember to provide an option. Aborting can be even more dangerous because people tend to forget to put
heroku CLI is another example, even if you specify explicitly that you want to do something it will explain what is going on ask you to put a name of your project (repeating their Web UI) before destroying something for you. |
Beta Was this translation helpful? Give feedback.
-
For me it is not a problem if a command asks for confirmation (or is interactive), as long as this can be overridden by a For example the command
I also think that discussing the commands one by one is better than formulating some general (abstract) principles/rules and trying to follow them strictly. |
Beta Was this translation helpful? Give feedback.
-
@dashohoxha I agree that we need to discuss commands one by one to make actionable decisions. However, we need to formulate basic principles to simplify the decision-making process. It should help to each of the team members to make and explain these UX decisions without any holy wars. Data file importanceThe biggest issue related to prompting is data loss. Importance of data files is different. In a high level, we can separate two data types by the importance:
In general, it is better not to lose any of the data types. However, it is okay to remove not critical data (data derivatives\outputs) in order to avoid prompting or simplifying UX (not to introduce additional options). Failing is always an option of keeping data. ExamplesDVC aligns a lot to Git and we expect users to have Git experience. It will be a mistake not to reuse the knowledge and behavior patterns that users have built with Git. In general, we should use Git UX as a guiding star when we make decisions about UX. Every time we don't agree on something we should ask ourselves a simple question - how it should look like if it becomes a part of a Git. If there is no clear answer, I'd recommend finding analogies with classical Unix commands such as Based on my understanding, Git avoids prompting as much as possible (see discussion in #2497). In some exceptional cases (merge, rebase), dialogs are needed. These exceptions are not just prompted questions, they are full dialogs with multiple questions. |
Beta Was this translation helpful? Give feedback.
-
@MrOutis thank you for the list of methods when DVC ask questions. Is it possible to find DVC commands and scenarios/cases when it is happening? |
Beta Was this translation helpful? Give feedback.
-
@dmpetrov The principles that you lay out are simple and reasonable, I completely agree with them.
My opinion is that developers (in general) are a little bit biased towards the software that they are building, and it might be difficult for them to look at the software from the point of view of a user that knows nothing about implementation. Once you know all the implementation details you can't become a novice again. So, it might be useful if someone is selected as a UX expert, who decides about the details of user interface and user interaction. The others should try to convince him about their point of view, but at the end it is his decision that prevails. This would avoid any holy wars and would bring consistency. |
Beta Was this translation helpful? Give feedback.
-
yes, @dmpetrov ! I can come up with some scenarios, I'll try to do it soon |
Beta Was this translation helpful? Give feedback.
-
@dmpetrov , it is taking a while 😅 ! checkout a file without cache: dvc init --no-scm
echo 'foo' > foo
dvc add foo
rm -rf .dvc/cache/d3/b07384d113edec49eaa6238ad5ff00
dvc checkout
# WARNING: Cache 'd3b07384d113edec49eaa6238ad5ff00' not found. File 'foo' won't be created.
# 0%| |Checkout 0/1 [00:00<?, ?file/s]
# file 'foo' is going to be removed. Are you sure you want to proceed? [y/n] remove "redundant files" during a directory checkout: dvc init --no-scm
mkdir directory
echo 'foo' > directory/foo
dvc add directory
echo 'bar' > directory/bar
dvc checkout
# 0%| |Checkout 0/1 [00:00<?, ?file/sfile 'directory/bar' is going to be removed. Are you sure you want to proceed? [y/n] checkout a file that changed: dvc init --no-scm
echo 'foo' > foo
dvc add foo
echo 'bar' > foo
dvc checkout
# 0%| |Checkout 0/1 [00:00<?, ?file/s]
# file 'foo' is going to be removed. Are you sure you want to proceed? [y/n] |
Beta Was this translation helpful? Give feedback.
-
Agree! Vote for prompt in this case. |
Beta Was this translation helpful? Give feedback.
-
Thank you @MrOutis for funding these scenarios! Let's go one by one.
Is there are cases when it makes sense to checkout data files without checking out a particular one (answer I propose to fail instead of prompting
It seems like there are no conflicts to fail or prompt questions. DVC shouldn't remove files that are not committed. A similar Git example:
No changes, no errors. I propose to avoid prompting and outputting any error messages or warning
It looks the same as the previous case (even though the implementation might be different). So, checkout should not raise any errors or prompts or even error messages. I propose to avoid prompting and outputting any error messages or warning Please take a look at my proposals. If there are no concerns, I'll create an issue. @MrOutis are these three the only prompts that DVC has or we can find more? |
Beta Was this translation helpful? Give feedback.
-
A few more things... It is okay to remove data without prompting if user runs destructive commands like Regarding |
Beta Was this translation helpful? Give feedback.
-
I thought if you have some files manually added to a directory and then use that dir as |
Beta Was this translation helpful? Give feedback.
-
Good point @jorgeorpinel. It would be great to keep the information about data sources (like How do you @iterative/engineering think, is it a good idea to introduce a new 'source: true' parameter in DVC file specifically for the cases not to removing them automatically. I'm wondering, can this information be derived from the dependency graph (and how reliable this information would be in this case)? |
Beta Was this translation helpful? Give feedback.
-
It looks like we got all the pros and cons of this issue. It makes sense to get rid of the prompting when it is possible. I created 3 issues for all the prompt cases that we've found except
I'm keeping checkboxes. We can close the current issue when all the checkboxes will be checked: |
Beta Was this translation helpful? Give feedback.
-
Another option is to simply close this issue now. 🙂 |
Beta Was this translation helpful? Give feedback.
-
@jorgeorpinel we can lose all the details if we close it :) |
Beta Was this translation helpful? Give feedback.
-
@shcheklein brought a good point that this issue is not only about prompting or not-prompting - it is about changing the checkout logic behavior in the first place. So, we need to make
More details with Git code examples: #2802 (comment) All 3 scenarios have to follow this checkout logic. |
Beta Was this translation helpful? Give feedback.
-
Still trying to understand this :) (btw I still don't quite understand how is related to prompt vs not to prompt and why we are discussing this here). Let's start with a simple case, first:
What is the effect of running the last command in terms of changes to the workspace? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure I understand how it is related to the topic we discuss. Could you please elaborate? |
Beta Was this translation helpful? Give feedback.
-
@dmpetrov we are discussing the changes to the |
Beta Was this translation helpful? Give feedback.
-
@shcheklein prompts happens in case of conflicts during We found 3 DVC "misbehavior" scenarios (2 are actually related) and I create 3 issues to fix these scenarios. In your last scenario, I see no checkout conflicts and no prompts. This is why I don't understand how it is related to the issue. |
Beta Was this translation helpful? Give feedback.
-
So, are you saying that checkout will behave differently if data is cached or not? E.g. if the new version is cached then we use the current semantics if not then we don't fail and do not effectively do checkout. Again, I'm really confused about the change. It would be really beneficial to show some examples and simple scenarios when people do checkouts, modifications, etc. |
Beta Was this translation helpful? Give feedback.
-
@shcheklein I showed all the examples with Git: #2802 (comment) |
Beta Was this translation helpful? Give feedback.
-
@dmpetrov DVC is not Git by definition. E.g. we use Git with DVC to version DVC-files, it means that Git workflow affects the DVC workflow. DVC is a higher level abstraction in this sense. We can't just reflect even if we want to keep the same philosophy. I'm just saying I don't understand the suggested change (to the DVC semantics) still. And git examples are not enough for me to better understand those. I'm fine if it's only me. Would love to hear what others have to say. |
Beta Was this translation helpful? Give feedback.
-
@shcheklein you are right but it is not clear how it related to the current issue. It would be great if you can provide an example when Git's failing/proceeding behavior doesn't make sense for DVC in the context of these 3 checkout scenarios. |
Beta Was this translation helpful? Give feedback.
-
Reviving the discussion for the UI change here. I agree with @MrOutis on #5927 (comment). I'd propose that DVC, being a modern tool, it should not be shy about prompting users:
I think that it's okay to poke the user in those cases, given that:
|
Beta Was this translation helpful? Give feedback.
-
If DVC should be consistent with another CLI tool, I think Git would be a good reference.
Basically, NEVER PROMPT (#5927 (comment)) unless user specifically requested to be in "interactive mode." This is good user workflow practice and also good for devs to make sure APIs stay clean and script-friendly. If you disagree, then we'd have to have a stable widely-used interactive mode BEFORE we consider making it the default. |
Beta Was this translation helpful? Give feedback.
-
EDITED 9/15/19
There are a couple of discussions around prompting for user input from CLI. This issue-question tries to summarize the rules around prompting.
Now, DVC asks y/n questions from the command line. We have to introduce
--yes
option (which is not a problem) and users should remember to use this option from their scripts all the time otherwise script stuck. This difference (script experience versus user experience) is an important issue for Unix tools.Traditional Unix-tools do not ask questions (and do not break the scripting experience) which leads to overwriting files or aborting commands. There is an opinion that DVC should behave the same way. The backside of this - it might lead to data loss.
Examples:
cp
,tar
- will overwrite files withgit checkout
- fails if there is a conflictunzip
,apt-get
. However,zip
is not a traditional Unix tool, it was ported from DOS/Windows and follows Windows rules.First, we need to decide if prompting is okay. Second, what are the set of rules for DVC for prompting, overwriting and aborting command?
The first rules summarization from @shcheklein #2497 (comment)
Let's discuss the rules.
Beta Was this translation helpful? Give feedback.
All reactions