r-lib / pkgdepends

R Package Dependency Resolution
https://r-lib.github.io/pkgdepends/
Other
97 stars 30 forks source link

Updating GitLab url parsing; fix authed list_refs #353

Closed dgkf closed 5 months ago

dgkf commented 7 months ago

This PR is intended to fix #328 with a few other related fixes

Let me know if I'm on the right track, or if you think this is better solved some other way.

dgkf commented 6 months ago

Since GitLab can have arbitrarily nested projects and some alternative syntax would be needed to differentiate user/repo/sub/dir from /group/subgroup/subgroup2/subgroup3, would an alternative syntax more akin to Authors@R be up for consideration?

Remotes:
  list(name = "pkg", type = "gitlab", url = "https://acme.co/a/b/c.git", subdir = "x/y/z", ref = "dev")

I appreciate that the current string style is quite brief, but maybe something more explicit would be a nice fallback?

gaborcsardi commented 5 months ago

Thanks! I changed this a bit to add auth to all git HTTP queries. There is two things to do still:

gaborcsardi commented 5 months ago

would an alternative syntax more akin to Authors@R be up for consideration?

That is not great, because other tools will interpret the Remotes field differently. It also does not play well with other, non-R tools that try to use the DESCRIPTION file.

This throws a wrench in the subdir parsing. To allow a subdir, I added a /-/ separator: group/subgroup/project/-/sub/dir@ref

Yes, this could work.

gaborcsardi commented 5 months ago

Actually, some the git and gitlab tests are already "live", so we can update those later, and I am going to merge this now, after updating the docs.

gaborcsardi commented 5 months ago

Thanks you again!