remotes icon indicating copy to clipboard operation
remotes copied to clipboard

Install with private deps fails using usethis git credentials

Open latot opened this issue 1 year ago • 3 comments

Hi, this might be similar to https://github.com/r-lib/remotes/issues/758, also the pak library works for this case, but is ideal to work here too.

Rn using usethis we can use git credentials: https://stackoverflow.com/a/71846333/4652030

Still not the ideal case thinking we could use the actual git credentials instead register two in the same system, but still following that we have two credentials on the system to download private repos.

After following the steps, we can install the private repo, the problem is that when the project has a private dependency, if this is the case we will not be able to install the package with:

Downloading git repo https://github.com/CIT-UAI/rtestB
'/usr/bin/git' clone --depth 1 --no-hardlinks https://github.com/CIT-UAI/rtestB /tmp/RtmpuXMEtf/file386464b17622a
Clonando en '/tmp/RtmpuXMEtf/file386464b17622a'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 0), reused 6 (delta 0), pack-reused 0
Recibiendo objetos: 100% (7/7), listo.
Error: Failed to install 'unknown package' from Git:
  HTTP error 404.
  Not Found

  Did you spell the repo owner (`CIT-UAI`) and repo name (`rtestC`) correctly?
  - If spelling is correct, check that you have the required permissions to access the repo.

So seems the usethis git credentials are picked for the main project, but not parsed to the deps.

Thx!

latot avatar Apr 01 '24 13:04 latot

It is very possible that remotes sends the same credentials for all repositories, which is certainly not great. In any case, we are focusing on pak, so if you can use pak, that's a great workaround.

gaborcsardi avatar Apr 01 '24 13:04 gaborcsardi

will pak replace remotes? I'm thinking that devtools uses remotes instead of pak.

latot avatar Apr 01 '24 13:04 latot

Yes, devtools will use pak in the near future.

gaborcsardi avatar Apr 01 '24 13:04 gaborcsardi