Title: | Base package for Posit Checks |
---|---|
Description: | Base package for sharing classes between posit audit packages. Unlikely to be useful as is. |
Authors: | Jumping Rivers [aut, cre] |
Maintainer: | Jumping Rivers <[email protected]> |
License: | file LICENSE |
Version: | 0.6.20 |
Built: | 2025-02-21 18:32:09 UTC |
Source: | https://github.com/jumpingrivers/audit.base |
Used for side effect, i.e. printing to console
audit_posit_version(posit_version, type = c("connect", "workbench", "drivers"))
audit_posit_version(posit_version, type = c("connect", "workbench", "drivers"))
posit_version |
Current Posit version |
type |
Posit product of interest |
audit_posit_version("2023.03.0", type = "connect")
audit_posit_version("2023.03.0", type = "connect")
Augments installed software columns
augment_installed(installed, verbose = TRUE) print_colour_versions(installed)
augment_installed(installed, verbose = TRUE) print_colour_versions(installed)
installed |
A tibble with columns software and installed_version |
verbose |
Default TRUE. |
Base Check Class
Base Check Class
Inherited underlying base class. Shouldn't be used directly
audit.base::logger
-> base_check
group
Field for grouping tests
short
Use in config.yml
context
Human readable string
long
A long description of the test
account
Account name
new()
Set parameters for config file location
base_check$new(dir = ".", file = "config-uat.yml", debug_level = 0)
dir
directory location of the the config file
file
config file name
debug_level
Value of 0, 1, or 2
info()
Summarise key class attributes
base_check$info()
clone()
The objects of this class are cloneable with this method.
base_check$clone(deep = FALSE)
deep
Whether to make a deep clone.
In addition to the checks made by serverHeaders we also check that Posit isn't in one of the headers.
check_server_headers(server)
check_server_headers(server)
server |
URL of server |
Many R packages require additional system dependencies. This check, obtains a list of system libraries installed on the connect server, then determines which R packages can't be installed.
check_sys_deps(os_release, installed_libs, debug_level = 0:2)
check_sys_deps(os_release, installed_libs, debug_level = 0:2)
os_release |
Output from /etc/os-release |
installed_libs |
A vector of packages, e.g. output apt list –installed, or 'get_installed_libs()' |
debug_level |
Integer - 0, 1, 2 |
Suppress parameter will be changed in a near-future MR to verbose levels
This function creates an example config. By default all tests are TRUE. Some RSC servers intentionally won't have some features implemented.
create_config(file, pkg_name)
create_config(file, pkg_name)
file |
Config file name |
pkg_name |
E.g. uat.base description |
If a test is missing from the config file, it is assume to be TRUE. Therefore, the config file can be quite short and just list exceptions. If the config file is missing, then all tests are carried out.
When merging configs, we either * merge the new with existing * force: overwrite existing file * error: if a config file exists, raise an error
Run on Posit workbench. Determines the system libs that are installed on a machine.
get_installed_libs() clean_libs(os_release, libs)
get_installed_libs() clean_libs(os_release, libs)
os_release |
Output from /etc/os-release |
libs |
A vector of installed sys deps |
Returns a tibble containing the Posit version, date of release, and any associated CVEs
get_posit_versions(type = c("connect", "workbench", "drivers"), remote = TRUE)
get_posit_versions(type = c("connect", "workbench", "drivers"), remote = TRUE)
type |
Posit product of interest |
remote |
Try scrapping NEWS first, but fall back to local if that fails |
get_posit_versions(type = "connect")
get_posit_versions(type = "connect")
In general not used by users.
get_quarto_server_header(out) get_quarto_sys_deps(out) get_quarto_software_versions(out) get_quarto_deploy(out) get_quarto_posit_version_msg(out, type = c("connect", "workbench", "drivers"))
get_quarto_server_header(out) get_quarto_sys_deps(out) get_quarto_software_versions(out) get_quarto_deploy(out) get_quarto_posit_version_msg(out, type = c("connect", "workbench", "drivers"))
out |
Output from check |
type |
Posit product of interest |
Debugging helper functions
get_suppress(debug_level) get_debug_level(debug_level)
get_suppress(debug_level) get_debug_level(debug_level)
debug_level |
An integer, 0, 1, 2. |
These functions are used by the health check function to initialise and check
init_r6_checks(dir, file, pkg_name) init_r6_check(export, dir, file, pkg_name)
init_r6_checks(dir, file, pkg_name) init_r6_check(export, dir, file, pkg_name)
dir |
Directory of the config file |
file |
Config file name |
pkg_name |
E.g. uat.base description |
export |
Name of the R6 class to initialise |
R6 logger class
R6 logger class
Not called directly, but is inherited by base_check.
start_logger()
Starts the logger
logger$start_logger()
stop_logger()
Stores the results of the check
logger$stop_logger(passed)
passed
Logical, if skipped, the NA
get_log()
Retrieve the log
logger$get_log()
Check log
clone()
The objects of this class are cloneable with this method.
logger$clone(deep = FALSE)
deep
Whether to make a deep clone.
Currently this function would only be called by the package author, as it updates inst/extdata/versions/*.csv
update_all_versions()
update_all_versions()