The objective of {lozen} is to centralize project management tools for Devs and Lead Devs.
To use the package, as user or as developer, you will have to define some tokens and environment variables. Go to the dedicated section below “Use {lozen} as user” or “Use {lozen} as developer”.
remotes::install_github(
repo = "ThinkR-open/lozen",
build_vignettes = TRUE
)
install.packages(
"lozen",
repos = c("https://thinkr-open.r-universe.dev", "https://cloud.r-project.org")
)
#> Installation du package dans 'C:/Users/yohann/AppData/Local/R/win-library/4.2'
#> (car 'lib' n'est pas spécifié)
#> le package 'lozen' a été décompressé et les sommes MD5 ont été vérifiées avec succés
#>
#> Les packages binaires téléchargés sont dans
#> C:\Users\yohann\AppData\Local\Temp\Rtmp86E83L\downloaded_packages
You need to use this kind of .Renviron
file:
GITLAB_TOKEN="my.token.generated.in.gitlab"
GITLAB_URL="https://my.gitlab.url"
GITHUB_PAT="my.personal.access.token.generated.in.github"
CONNECT_URL="https://my.connect.url"
CONNECT_NAME="my.connect.server.name"
CONNECT_USER="my.connect.username"
CONNECT_TOKEN="my.api.key.generated.in.connect"
You can use the command line usethis::edit_r_environ()
to open a
.Renviron
file. Save the values inside as mentioned above, and restart
your R session.
Depending on your needs, you will have to set all of them (GitLab, GitHub and Posit Connect), or just some of them. See the details sections below to have more information about how to create them.
If you wish to use function related to Posit Connect, you must set your Connect account manually within Rstudio.
Note that unit tests will create and publish some elements on your own instances (GitLab, GitHub, Posit Connect). These objects will be automatically deleted at the end of the tests.
You need to use this kind of .Renviron
file:
GITLAB_TOKEN="my.token.generated.in.gitlab"
GITLAB_URL="https://my.gitlab.url"
ALLOW_CI_TESTS_ON_GITLAB="TRUE"
GITHUB_PAT="my.personal.access.token.generated.in.github"
CONNECT_URL="https://my.connect.url"
CONNECT_NAME="my.connect.server.name"
CONNECT_USER="my.connect.username"
CONNECT_TOKEN="my.api.key.generated.in.connect"
ALLOW_TESTS_TO_DEPLOY_ON_CONNECT="TRUE"
You can use the command line usethis::edit_r_environ()
to open a
.Renviron
file. Save the values inside as mentioned above, and restart
your R session.
You will have to set all of them (GitLab, GitHub and Posit Connect), to be sure all unit tests can be launched. See the details sections below to have more information about how to create them.
Please note that unit tests using {gert}
might show a prompt asking
for your gitlab username and password. For the latter, you must provide
your gitlab password, not a token.
For tests deploying content on Posit Connect, you must set your Connect account manually within Rstudio and must have deployed manually a content at least once before being able to run the tests.
GITLAB_TOKEN
: Create a personal access token on GitLab, with the rights: “read_repository”, “write_repository”, “api”, “read_api”GITLAB_URL
: url of your gitlab instance - if this isgitlab.com
, you do not have to specify it, because this is the default value used by the package
GITHUB_PAT
: Create a personal access token on GitHub - the following scopes must be granted with your token “admin:org”, “delete_repo”, “project”, “repo”, “user”, “workflow.”
CONNECT_URL
: Url of your Posit ConnectCONNECT_NAME
: Name of your Posit Connect server - to know this information, please usersconnect::accounts()$server
. if this isconnect
, you do not have to specify it, because this is the default value defined by Posit Connect once a first connection has been made to the serverCONNECT_USER
: Your username in your Posit ConnectCONNECT_TOKEN
: Personal access token of your Posit Connect - please follow the official documentation to create it
Access to the pkgdown: https://thinkr-open.github.io/lozen/
Documentation dedicated to the users (Devs, Lead Devs)
aa - Create a new project with GitLab
: Create a new R project for a mission - managed on GitLab, with everything needed (the R project skeleton, the init of git, the init of the project on GitLab, etc.)ab - Create a new project with GitHub
: Create a new R project for a mission - managed on GitHub, with everything needed (the R project skeleton, the init of git, the init of the project on GitLab, etc.) (WIP)ac - Create the skeleton of the R project (package, app, book)
: Add the skeleton of a R product in your projectad - Set up continuous integration and continuous deployment for Gitlab CI/CD
: Set up the publication of your productae - Create Weekly with GitHub or GitLab
: Generate a weekly/daily for a missionaf - Build a pkgdown with reports
: Build a pkgdown with coverage and test reportsba - Manage forge board and wiki
: Create and manage your communication tools on Gitlabbb - Manage git tools (branches, commits, etc.)
: Manage your repository on Gitlab