Provides R functions to access the API of the project and repository management web application gitlab. For many common tasks (repository file access, issue assignment and status, commenting) convenience wrappers are provided, and in addition the full API can be used by specifying request locations. Gitlab is open-source software and can be self-hosted or used on gitlab.com.
You can install the most recent stable version from CRAN using:
To install the development version, in a console type:
git clone https://github.com/jirkalewandowski/gitlabr.git R -e "library(devtools); document('gitlabr'); install('gitlabr')"
Gitlab 9.0 or higher is generally recommended when using gitlabr version 0.9 or higher, since this package version uses the gitlab API v4, older versions use API v3, which was the standard before Gitlab 9.0. Older versions of Gitlab using API v3 are sill supported by gitlabr 0.9, see details section "API version" of the documentation of
gl_connection on how to use them. From gitlabr 1.0 on (expected in the second half of 2017), API v3 usage will be deprecated.
R code using gitlabr to perform some easy, common gitlab actions can look like this:
library(gitlabr)# connect as a fixed user to a gitlab instancemy_gitlab <- gl_connection("",login = "testibaer",password = readLines("secrets/gitlab_password.txt"))# a function is returned# its first argument is the request (name or function), optionally followed by parametersmy_gitlab(gl_list_projects) # a data_frame is returned, as is always by gitlabr functionsmy_gitlab(gl_list_files, project = "gitlabr", path = "R")# create a new issuenew_feature_issue <- my_gitlab(gl_new_issue, project = "testor", "Implement new feature")# requests via gitlabr always return data_frames, so you can use all common manipulationsrequire(dplyr)example_user <-my_gitlab("users") %>%filter(username == "testibaer")# assign issue to a usermy_gitlab(gl_assign_issue, project = "testor",new_feature_issue$iid,assignee_id = example_user$id)my_gitlab(gl_list_issues, "testor", state = "opened")# close issuemy_gitlab(gl_close_issue, project = "testor", new_feature_issue$iid)$state
force_api_v3parameter to force old API version logic.
gl_buildswas replaced by
gl_jobsto reflect API v4 logic.
push_to_remotesparameter was added to
use_gitlab_cisuch that gitlab CI can be used conveniently for pushing to remote repositories.
There is no gitlabr 0.8. Version number 0.9 was used to align with Gitlab version 9.0, for which this version is appropriate.
NEWS.mdfile to track changes to the package.