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

Unique signature of a remote repository URLs or names. #3719

Closed
karajan1001 opened this issue May 1, 2020 · 8 comments
Closed

Unique signature of a remote repository URLs or names. #3719

karajan1001 opened this issue May 1, 2020 · 8 comments
Labels
awaiting response we are waiting for your reply, please respond! :)

Comments

@karajan1001
Copy link
Contributor

karajan1001 commented May 1, 2020

Please provide information about your setup
DVC version(i.e. dvc --version), Platform and method of installation (pip, homebrew, pkg Mac, exe (Windows), DEB(Linux), RPM(Linux))

DVC version: 0.93
Platform: DEB
installation: pip

According to the discussion on #3470.
we should prevent duplicated remote repository names defining in different config levels.

$> dvc remote add --global sshrepo "ssh://[email protected]:/test1/"
$> dvc remote add sshrepo "ssh://[email protected]:/test2/"  # this command should fail
@triage-new-issues triage-new-issues bot added the triage Needs to be triaged label May 1, 2020
@karajan1001 karajan1001 changed the title Forbidding duplicated remote repository name in different config levels. Forbid duplicated remote repository name in different config levels. May 1, 2020
@karajan1001 karajan1001 changed the title Forbid duplicated remote repository name in different config levels. Prevent setting duplicated remote repository name in different config levels. May 1, 2020
@karajan1001 karajan1001 changed the title Prevent setting duplicated remote repository name in different config levels. Duplicated remote repository name in different config levels. May 1, 2020
@efiop
Copy link
Contributor

efiop commented May 3, 2020

@karajan1001 Hm, not sure why. Use case: in .dvc/config you have myremote and in .dvc/config.local you set your own password/credpath.

@efiop efiop added the awaiting response we are waiting for your reply, please respond! :) label May 3, 2020
@triage-new-issues triage-new-issues bot removed the triage Needs to be triaged label May 3, 2020
@karajan1001
Copy link
Contributor Author

karajan1001 commented May 4, 2020

@karajan1001 Hm, not sure why. Use case: in .dvc/config you have myremote and in .dvc/config.local you set your own password/credpath.

@efiop I didn't consider this before. Maybe remote repo with the same names should use the same URLs?I think the question is what is the unique signature of the remote repository URLs or names.

For example, if we have two remote repo on different levels with the same name and different URLs. Both of them are set the default in their own levels. Currently, when we deleted the repo on the lower level, the default setting in the upper level will be deleted. We identify the remote repo by their names, but now remote with the same name may half different URLs. When should we consider two remote data the same? With the same name, with the same URLs, or only both? This affects the in what condition should we change the remote setting (removing default settings and renaming ) on different levels.

@karajan1001 karajan1001 changed the title Duplicated remote repository name in different config levels. Unique signature of the remote repository URLs or names. May 4, 2020
@karajan1001 karajan1001 changed the title Unique signature of the remote repository URLs or names. Unique signature of a remote repository URLs or names. May 4, 2020
@efiop
Copy link
Contributor

efiop commented May 10, 2020

@karajan1001 Sorry for the delay.

You have very valid points, but I don't quite understand which use-case or scenario we are talking about. What issue are we trying to solve or what feature are we trying to implement? Or are we just revisiting the remote logic? 🙂

@karajan1001
Copy link
Contributor Author

karajan1001 commented May 11, 2020

@efiop It's OK. I can't reply in time too.
This case.
case

And there was some discussion by @pared in #3470.

@efiop
Copy link
Contributor

efiop commented May 11, 2020

@karajan1001 Got it. Yes, dvc remote remove is trying to remove default remote from all levels.

The reason that logic was introduced was to avoid having a situation when a non-existing remote is still set as a default remote. So following that logic, in your example dvc remote remove should've either not touch the core.remote at all (because there is one at the top level) or also removed a remote with this name from the higher levels as well (as well as core.remotes). Need to give it a good thought.

@karajan1001
Copy link
Contributor Author

@efiop Sorry for late, I am a little busy this week.

Yes, I think it's OK to remove all of the default remote repos, too. This is a safety strategy that causes no crucial damage. Someone who wants to push or pull files to or from a default remote will only receive an error.

But, in another case, for example in #3599 where we renamed the remote repos, we are in a totally different situation. If we renamed the remote repos along with the default remote. Someone may push or pull files to or from wrong remote repos without noticing that the default remote had been changed. In these cases maybe we shouldn't rename the default, or maybe we should throw out a warning, or maybe we should make the users decide whether the default be renamed.

I was looking into several config issues and found it hard to choose a universal strategy in the cases that there are two different repos with the same name. So I opened this issue to see if there were some standards solution to follow.

Maybe there was no universal solution, and we had to solve all these case by case. If so, I think it is OK to close this issue.

@efiop
Copy link
Contributor

efiop commented May 20, 2020

Again, really sorry for the late reply 🙁

Yes, I think it's OK to remove all of the default remote repos, too. This is a safety strategy that causes no crucial damage.

That is not really the case when we are talking about system config, because it might've been setup that way for the whole shared server.

I was looking into several config issues and found it hard to choose a universal strategy in the cases that there are two different repos with the same name. So I opened this issue to see if there were some standards solution to follow.

Agreed, it is hard to come up with a universal strategy here and, admittedly, we just went with mimicking git to some extent with some adjustments requested by users.

Let's keep this open for now, we'll see if this becomes more relevant in the near future. If not - we'll close it later.

Thanks again for the amazing feedback! 🙏

@efiop
Copy link
Contributor

efiop commented Jun 23, 2020

Closing for now.

@efiop efiop closed this as completed Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response we are waiting for your reply, please respond! :)
Projects
None yet
Development

No branches or pull requests

2 participants