scribe

scribe (acronym for system compatibility report for install & build evaluation) is a project that creates complete build, check and install reports for a collection of R projects that are defined in an renv.lock file.
Installing
Simply download the project for your distribution from the releases page. scribe is distributed as a single binary file and does not require any additional system requirements other than git and R, both of which it integrates and interfaces with externally.
Usage
scribe is a command line utility, so after installing the binary in your PATH, simply run the following command to view its capabilities:
scribe --help
Example usage with multiple flags:
scribe --logLevel debug --maskedEnvVars 'password|key' --renvLockFilename renv2.lock --checkPackage 'tern*,teal*' --reportDir htmlreportdir --maxDownloadRoutines 100 --maxCheckRoutines 20 --numberOfWorkers 150 --clearCache
To download packages from git repositories, scribe retrieves PAT from environment variables:
- for GitLab, it reads the token from
GITLAB_TOKEN variable,
- for GitHub, it reads the token from
GITHUB_TOKEN variable.
Configuration file
If you'd like to set the above options in a configuration file, by default scribe checks ~/.scribe, ~/.scribe.yaml and ~/.scribe.yml files.
If this file exists, scribe uses options defined there, unless they are overridden by command line flags.
You can also specify custom path to configuration file with --config <your-configuration-file>.yml command line flag.
When using custom configuration file, if you specify command line flags, the latter will still take precedence.
Example contents of configuration file:
logLevel: trace
checkPackage: teal*
maskedEnvVars: secret-variable-name
renvLockFilename: custom-renv.lock
checkAllPackages: true
outputReport: someDirectoryName
maxDownloadRoutines: 30
maxCheckRoutines: 31
numberOfWorkers: 32
clearCache: true
Environment variables
Scribe reads environment variables with SCRIBE_ prefix and tries to match them with CLI flags.
For example, setting the following variables will override the respective values from configuration file:
SCRIBE_LOGLEVEL, SCRIBE_CHECKPACKAGE, SCRIBE_RENVLOCKFILENAME, SCRIBE_CHECKALLPACKAGES, SCRIBE_OUTPUTREPORT etc.
The precedence is like this (→ means "takes precedence over" or "overrides"):
CLI flag → environment variable → configuration file → default value.
Cache
scribe uses cache stored in /tmp/scribe for various purposes.
The results of download, installation, build and check stages are stored in /tmp/scribe/cache. When scribe detects presence of files with such results, it skips respective stages.
In order to run the download, installation, build and check from scratch, the /tmp/scribe/cache directory should be removed manually. Removing whole /tmp/scribe directory is also possible - in that case, the packages will have to be downloaded again because cached tar.gz packages and git repositories are stored in this directory.
Development
This project is built with the Go programming language.
Development Environment
It is recommended to use Go 1.20+ for developing this project. This project uses a pre-commit configuration and it is recommended to install and use pre-commit when you are developing this project.
Common Commands
Run make help to list all related targets that will aid local development.
Style
This project adopts the Uber styleguide.
License
scribe is licensed under the Apache 2.0 license. See LICENSE.md for details.