Repository: iterative/dvc

Issue:
updater: don't remind about updates on each command run
We're getting reports that updater is too annoying (it prints the notification on every command that you run) and people just turn it off for good with a config option.

We could consider just warning once in, say, a week, but maybe we should just get rid of it as some people were suggesting (or create a separate `dvc check-updates` command). 

CC @dberenbaum @dmpetrov 


Discussion:
The once a week option seems like a reasonable step towards making it less annoying but still being a little annoying since it is good to nudge users to newer versions. I agree that it's too annoying now, but I wouldn't care if it only happened weekly.
Yep, once a week or even day will be tolerable. Also, agree that we still want to push people a bit to do updates. Btw, may be we can even change the message a bit? make it one line with colors? not so huge and annoying, make at the end of the process, not at the very beginning, etc..

----------

My 2cs on the updater logic. It's beneficial for us to push a bit user to the newer versions for a few reasons:

1. Safety. DVC was not stable enough at the moment and we were sometimes fixing some critical issues in the storage itself. We wanted to push them to end users as fast as we can. This is less of an issue now. But I would personally prefer to have a mechanism to notify all users on a specific version about some critical updates. (It would require some infrastructure though?)

2. Maintenance costs. People come to us with questions. If they see the message the might update to try the new version first (at lest it should be happening more often?). 

3. Potentially better adoption? We are improving the experience and if users update regularly they see and experience the product in its better and better shape. It improves stickiness, etc.


Thinking about it some more, how about we fully get rid of updater messages, but instead just include the "update available..." into the latest version into `dvc doctor/version` output? My thinking is that `dvc doctor/version` is what people use when they run into problems and report bugs or just want to check what is the current version they are using, so that seems to be the most natural notification that we can provide. That way it is not annoying and yet provides useful info. WDYT, guys?

Resolving patch:
diff --git a/dvc/command/base.py b/dvc/command/base.py
--- a/dvc/command/base.py
+++ b/dvc/command/base.py
@@ -33,17 +33,12 @@ class CmdBase(ABC):
 
     def __init__(self, args):
         from dvc.repo import Repo
-        from dvc.updater import Updater
 
         os.chdir(args.cd)
 
         self.repo = Repo(uninitialized=self.UNINITIALIZED)
         self.config = self.repo.config
         self.args = args
-        if self.repo.tmp_dir:
-            hardlink_lock = self.config["core"].get("hardlink_lock", False)
-            updater = Updater(self.repo.tmp_dir, hardlink_lock=hardlink_lock)
-            updater.check()
 
     def do_run(self):
         with self.repo:
diff --git a/dvc/command/version.py b/dvc/command/version.py
--- a/dvc/command/version.py
+++ b/dvc/command/version.py
@@ -10,9 +10,21 @@
 class CmdVersion(CmdBaseNoRepo):
     def run(self):
         from dvc.info import get_dvc_info
+        from dvc.repo import NotDvcRepoError, Repo
 
         dvc_info = get_dvc_info()
         ui.write(dvc_info, force=True)
+
+        try:
+            with Repo() as repo:
+                from dvc.updater import Updater
+
+                hardlink_lock = repo.config["core"].get("hardlink_lock", False)
+                updater = Updater(repo.tmp_dir, hardlink_lock=hardlink_lock)
+                updater.check()
+        except NotDvcRepoError:
+            pass
+
         return 0
 
 


Test patch: