-
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
exp apply: git-tracked files which are unchanged from HEAD are not reset on apply #8764
Comments
Looks like this was introduced in #7910. Seems like it pretty severely breaks |
@pmrowla Do we need to stash untracked files? If we keep the stash somewhere so people can recover it (#7955), can we stash without untracked files and skip applying the stash after? Or do we risk losing the untracked files if they conflict with an untracked dep from the experiment? Could we make a commit for the current workspace instead of stashing it to have more control (that might allow to cleanly revert if there were a conflict with untracked files)? Seems related to #8481 (comment) in that the expectation is to recover the experiment state, not to merge changes. |
This bug isn't related to untracked files. The issue is that when we re-apply the workspace stash, we normally skip conflicted files, which in most cases means we prefer the applied exp version of a file instead of whatever the user already had in their workspace. The bug here is that in this case, git does not see the stash's version of the params file as conflicting with the exp version. Basically, in this workflow, the parent commit (HEAD) for both experiments contains When we go to run
Now, we apply the first experiment, so the user's workspace contains the results of exp 1. For the params file, this means that it still contains When we go to restore any unrelated changes from the workspace (via |
Instead of just calling |
I think what we want is just to fix both this and #8481 at the same time, and make the new apply workflow something like
|
I brought up untracked files because my initial thought was that the easiest way to "selectively apply" was to leave untracked files in the workspace and not apply any stashed files at the end. However, I think it's problematic if the experiment being applied conflicts with those untracked files. The workflow you proposed LGTM for the most part. Do we need to selectively apply any files if we keep the stash and give users the info to revert back to their previous workspace? My only concern would be that keeping entries in the stash could be annoying because:
Ideally, it would be nice to keep only the dirty changes from the last |
Hey folks, sorry to butt in - @dberenbaum 's concerns resonate with me. |
Using the default git stash ref is not a requirement, we already use our own stash refs for other things in DVC experiments. If we want to use our own ref and add another DVC command/flag to revert applies we can do that. The main point here w/the |
Great, thanks for the clarification @pmrowla! what would the experience look like for the users to restore the workspace changes (if they wanted to) if dvc were to use some custom stash ref when applying like you mentioned? Is it git cli friendly or something we would have to guide the user to do via dvc command? |
We would probably have to add a new DVC command or flag to revert the last |
So it sounds like we should move forward with #8481 using custom refs? If we can keep them somewhere that's not too crazy like |
Is still p0? |
This is taking longer because of the shifted focus to cloud versioning and because we are going for changing the behavior here along with #8481 rather than a strict bug fix, but it's still urgent. @pmrowla When you get back, let's discuss whether you can offload either this issue or remaining cloud versioning work to someone else so we can prioritize this. |
This will be resolved by the changes for #8481 (as described in my earlier comment)
|
originally from discourse: https://discuss.dvc.org/t/cannot-apply-the-first-exp-after-new-commit/1444/3
If you
exp apply
an experiment which has a git-tracked file that matches the original parent commit, but that file has modifications in your local workspace, the expected version of the file is not applied.expected behavior:
the file should match the original parent commit (and experiment) version of the file
actual behavior:
the local modifications to the file are kept
This can be reproduced with example-get-started. From a fresh clone with the venv/requirements installed:
the expected behavior now would be that
params.yaml
has no git changes, and containsmax_features: 300
, but the actual result is that it containsmax_features: 225
The text was updated successfully, but these errors were encountered: