Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkout/add: change warning messages to regular/info if behavior is expected #2979

Closed
dmpetrov opened this issue Dec 18, 2019 · 16 comments · Fixed by #3401
Closed

checkout/add: change warning messages to regular/info if behavior is expected #2979

dmpetrov opened this issue Dec 18, 2019 · 16 comments · Fixed by #3401
Assignees
Labels
discussion requires active participation to reach a conclusion p1-important Important, aka current backlog of things to do research ui user interface / interaction

Comments

@dmpetrov
Copy link
Member

dmpetrov commented Dec 18, 2019

$ dvc -V
0.75.0
$ dvc checkout
WARNING: data 'newfile.txt' exists. Removing before checkout.
WARNING: data 'ttt.txt' exists. Removing before checkout.

EDITED 12/18/19: The message is actually wrong! The files were not removed - they were replaced by a new version. It has to be fixed as well.

$ echo hello >> newfile.txt
$ dvc add newfile.txt
WARNING: Output 'newfile.txt' of 'newfile.txt.dvc' changed because it is 'modified'
100% Add|███████████████████████████████████████████|1.00/1.00 [00:00<00:00,  2.45file/s]

To track the changes with git, run:

	git add newfile.txt.dvc

Based on my understanding warnings are needed when you need to alert a user. It is not needed for routine operations with expected results. In both of these cases, the priority needs to be reduced to regular/info.

PS: Are there any other warnings like these?

@dmpetrov dmpetrov added the ui user interface / interaction label Dec 18, 2019
@shcheklein
Copy link
Member

I think it's a duplicate of this #2329 ?

Also, yet another evidence (as many others) that loggers are not meant to be used as a mechanism to built UI/UX on top - #1930. In this specific case, for example, the priority is already set to INFO. It's just happened that in the "loggers world" INFO includes WARNING and above, not other way around.

@dmpetrov
Copy link
Member Author

I think it's a duplicate of this #2329 ?

This is a discussion about the mechanism in general. It won't change the verbosity level of these particular messages.

loggers are not meant to be used as a mechanism to built UI/UX on top

Logging is just not the right term. We should use output and verbosity level instead (like in #2329).

Separation is definitely needed if we decide to output logs into a separate space while keeping printing messages to output (where verbosity level still be needed).

In this specific case, for example, the priority is already set to INFO. It's just happened that in the "loggers world" INFO includes WARNING and above, not other way around.

Sorry, I'm not following this. Could you please clarify? Where is it set to INFO and why it is a problem in this specific case? My understanding - by default we should print all info messages and above.

@shcheklein
Copy link
Member

It won't change the verbosity level of these particular messages.

probably I was confused by PS: Are there any other warnings like these? and the generic title.

change it to be "add: remove output modified warning message"?

My understanding - by default we should print all info messages and above.

hmm, may be I didn't understand the intention for the ticket ... Technical details aside, what is the outcome you'd like to get - remove the message completely, remove the WARNING prefix?

@dmpetrov
Copy link
Member Author

remove the WARNING prefix?

Yes

@shcheklein
Copy link
Member

Gotcha! Yep, disregard my comments then! (I would probably still change title, this one feels generic, at least specific add/checkout: remove unnecessary warning prefixes - would make it way more explicit :) )

@dmpetrov dmpetrov changed the title Reduce priority of warning messages checkout/add: change warning messages to regular/info if behavior is expected Dec 19, 2019
@ghost
Copy link

ghost commented Dec 19, 2019

@dmpetrov , @shcheklein , what about removing those messages at all?

WARNING: data 'newfile.txt' exists. Removing before checkout.
WARNING: data 'ttt.txt' exists. Removing before checkout.

I think it was a warning because DVC is "removing" data.

echo "foo" > foo
dvc add foo
echo "something else" > foo
dvc checkout
# user will lost "something else"

In my opinion, having those messages just clutters the UI. This is related to #2498 .

by the way, I'm +1 for preventing the user to checkout when it has a "dirty" workspace

@dmpetrov
Copy link
Member Author

@MrOutis it is a good point we can definitely consider this.

To my mind, we should NOT make checkout silent. It should output ALL the changes (and what exactly happened: remove/changed/added) or at least a summary. I'd prefer to see all the changes.

Re checkout... I've just noticed that the message is wrong (I'll modify the description) - in this scenario, the files were not removed - they were replaced by a new version. So, the message needs to be changed. Also, we need to make sure that the message will be ".. removing" if there is nothing to replacement.

I don't see a clear connection to prompt-issue #2498. That issue was not about outputs, it was about asking vs termination.

@dmpetrov
Copy link
Member Author

This misleading warning makes this issue p1 or even p0 :(
Assigning a priority.

@dmpetrov dmpetrov added the p1-important Important, aka current backlog of things to do label Dec 19, 2019
@ghost
Copy link

ghost commented Dec 19, 2019

I don't see a clear connection to prompt-issue #2498. That issue was not about outputs, it was about asking vs termination.

@dmpetrov , we could terminate the checkout operation if there's a non-cached version of that file.

@dmpetrov
Copy link
Member Author

@dmpetrov , we could terminate the checkout operation if there's a non-cached version of that file.

Right. But this is part of #2498, not the current one.

@efiop efiop added research discussion requires active participation to reach a conclusion labels Dec 24, 2019
@dmpetrov dmpetrov mentioned this issue Jan 3, 2020
10 tasks
@skshetry skshetry self-assigned this Feb 10, 2020
@efiop
Copy link
Contributor

efiop commented Feb 11, 2020

To my mind, we should NOT make checkout silent. It should output ALL the changes (and what exactly happened: remove/changed/added) or at least a summary. I'd prefer to see all the changes.

@dmpetrov So say you have data and you checkout to another branch. Are you saying that we should say that we are data will be replaced? That seems too verbose to me. For example git checkout does that silently. I think we should do the same there. Or, maybe you really want some summary instead? If so, we might be confusing current issue - "misleading bad warnings" and "checkout should not be silent and show tell what happened in a form of summary"(e.g. "successfully checked out 10 files").

@dmpetrov
Copy link
Member Author

@efiop you are right. We should probably be silent as Git.
As an option, we can output a single message (not a warning) per changed data file or data dir (no need to write about each data file in a data-dir).

Any of these is much better than the current misleading warning message.

@skshetry
Copy link
Member

skshetry commented Feb 14, 2020

As an option, we can output a single message (not a warning) per changed data file or data dir (no need to write about each data file in a data-dir).

@dmpetrov, how about we keep it on -v flag only? Do we really need to introduce new option, considering that this is a day-to-day used command?

Also, there's not much happening different/unsafe compared to git checkout anyway. But, 👍 for fixing misleading warning.

@skshetry skshetry reopened this Feb 14, 2020
@efiop
Copy link
Contributor

efiop commented Feb 14, 2020

@skshetry I think @dmpetrov means that it might be nice to have a summary or something that would mark a successful run. This is a reoccurring theme in our UI discussion 🙂

@skshetry
Copy link
Member

skshetry commented Feb 14, 2020

@skshetry I think @dmpetrov means that it might be nice to have a summary or something that would mark a successful run. This is a reoccurring theme in our UI discussion

So, something similar to this?

$ dvc checkout
300 files added, 30 files replaced and 3 files removed

Or, more verbose?

@dmpetrov
Copy link
Member Author

dmpetrov commented Feb 14, 2020

@skshetry, yes, @efiop is right. A summary would be great. Please include only the changes in the summary.

-v is too verbose. It is mostly for debugging purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion requires active participation to reach a conclusion p1-important Important, aka current backlog of things to do research ui user interface / interaction
Projects
None yet
4 participants