Dvc: update: improve output when import stage is fixed to an unchanged rev?

Created on 30 Oct 2019  路  8Comments  路  Source: iterative/dvc

Moving from https://github.com/iterative/dvc.org/issues/735#issuecomment-547727345

$ dvc version
DVC version: 0.65.0
Python version: 3.7.4
Platform: Darwin-19.0.0-x86_64-i386-64bit
Binary: False

When you import a specific revision that doesn't change, for example a tag like:

$ dvc import --rev cats-dogs-v1 \
             [email protected]:iterative/dataset-registry.git \
             use-cases/cats-dogs
Importing 'use-cases/cats-dogs ([email protected]:iterative/dataset-registry.git)' -> 'cats-dogs'
Output 'cats-dogs' didn't change. Skipping saving.                                                                                                           
Saving information to 'cats-dogs.dvc'.
$ ls
total 8
drwxr-xr-x  3 usr  staff    96B Oct 22 14:05 cats-dogs/
-rw-r--r--  1 usr  staff   340B Oct 22 14:05 cats-dogs.dvc

And then you try to update, nothing changes because the rev never moves. However dvc update output doesn't really signal this, in fact it says "Saving information..." as if something happened:

$ dvc update cats-dogs.dvc
Saving information to 'cats-dogs.dvc'.

Although this is correct update behavior (as explained in https://github.com/iterative/dvc.org/issues/735#issuecomment-545163407), maybe the output could be different when it detects a fixed rev field in the DVC-file, and this rev hasn't changed. It could give an INFO message to suggest the user may have to re-import instead of updating. Something like:

$ dvc update cats-dogs.dvc
NOTE: The 'cats-dogs.dvc' import stage is fixed to revision 'cats-dogs-v1'
and this Git reference has not moved. You may want to re-import 'cats-dogs.dvc'
to un-fix it, instead of trying to update it.
discussion enhancement good first issue p1-important question ui

Most helpful comment

I an against erroring out when nothing changed, this doesn't make sense to me and breaks scripting.

On the prefix, I would like to see HINT: there, because that is a hint actually, not something done or happened, but only some supposition.

All 8 comments

The Saving information part might be gone soon, as it is a bit redundant and will probably be replaced with a better summary. But the situation of branch/tag that hasn't moved does indeed need to be handled better. I like the idea of that note, but also wonder if we should error-out if trying to update something that is already at the latest version. Kinda like brew uprade dvc does. Just a thought.

wonder if we should error-out if trying to update something that is already at the latest version. Kinda like brew uprade dvc does.

Yeah good point. Maybe this is best indeed, to be extra explicit about what happened or did not happen (:

p.s. a shorter version of the note text, in case needed: "NOTE: The 'cats-dogs.dvc' import stage is fixed to Git revision 'cats-dogs-v1', which has not moved. See https://man.dvc.org/import for more details."

I would say improving an output is a good first step (I though don't like NOTE prefix, it should be just a normal simple one sentence output) we can do.

  • [ ] Improving the output sounds like a good first issue! Would not close this ticket but doesn't hurt either.

I an against erroring out when nothing changed, this doesn't make sense to me and breaks scripting.

On the prefix, I would like to see HINT: there, because that is a hint actually, not something done or happened, but only some supposition.

Agreed on both with @Suor . Probably would even avoid all upper case prefix at all. For a good message intention should be clear without providing additional prefixes. Or at least, make it just a regular normal part of the sentence - Hint, ....

I personally do like those uppercase prefixes, they optimize human text parsing. E.g. you just skip HINT of you know what you are doing or you read only WARNINGs, these are anchors, which help you navigate

This is related, btw #2605. I don't mind HINT, let's try and see how does it look.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shcheklein picture shcheklein  路  3Comments

dmpetrov picture dmpetrov  路  3Comments

tc-ying picture tc-ying  路  3Comments

analystanand picture analystanand  路  3Comments

gregfriedland picture gregfriedland  路  3Comments