Skip to content

github remotes format partially incompatible with remotes package #275

Closed

Description

@ilia-kats

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)

Activity

  1. gaborcsardi commented on Mar 11, 2022

    @gaborcsardi
    Member

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

  2. ilia-kats commented on Mar 11, 2022

    @ilia-kats
    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.

  3. added
    bug
    on Apr 8, 2022
  4. gaborcsardi commented on Apr 8, 2022

    @gaborcsardi
    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.

  5. pawelru commented on Mar 9, 2023

    @pawelru
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions