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

repro --pull implies --allow-missing #10434

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dvc/commands/repro.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def add_arguments(repro_parser):
action="store_true",
default=False,
help=(
"Try automatically pulling missing cache for outputs restored "
"from the run-cache."
"Try automatically pulling missing dependencies and outputs. "
"Implies --allow-missing."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it better to deprecate then allow-missing? and here describe the behavior in a more explicit way (by not referring to another option, but actually saying what is happening)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to deprecate now because:

  1. That is a clear breaking change that I don't think we should do unless we want to do a major version change
  2. Unlike --pull, --allow-missing on its own can be useful. It was introduced to solve New command: dvc verify - check that the pipeline is up to date without having to pull or run it #5369, in which case the user doesn't want to pull anything.

Open to other ideas on how to explain it but worried about overcomplicating it. I think this is how people expect --pull works now. With --pull and --allow-missing, if you have run the stage before and pushed it, it won't get run again. Without --allow-missing, the stage may still be considered changed and run again even if it can be pulled from the run-cache.

),
)
repro_parser.add_argument(
Expand Down
14 changes: 8 additions & 6 deletions dvc/repo/reproduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,14 @@ def reproduce(
targets_list = ensure_list(targets or PROJECT_FILE)
stages = collect_stages(self, targets_list, recursive=recursive, glob=glob)

if kwargs.get("pull", False) and kwargs.get("run_cache", True):
logger.debug("Pulling run cache")
try:
self.stage_cache.pull(None)
except RunCacheNotSupported as e:
logger.warning("Failed to pull run cache: %s", e)
if kwargs.get("pull", False):
kwargs["allow_missing"] = True
if kwargs.get("run_cache", True):
logger.debug("Pulling run cache")
try:
self.stage_cache.pull(None)
except RunCacheNotSupported as e:
logger.warning("Failed to pull run cache: %s", e)

graph = None
steps = stages
Expand Down
Loading