-
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
dvc remote default accepts anything #3470
Comments
I'm looking into this issue , but got some difficulty. Currently, the DVC would take a validation on every change of the configuation. There are two types of validation, one is of data type ( core.no_scm must be boolen, timeout and port of a ssh mus be int) another is of logic ( like #3470 core.remote must be in remote list). The data type validation relies on only one configuration file, but the logic validation needs to consider all of the four configuration files. These four files are not always binding to each others, a validation may fail if we move the whole project to another environment. And even worse, some modification involving configuartion of multi-levels might change configuration in a wrong way. For example, if we had four level of configuration like local command dvc remote remove --global my-remote would delete the repo-level of default remote by wrong. It confused repositories in different level with a same name. (This is a issue?) So do we have to validate the logic of configuration when ever it changed, as we might be in a different environment when we actually run it, or we should only do validation at running time. It seems that Git makes no validation of its configuration. |
A third choice is that we restrict our logic validation in one level of configuration. |
As to removing the configuration of local remote:
Considering that there is avialable Having said so I think that we should throw error when defining remote with same name. Behavior should be consistent no matter the config level, and we should actually raise error when new remote is added and it conflicts with existing remote. Thats what happens when we initialize two remotes with the same name in local config.
will result in:
So I think first issue that needs to be solved here is that we allow user to have multiple remotes of sam name. |
Add validation to restrict default remote repo in list of remote repos.
1. add two tests 2. add one validation 3. modified remote remove to satithe validation change
As validations in So I think we should divide the validation in two ways. |
Should indicate an error if the default remote is not in the list
Please provide information about your setup
DVC version: 0.87.0
Python version: 3.6.9
Platform: Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic
Binary: False
Package: pip
Cache: reflink - not supported, hardlink - supported, symlink - supported
The text was updated successfully, but these errors were encountered: