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

Unable to install_gitlab repos within subgroups #259

Closed
timtrice opened this issue Nov 21, 2018 · 3 comments
Closed

Unable to install_gitlab repos within subgroups #259

timtrice opened this issue Nov 21, 2018 · 3 comments

Comments

@timtrice
Copy link
Contributor

If we want to use install_gitlab we supply a repo parameter which is in username/repo[/subdir][@ref] format. This string is split by parse_repo_spec so we have a username variable (e.g., "r-lib") and repo variable (e.g., "remotes").

If my repo is within a GitLab group, then I can simply replace the username portion of the repo parameter with the name of the group.

However, if I have a subgroup holding the repo, I'm stuck. There is no params variable for subgroups.

#' Works
devtools::install_gitlab("timtrice/falsy")
#' Works
devtools::install_gitlab("timtrice_tests/falsy")
#' Fails
devtools::install_gitlab("timtrice_tests/tests/falsy")
 Error in utils::download.file(url, path, method = download_method(), quiet = quiet,  : 
  cannot open URL 'https://gitlab.com/timtrice_tests/tests/raw/master/falsy/DESCRIPTION?private_token=ABCDEFGHIJKLMNOP' 

There is no way to get the subgroup past the parse_repo_spec function. So, further functions that stick the URL back together do it incorrectly. The URL in the error above should be,

https://gitlab.com/timtrice_tests/tests/raw/master/falsy/DESCRIPTION?private_token=ABCDEFGHIJKLMNOP

For example, in remote_package_name, the src is built (using build_url) as that in the error message. But, if I change src to the last example above, while debugging, it is successful.

Another option is, instead of using the group/subgroup/repo combination, perhaps we can pass the Project ID? This doesn't seem to work in remote_pacage_name but it does in gitlab_commit.

@jimhester
Copy link
Member

I was not aware of this subgroup concept, looking at this example I am not really sure how it could be supported while also retaining support for subdirectories

@rozwad
Copy link

rozwad commented Mar 10, 2019

Please see #308 – quick and dirty workaround.

@ldecicco-USGS
Copy link

Any chance we can re-start the conversation on installing from sub groups? We're considering moving our github/USGS-R packages to a sub group. Here's an example:

The subgroup:
https://code.usgs.gov/water/stats

The repo:
https://code.usgs.gov/water/stats/MGBT

For the record, this works:

 remotes::install_git("https://code.usgs.gov/water/stats/MGBT.git")
 remotes::install_url("https://code.usgs.gov/water/stats/MGBT/-/archive/master/MGBT.zip")

So...maybe we just need to get people to use that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants