-
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
scm: fix clone #7674
scm: fix clone #7674
Conversation
Seems windows tests are failing. Will look at this in a bit, possibly adding some tests for this scenario |
I'd be willing to merge this as a temporary workaround, but when we get into actually caching the erepo clones, we will need to make sure that we are properly handing URL string credentials on clone. |
dvc.scm.InvalidRemoteSCMRepo: 'file://C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\popen-gw0\erepo3' is not a valid Git remote or URL Looks like under the Windows platform, The prefix |
Indeed. The issue is that when the repo is cloned, the token is stripped from the URL saved in
Do you have anything in mind? Storing tokens in |
Sorry to jump in but it seems Poetry has just dealt with a similar issue a few days ago (python-poetry/poetry#5428), maybe you can use a similar approach? |
Ideally we would implement support for credential helpers in either dulwich (jelmer/dulwich#873) or libgit2/pygit (libgit2/libgit2#4873)
Yes, this would also be an option. If we raise But IMO we should be avoiding re-introducing the use of gitpython in DVC if at all possible, and personally I would prefer the workaround from this PR as a temporary fix until we implement credentials support in dulwich over using gitpython as a fallback for |
Finally had a chance to look at this. It seems that the issue is in the tests: we use a This works for Lines 126 to 129 in dc1d3e8
It seems to me that the cleanest solution is to add support for |
Windows tests should succeed once scmrepo 0.0.23 iterative/scmrepo#72 is released and we bump its version in |
a1a8df2
to
5a74202
Compare
merge after |
5a74202
to
a2be229
Compare
@dtrifiro looks like theres a linter issue? |
`fetch_all_exp()` in `clone()` was called with `url="origin"`, which resulted in the operation being performed with the remote URL defined in the cloned repo's config, which did not include any credentials initially provided to clone. Fixes iterative#7670
a2be229
to
eeba35c
Compare
@pmrowla Could you take a look, please? |
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.
approved w/the note that this is a temporary workaround until #7674 is supported
fetch_all_exp()
inclone()
was called withurl="origin"
, which resulted in the operation being performed with the remote URL defined in the cloned repo's config, which did not include any credentials initially provided to clone.Fixes #7670