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

Using auth_token to install package dependencies #697

Open
kieran-mace opened this issue May 20, 2021 · 1 comment
Open

Using auth_token to install package dependencies #697

kieran-mace opened this issue May 20, 2021 · 1 comment
Labels
feature a feature request or enhancement

Comments

@kieran-mace
Copy link

Is your feature request related to a problem? Please describe.

Devtools does not successfully install private package dependencies.

Lets say I have two packages as subdirectories in a monorepo:

/r/PackageA
/r/PackageB

And PackageB depends on PackageA

If I run:

devtools::install_github(repo = 'organization/monorepo',
                         subdir = 'r/PackageA',
                         auth_token = 'my_private_token')

Things work as expected. Package A does not depend on Package B. Everything works fine.

However:

If I try to install PackageB:

devtools::install_github(repo = 'organization/monorepo',
                         subdir = 'r/PackageB',
                         auth_token = 'my_private_token')

Which has PackageA as a dependency. It fails with:

Downloading GitHub repo picnichealth/organization@HEAD
Error: Failed to install 'PackageB' from GitHub:
  HTTP error 404.
  Not Found

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

What's actually happening here is that the target package, PackageB, is being pulled correctly, but devtools is not able to use the same token again to pull down its dependency PackageA.

This can be verified by calling devtools::install_deps.

This issue can be circumvented by adding GITHUB_PAT variable in your ~/.Renviron file

Describe the solution you'd like

I would like for auth_token to be available for primary package install AND its dependent packages

Describe alternatives you've considered

adding GITHUB_PAT variable to my ~/.Renviron file

@kieran-mace kieran-mace added the feature a feature request or enhancement label May 20, 2021
@jennybc
Copy link
Member

jennybc commented Feb 22, 2022

Package installation is actually accomplished via the remotes package. So I'm transferring this there.

@jennybc jennybc transferred this issue from r-lib/devtools Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants