-
Notifications
You must be signed in to change notification settings - Fork 155
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
Use renv for private GitLab package on local server #476
Comments
I think something like the following should work:
Or, you can also try setting the
|
@peteD900 Also make sure that your GitLab PAT has the correct scope. I accidentally set one of mine to 'read_repository' and then stumbled across the same error. The code @kevinushey suggested now works fine after I created a new PAT with scope 'api'. |
Thanks @fdetsch but I still can't get this to work. I doubled checked the GITLAB_PAT and it has 'api' scope. I stored it in a
I tried setting the GitLab host option:
Then running: But I still get the error:
So I'm wondering whether it is just a connection issue at my end. But I'm confused as to why I can run:
In a project where I have not initialised |
Ok got it.....not sure why I had to do this but if I set: |
I ran in the same issue today and I'm wondering if a PAT with full 'api' scope is really necessary. The situation at our place is that we have a dependency on a private repository during our build process using GitLab's CI/CD. At the moment we have to supply a PAT with full 'api' scope within the repository to enable the CI/CD job to access the other repository. Maybe this setting is dump at all but that's how it is for now. Anyways, I think I tracked this issue down to this code block Lines 382 to 390 in 7fdff02
And in there the call Lines 52 to 58 in 7101c91
to query the size of the json with curl trying to access the header is the only point at which a PAT with full 'api' scope is needed. Interestingly, querying the file size within in this code blockLines 392 to 396 in 7fdff02
does not need a PAT with full 'api' scope. Maybe this is a bug on GitLab's side but maybe @kevinushey can think of a way to bypass this on renv s side?
|
We could skip that download size check when using GitLab -- would that be appropriate? |
I'm not sure of any side effects skipping that check but if you think that's a solution, I'm very fine with it. |
Hi all, I'm experiencing a similar problem. I want renv to install a package from our company gitlab instance but with no success. I have created a personal access token with API being the only option checked. Then in my R project I execute the following :
And R returns me the following :
But when I try to install using devtools :
The installation works. I really need renv to work because I'm building a solution that calls renv programmatically to automatically configure projects environments for my colleagues in such a way that reproducibility will always be insured. (Please note that I have edited the real domain name of our company gitlab instance, username and package name) Also, we currently have no SSH access enabled on our gitlab instance (and I don't have the hand on this restriction). We always use HTTP to work with our gitlab instance) Any idea of what could be wrong ? Thanks for your precious help |
You could also set Does the PAT you're using have the requisite permissions needed to access things in your private repository? Or would you instead prefer to use username + password authentication, as in your git example? |
Hi @kevinushey, Just have tried the following :
R returns me this message :
The PAT only has the API right. Should I allow other options? If I can work with a username and password from renv that's even better as it will be easier to use for my colleagues that are not developers and not familiar with gitlab, PAT, etc. At the moment my script that automatically configure projects with pre-installed custom package circumvents this problem by doing:
which results that the package is installed into the project private library with devtools. |
If I understand correctly, having the |
Hi @kevinushey, I have found that I can also use a PAT with devtools. Now I end u pusing this workflow:
Hope it may help someone :) |
Hi there. Following up on a question I posted on Stack Overflow: I'd like to use
renv
to manage some packages hosted on a private local GitLab account. By local I mean hosted on a local server with GitLab on. I use RStudio Server Pro to develop packages and other users can install packages from GitLab by running:devtools::install_git( url = "http://my-gitlab-server/r-projects/package.git", credentials = git2r::cred_user_pass("user", "pass") )
When I use
renv::init()
the package source is unknown and after help from Kevin Ushey (KU) theDESCRIPTION
file of the package I'm trying to install asRemoteType: git2r
. Following this I tried to userenv::install()
to install the package after saving aGITLAB_PAT
in a.Renviron
file in the project root folder. I got the error:download failed [error code 22]
I'm not sure how to use
renv::install
correctly in this scenario. KU suggested to tryrenv::install("gitlab::user/project")
but I'm not sure this makes sense when the package is hosted onhttp://my-gitlab-server
. I did try various combinations of strings to install:renv::install("gitlab::user/project")
renv::install("gitlab::http://my-gitlab-server/r-projects/package.git")
renv::install("gitlab::my-gitlab-server/r-projects/package.git")
But all resulted in the same error and KU suggested raising an issue. Perhaps there is a better or different way to go about this?
The text was updated successfully, but these errors were encountered: