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

github remotes format partially incompatible with remotes package #275

Closed
ilia-kats opened this issue Mar 11, 2022 · 4 comments · Fixed by #321
Closed

github remotes format partially incompatible with remotes package #275

ilia-kats opened this issue Mar 11, 2022 · 4 comments · Fixed by #321
Labels
bug an unexpected problem or unintended behavior

Comments

@ilia-kats
Copy link

If a dependency is hosted on GitHub, but its repository name doesn't match the package name, both pkgdepends and remotes allow explicitly specifying the package name. However, they are incompatible: pkgdepends expects a remote of the form packagename=github::username/repo, whereas remotes expects github::packagename=username/repo. This makes it impossible to both allow installation of one's package from GitHub with remotes and running a GitHub actions workflow that uses r-lib/actions/setup-r-dependencies (which uses pak which uses pkgdepends)

@gaborcsardi
Copy link
Member

The github:: is optional, so packagename=username/repo should work for both.

@ilia-kats
Copy link
Author

Indeed, thank you, now it works. Still, in light of potential addiitonal remotes for pkgdepends (#13, #15, #16) I think the formats should be compatible.

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Apr 8, 2022
@gaborcsardi
Copy link
Member

As pkgdepends will get more features in the future, and remotes will not, it is unlikely that the formats will stay fully compatible. That said, pkgdepends should be able to parse the same refs that remotes parses, so I'll fix this here if possible.

@pawelru
Copy link
Contributor

pawelru commented Mar 9, 2023

Just to add: <org>/<repo>@*remotes syntax is currently not supported even though documentation claims to do so:

`<detail>` may specify:
- a git branch, tag or (prefix of) a commit hash: `@<commitish>`;
- a pull request: `#<pull-request>`; or
- the latest release: `@*release`.

This is a dummy example:

r$> pkgdepends::new_pkg_installation_proposal("r-lib/cli@*release", config = list(library = tempfile())) -> x
r$> x$solve()
r$> x$get_resolution()$version
ℹ Creating library directory: /var/folders/m1/hrz0h_ls7gz57rc80tnj41t80000gp/T//Rtmpg02Iaz/file66e1a6e1572
[1] "3.6.0.9000"

(whereas it should be "3.6.0" at the moment of writing this post; also: it's very unlikely to make a release out of development version)

I think I managed to go through the all stack and the problem is that "release" slot of remote_ref object is being ignored when parsing GH query to download:

pkgdepends/R/type-github.R

Lines 244 to 250 in 63479a7

type_github_get_data_ref <- function(rem) {
user <- rem$username
repo <- rem$repo
ref <- rem$commitish %|z|% "HEAD"
subdir <- rem$subdir %&z&% paste0(utils::URLencode(rem$subdir), "/")
query <- glue("{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants