Skip to contents

GitLab is a site providing, among other services, code repositories with Git version control system. This allows for accessing a wide set of metadata.

Packages

A user or a group may be (and in most cases is) an owner of several repositories. Not all repositories are R packages, thus the repository character is approximated by the presence of a DESCRIPTION file, one of very few required files for R packages, in the root folder.

wood_gitlab_packages("r-packages")
#>  [1] "qualchemy"      "quartodon"      "raven"          "comma"         
#>  [5] "preregr"        "bookmark"       "md4e"           "limonaid"      
#>  [9] "rosetta"        "scda"           "mdmcda"         "gdpr"          
#> [13] "behaviorchange" "psyverse"       "justifier"      "ufs"           
#> [17] "rock"           "yum"            "metabefor"

By default, forks of other repositories are not listed, but this setting can be changed using include_forks parameter:

wood_gitlab_packages("r-packages", include_forks = TRUE)
#>  [1] "qualchemy"      "quartodon"      "raven"          "comma"         
#>  [5] "preregr"        "bookmark"       "md4e"           "limonaid"      
#>  [9] "rosetta"        "scda"           "mdmcda"         "gdpr"          
#> [13] "behaviorchange" "psyverse"       "justifier"      "ufs"           
#> [17] "rock"           "yum"            "metabefor"

Available tags

GitLab allows referencing to certain commits through specifying tags associated with them. To list all tags available for a given repository the user should use wood_gitlab_tags(). Note that some repositories may not have any tags defined, in which case an empty character vector would be returned.

wood_gitlab_tags("rock", "r-packages")
#>  [1] "v0.8.1" "v0.7.1" "v0.7.0" "0.6.7"  "0.6.6"  "0.6.5"  "0.6.4"  "0.6.3" 
#>  [9] "0.6.0"  "v0.5.7" "v0.5.5" "0.5.5"  "v0.5.4" "v0.5.1" "v0.5.0" "0.4.3"

Available package versions

Repository tags do not have to follow the specific guidelines of version codes. To extract package version codes associated with each GitLab tag the user should use wood_gitlab_versions(). This extracts the data from the DESCRIPTION file corresponding to each tagged commit.

wood_gitlab_versions("rock", "r-packages")
#>  [1] "0.8.1" "0.7.1" "0.7.0" "0.6.7" "0.6.6" "0.6.5" "0.6.4" "0.6.3" "0.6.0"
#> [10] "0.5.7" "0.5.5" "0.5.5" "0.5.4" "0.5.1" "0.5.0" "0.4.0"

Latest package version

To query the latest package version, i.e. the one that’d be installed by calling remotes::install_gitlab(), the user should use wood_gitlab_latest(). This function queries GitLab for the version code associated with the latest commit to the default branch of the specified repository. Note that this commit may be untagged, in which case the returned version code may not be among the ones listed by wood_gitlab_versions().

wood_gitlab_latest("rock", "r-packages")
#> [1] "0.8.3"

Package dependencies

To list package dependencies the user should use wood_gitlab_dependencies(). This function extracts dependencies from the DESCRIPTION file. By default the latest commit is queried (the same behaviour can be obtained using tag = "latest" parameter) but it is possible to list dependencies for any tagged version.

wood_gitlab_dependencies("limonaid", "r-packages")
#> <dependencies>
#>   Suggests:    ggplot2
#>   Suggests:    ggrepel
#>   Suggests:    knitr
#>   Suggests:    parallel
#>   Suggests:    psyverse (>= 0.3)
#>   Suggests:    sticky
#>   Suggests:    testthat
wood_gitlab_dependencies("rock", "r-packages", tag = "0.6.3")
#> <dependencies>
#>   Depends:     R (>= 3.0.0)
#>   Imports:     data.tree (>= 0.7.8)
#>   Imports:     dplyr (>= 0.7.8)
#>   Imports:     DiagrammeR (>= 1.0.0)
#>   Imports:     DiagrammeRsvg (>= 0.1)
#>   Imports:     ggplot2 (>= 3.2.0)
#>   Imports:     glue (>= 1.3.0)
#>   Imports:     graphics (>= 3.0.0)
#>   Imports:     htmltools (>= 0.5.0)
#>   Imports:     markdown (>= 1.1)
#>   Imports:     purrr (>= 0.2.5)
#>   Imports:     stats (>= 3.0.0)
#>   Imports:     utils (>= 3.5.0)
#>   Imports:     yaml (>= 2.2.0)
#>   Imports:     yum (>= 0.1.0)
#>   Suggests:    covr
#>   Suggests:    googlesheets4
#>   Suggests:    haven (>= 2.4)
#>   Suggests:    justifier (>= 0.2)
#>   Suggests:    knitr
#>   Suggests:    limonaid
#>   Suggests:    openxlsx (>= 4.2)
#>   Suggests:    pdftools
#>   Suggests:    preregr (>= 0.1.9)
#>   Suggests:    rENA (>= 0.1.6)
#>   Suggests:    readxl
#>   Suggests:    rmarkdown
#>   Suggests:    rvest
#>   Suggests:    rstudioapi
#>   Suggests:    striprtf
#>   Suggests:    testthat
#>   Suggests:    writexl
#>   Suggests:    XLConnect
#>   Suggests:    xml2