-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add repro -R, support dirs & stage files when running pull/push/repro… #2030
Conversation
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.
Good stuff @prihoda!
Two things thought:
- Would you mind writing test that repro --recursive actually gathers only stages inside targeted dir for recursive = True and isdir(target) = True?
- I think change of checkout behaviour could be handled in separate PR. It is just a observation to be considered in future requests.
I realized that there's actually an edge case with Imagine you have the following DAG: I will try to fix this by sorting the found stages in |
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.
Thorough testing!
Sorry for mentioning it only now, but recently we started to switch to pytest. Would you be willing to refactor it accordingly?
EDIT:
here is example of test refactoring:
#1953
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.
Outstanding! 🥇 Thank you so much @prihoda !
@@ -35,7 +35,7 @@ def _reproduce_stage(stages, node, force, dry, interactive, no_commit): | |||
def reproduce( | |||
self, | |||
target=None, | |||
recursive=True, | |||
single_item=False, |
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.
This is breaking the backward compatibility, but it is fine since our API is not officially released yet and this change is indeed worthy.
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.
Actually this is just the internal naming, recursive
argument was originally used to specify the default behaviour (recursive = not self.args.single_item
), so the behavior stays the same. I just renamed the recursive
method argument to single_item
(and removed the negation) and added a new recursive
argument that corresponds to the --recursive
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.
Great change!
Added support for
dvc repro --recursive
.Added support for recursive mode to accept not just directories but also dvc files:
dvc pull/push/fetch/checkout/repro --recursive someFile.dvc someDir/
for convenience (following unix
cp -r
mv -r
conventions that support both dirs and files).DVC issue #1989
New dvc.org docs issue: iterative/dvc.org#367