-
Notifications
You must be signed in to change notification settings - Fork 394
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
command-reference/update: add docs for new --rev option #890
Conversation
38cebc2
to
99bd5b9
Compare
@@ -39,6 +39,12 @@ to learn how to "update" fixed-revision imports. | |||
|
|||
## Options | |||
|
|||
- `--rev` - specific |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the note in the description above ... we should probably update it as well? does --rev
override dvc import --rev
, for example?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done by 82c8b5c, can you please re-check?
- `--rev` - specific | ||
[Git revision](https://git-scm.com/book/en/v2/Git-Internals-Git-References) | ||
(such as a branch name, a tag, or a commit hash) of the DVC repository to | ||
update the data from. Repository's revision formed by the first import is used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we lock a specific revision for import-url
or for dvc import something
(no --rev
)? It's not 100% clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a discussion for choosing a behavior here: iterative/dvc#2849 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed by 82c8b5c, can you please re-check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ilgooz good stuff! thanks for updating the docs. Please, take a look at the comments. Also, it would be great to have an example to see the clear difference in the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have some comments, see below.
Also, see #890 (review)
I think we should revise the last paragraph in the description "... when the
--rev
(revision) option of dvc import
has been used to create an import stage..." and/or add a new one explaining the relationship/interactions/cases when using --rev
options in dvc import
and then in dvc update
again. If you can get that change started I can review the wording and phrasing if needed.
Oops it seems Ivan and myself did similar reviews simultaneously. Sorry 😬 I'll try to combine them. |
Big thanks @jorgeorpinel! I'll continue with applying the requested changes once we figure out this one: iterative/dvc#2849 (comment) |
added an example by 82c8b5c but we need to create a new branch named |
-> 'model.pkl' | ||
``` | ||
|
||
Since the source files has changed, we see the results of our "update". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the source files has changed, we see the results of our "update". | |
Since the source files are different at `v2` comparing to the currently locked revision, we see the side effects of our "update" as different results. |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like
Since the source files has changed, we see the results of our "update". | |
This actually has an effect because the `model.pkl.dvc` file at tag `v2` points to different data that what's currently in the `rev_lock` field of the import stage. |
Notice I also avoided the term "lock" here as well.
(Please rewrap.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also keep the entire
Note that
dvc update
updates therev_lock
field...
note here, at the end of the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phew! Sorry, lots of comments in this review, but we're getting there.
> In the above example, the value for `rev` in the new import stage will be | ||
> `master`, which happens to be the default branch in this Git repository, so | ||
> the command is equivalent to not using `--rev` at all. | ||
moves (e.g. a branch), you may use `dvc update` preferably with `--rev` option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moves (e.g. a branch), you may use `dvc update` preferably with `--rev` option | |
moves (e.g. a branch), you may use `dvc update` |
Why "preferably with --rev
option"?
> `master`, which happens to be the default branch in this Git repository, so | ||
> the command is equivalent to not using `--rev` at all. | ||
moves (e.g. a branch), you may use `dvc update` preferably with `--rev` option | ||
to bring the data up to date. Using `--rev` also updates the fixed-revision. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to bring the data up to date. Using `--rev` also updates the fixed-revision. | |
to bring the data up to date. |
Instead of that last sentence, I would keep some of the deleted text from above and change it a little bit. Somehing like:
For typically static references (e.g. tags), or for SHA commits, in order to update an import, it's necessary to use dvc update --rev
with a different reference, as shown below. This will replace the rev
field in the DVC-file (import stage).
$ dvc update --rev <new-ref> \
[email protected]:iterative/dataset-registry.git \
use-cases/cats-dogs
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree that it should be consistent and title should be updated. It's not important to have "re-import" now. It def worth mentioning that it overwrites the file if you run it again, though. Not sure about the example section - let you decide :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote for removing the "re-import" term everywhere then (including from the corresponding link hrefs).
@@ -7,7 +7,7 @@ repositories</abbr>, and corresponding | |||
## Synopsis | |||
|
|||
```usage | |||
usage: dvc update [-h] [-q | -v] targets [targets ...] | |||
usage: dvc update [-h] [-q | -v] [--rev [REV]] targets [targets ...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please break into 2 lines so there's no scroll bar on the rendered cmd ref:
usage: dvc update [-h] [-q | -v] [--rev [REV]] targets [targets ...] | |
usage: dvc update [-h] [-q | -v] [--rev [REV]] | |
targets [targets ...] |
Another detail to note is that when the `--rev` (revision) option of | ||
`dvc import` has been used to create an import stage, DVC is not aware of what | ||
kind of | ||
[Git revision](https://git-scm.com/book/en/v2/Git-Internals-Git-References) this | ||
is, for example a branch or a tag. For typically static references (e.g. tags), | ||
or for SHA commits, `dvc update` will not have any effect on the import. Refer | ||
to the | ||
[re-importing example](/doc/command-reference/import#example-fixed-revisions-re-importing) | ||
to learn how to "update" fixed-revision imports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole sentence
Another detail to note is that when the `--rev` (revision) option of
`dvc import` has been used to create an import stage, DVC is not aware of what
kind of
[Git revision](https://git-scm.com/book/en/v2/Git-Internals-Git-References) this
is, for example a branch or a tag.
is still valid and informative, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yes I know I said we should revise this paragraph in #890 (comment) but didn't necessarily mean delete this sentence 🙂
to the | ||
[re-importing example](/doc/command-reference/import#example-fixed-revisions-re-importing) | ||
to learn how to "update" fixed-revision imports. | ||
To "update" fixed-revision to static references (e.g. tags), or for SHA commits, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To "update" fixed-revision to static references (e.g. tags), or for SHA commits, | |
To update [fixed-revision](/doc/command-reference/import#example-fixed-revisions-re-importing) import stages (e.g. tags or SHA commits), |
(Please rewrap to 80 chars.)
- `--rev` - specific | ||
[Git revision](https://git-scm.com/book/en/v2/Git-Internals-Git-References) | ||
(such as a branch name, a tag, or a commit hash) of the DVC repository to | ||
update the data from. Using this option also updates the fixed-revision. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this option also updates the fixed-revision.
OK but maybe we should explain what a fixed revision is and what exactly gets updated in the DVC-file (import stage), instead of using that term. Please lmk if you'd like some suggestions, I can def. help with the writing part if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For inspiration check out this not, found in the Examples section below:
Note that
dvc update
updates therev_lock
field of the corresponding DVC-file (when there are changes to bring in).
To update from and also lock to a specific revision of a <abbr>data | ||
artifact</abbr>, we may use the `--rev` option this time: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition to the examples! How about:
To force an update from a specific version of a data artifact, we may specify a Git revision with the
--rev option:
for this sentence? And please wrap <abbr>data artifact</abbr>
in the first paragraph of this whole Examples section instead (thanks for catching this.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(p.s. I think let's avoid the term "lock" here which results confusing given how it's previously used, and given our dvc lock
command, among other types of locking in DVC.)
-> 'model.pkl' | ||
``` | ||
|
||
Since the source files has changed, we see the results of our "update". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like
Since the source files has changed, we see the results of our "update". | |
This actually has an effect because the `model.pkl.dvc` file at tag `v2` points to different data that what's currently in the `rev_lock` field of the import stage. |
Notice I also avoided the term "lock" here as well.
(Please rewrap.)
-> 'model.pkl' | ||
``` | ||
|
||
Since the source files has changed, we see the results of our "update". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also keep the entire
Note that
dvc update
updates therev_lock
field...
note here, at the end of the doc.
OK so this is going stale. Should we close until iterative/dvc/pull/2993 is merged? Or just wait for now? @shcheklein |
@jorgeorpinel let's keep it open until we make some decision on the core project side, please. @ilgooz could you please address the comments in the dvc repo so that we can move this forward? |
closing this since the PR in the core repo is closed as stale |
documentation of iterative/dvc#2993.
--
Disregard the recommendations below if you use Edit on GitHub button to improve the docs in place.
❗ Please read the guidelines in the Contributing to the Documentation list if you make any substantial changes to the documentation or JS engine.
🐛 Please make sure to mention
Fix #issue
(if applicable) in the description of the PR. This enables GitHub to link the PR to the corresponding bug and close it automatically when PR is merged.Thank you for the contribution - we'll try to review and merge it as soon as possible. 🙏