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 It seems to me that the cleanest solution is to add support for |
|
Windows tests should succeed once scmrepo 0.0.23 treeverse/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 treeverse#7670
a2be229 to
eeba35c
Compare
|
@pmrowla Could you take a look, please? |
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