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

Fix gitlab url for subgroups #699

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/gitlab.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ gitlabArchiveUrl <- function(pkgRecord) {
archiveUrl <- sprintf(fmt,
pkgRecord$remote_host,
pkgRecord$remote_username,
pkgRecord$remote_repo,
sub("/", "%2F", pkgRecord$remote_repo),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @galachad

Note to @toph-allen --

Per https://docs.gitlab.com/ee/api/repositories.html#get-file-archive, the :id needs to be URL-encoded. We may want to use this opportunity to escape other characters, as well.

URLencode(pkgRecord$remote_repo, TRUE)

Additionally, we should update NEWS.

Copy link
Contributor

@toph-allen toph-allen Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should use URLencode here, I think.

I'm also going to check GitHub and Bitbucket to see if we should treat them similar.

We may also want to add this case to the gitlabArchiveUrl test.

Thanks for submitting this, @galachad! I may open a new branch on rstudio/packrat to make the above changes, and if I do that, I'll close this PR with a reference to that.

pkgRecord$remote_sha)

protocol <- if (identical(method, "internal")) "http" else "https"
Expand Down