{lozen}

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”.

Installation

From Github

remotes::install_github(
  repo = "ThinkR-open/lozen",
  build_vignettes = TRUE
)

From r-universe

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

Use of the package, depending if you are a user or a developer

Use {lozen} as user

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.

Use {lozen} as developer

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.

More details about how to create tokens and define environment variables

GitLab

GitHub

Posit Connect

Documentation

Access to the pkgdown: https://thinkr-open.github.io/lozen/

Vignettes/articles

Documentation dedicated to the users (Devs, Lead Devs)