Title: | Posit Connect Health Check |
---|---|
Description: | Posit Connect Health Check. Deploys various content types to assess whether Connect is functioning correctly. |
Authors: | Jumping Rivers [aut, cre] |
Maintainer: | Jumping Rivers <[email protected]> |
License: | file LICENSE |
Version: | 0.7.6 |
Built: | 2025-02-12 16:50:50 UTC |
Source: | https://github.com/jumpingrivers/audit.connect |
This functions runs all Posit tests.
To skip tests, set check to no
in the config yaml file.
See create_config()
check(server = NULL, token = NULL, dir = ".", debug_level = 0:2)
check(server = NULL, token = NULL, dir = ".", debug_level = 0:2)
server |
Connect server (URL). If NULL, use the ENV variable CONNECT_SERVER. |
token |
Connect api token. If NULL, use the ENV variable CONNECT_API_KEY |
dir |
directory location of the the config file |
debug_level |
Integer, 0 to 2. |
Debug level description
0: clean-up all files; suppress all noise
1: clean-up all files, but display build steps
2: No clean-up (on connect and on disk) and display build steps
R6 classes
R6 classes
Check classes
audit.base::logger
-> audit.base::base_check
-> check_deploy_github
check()
Deploy a shiny application from github
check_deploy_github$check(debug_level)
debug_level
See check() for details
clone()
The objects of this class are cloneable with this method.
check_deploy_github$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 classes
R6 classes
Check classes
audit.base::logger
-> audit.base::base_check
-> check_deploy_pins_rds
check()
Checks a pin can be written, read and deleted
check_deploy_pins_rds$check(debug_level)
debug_level
See check() for details
clone()
The objects of this class are cloneable with this method.
check_deploy_pins_rds$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 classes
R6 classes
Check classes
audit.base::logger
-> audit.base::base_check
-> check_deploy_pluumber_api
check()
Checks deployment of a Plumber API
check_deploy_plumber_api$check(debug_level)
debug_level
See check() for details
clone()
The objects of this class are cloneable with this method.
check_deploy_plumber_api$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 classes
R6 classes
Check classes
audit.base::logger
-> audit.base::base_check
-> check_deploy_python_flask
check()
Checks deployment of Quarto document with HTML output
check_deploy_python_flask$check(debug_level)
debug_level
See check() for details
clone()
The objects of this class are cloneable with this method.
check_deploy_python_flask$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 classes
R6 classes
Check classes
audit.base::logger
-> audit.base::base_check
-> check_deploy_python_streamlit
check()
Checks deployment of Python Streamlit app
check_deploy_python_streamlit$check(debug_level)
debug_level
See check() for details
clone()
The objects of this class are cloneable with this method.
check_deploy_python_streamlit$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 classes
R6 classes
Check classes.
We use the deploy_python() mechanism for this quarto document, as we need to specify the requirements.txt file
audit.base::logger
-> audit.base::base_check
-> check_deploy_quarto_python
check()
Deploy a quarto document that uses a jupyter engine
check_deploy_quarto_python$check(debug_level, account = NULL)
debug_level
See check() for details
account
Connect username
clone()
The objects of this class are cloneable with this method.
check_deploy_quarto_python$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 classes
R6 classes
Check classes
audit.base::logger
-> audit.base::base_check
-> check_deploy_shiny
check()
Checks deployment of an R Markdown document with Word Docx output
check_deploy_shiny$check(debug_level)
debug_level
See check() for details
clone()
The objects of this class are cloneable with this method.
check_deploy_shiny$clone(deep = FALSE)
deep
Whether to make a deep clone.
This function creates an example config. By default all tests are TRUE. Some RSC servers intentionally won't have some features implemented.
create_config(dir = ".", default = TRUE, type = c("merge", "force", "error"))
create_config(dir = ".", default = TRUE, type = c("merge", "force", "error"))
dir |
Directory of the config file |
default |
Default value for if a test should run (logical) |
type |
Merge type, see details |
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
Deploy Python output
deploy_python( python_dir, python_files = c("app.py", "index.qmd"), rsconnect_type = c("api", "streamlit", "quarto"), debug_level = debug_level )
deploy_python( python_dir, python_files = c("app.py", "index.qmd"), rsconnect_type = c("api", "streamlit", "quarto"), debug_level = debug_level )
python_dir |
Location of python deployment files |
python_files |
Either an app or a qmd file |
rsconnect_type |
Type of deployment |
debug_level |
Integer, 0 to 2. |
Python deploy function
All python content must have a requirements.txt file and either a app.py or index.qmd.
index.qmd
is for quarto only. General idea is to
copy dir of contents to R_TMP_DIR
Use the python interface to deploy
Use the python interface to grab the guid
Clean up. @noRd
In general not used by users.
get_quarto_old_users(out) get_quarto_user_roles(out) get_quarto_locked_user_apps(out)
get_quarto_old_users(out) get_quarto_user_roles(out) get_quarto_locked_user_apps(out)
out |
Output from check |
This function removes user-identifying data from an audit.connect object
sanitise(audit_connect_check)
sanitise(audit_connect_check)
audit_connect_check |
An object from |