Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ vignettes/*.pdf
*.swp
config-uat-rsc.yml
output\.rds

/.quarto/
**/*.quarto_ipynb
1 change: 1 addition & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
linters: linters_with_defaults(
assignment_linter = NULL,
object_length_linter = NULL,
line_length_linter(100),
undesirable_operator_linter(
modify_defaults(
Expand Down
12 changes: 0 additions & 12 deletions CODEOWNERS

This file was deleted.

6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Type: Package
Package: audit.connect
Title: Posit Connect Health Check
Version: 0.7.7
Version: 0.7.8
Authors@R:
person("Jumping", "Rivers", , "info@jumpingrivers.com", role = c("aut", "cre"))
Description: Posit Connect Health Check. Deploys various content types to
assess whether Connect is functioning correctly.
License: file LICENSE
Imports:
audit.base (>= 0.6.15),
audit.base (>= 0.6.26),
cli,
connectapi (>= 0.2.0),
dplyr,
Expand Down Expand Up @@ -38,4 +38,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# audit.connect 0.7.8 _2026-03-11_
- fix: Pass debug_level
- fix: Use magrittr pipe for compatibility with older R versions.

# audit.connect 0.7.7 _2025-07-16_
- chore: Update requirements.txt

Expand Down
15 changes: 9 additions & 6 deletions R/deploy_flask-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ check_deploy_python_flask = R6::R6Class(
package = "audit.connect",
mustWork = TRUE
)
private$checker(deploy_python(
python_dir,
python_files = "app.py",
rsconnect_type = "api",
debug_level = debug_level
))
private$checker(
deploy_python(
python_dir,
python_files = "app.py",
rsconnect_type = "api",
debug_level = debug_level
),
debug_level
)
invisible(NULL)
}
),
Expand Down
13 changes: 8 additions & 5 deletions R/deploy_git-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ check_deploy_github = R6::R6Class(
#' @description Deploy a shiny application from github
#' @param debug_level See check() for details
check = function(debug_level) {
private$checker(deploy_git(
repository = "https://github.com/uat-examples/old-faithful",
debug_level = debug_level,
title = paste("UAT", private$short)
))
private$checker(
deploy_git(
repository = "https://github.com/uat-examples/old-faithful",
debug_level = debug_level,
title = paste("UAT", private$short)
),
debug_level
)
invisible(NULL)
}
),
Expand Down
2 changes: 1 addition & 1 deletion R/deploy_pins-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ check_deploy_pins_rds = R6::R6Class(
#' @description Checks a pin can be written, read and deleted
#' @param debug_level See check() for details
check = function(debug_level) {
private$checker(deploy_pins(debug_level = debug_level))
private$checker(deploy_pins(debug_level = debug_level), debug_level)
invisible(NULL)
}
),
Expand Down
5 changes: 4 additions & 1 deletion R/deploy_plumber-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ check_deploy_plumber_api = R6::R6Class(
package = "audit.connect",
mustWork = TRUE
)
private$checker(deploy_plumber(plumber_dir, debug_level = debug_level))
private$checker(
deploy_plumber(plumber_dir, debug_level = debug_level),
debug_level
)
invisible(NULL)
}
),
Expand Down
3 changes: 2 additions & 1 deletion R/deploy_python.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ cleanup_python = function(tmp_dir, debug_level, guid = NULL) {
suppress = get_suppress(debug_level)
fs::dir_delete(tmp_dir)
# map in case we make multiple mistakes
con = suppress(
# fmt: skip
con = suppress( # nolint
connectapi::connect(
server = get_server(),
api_key = get_token()
Expand Down
10 changes: 6 additions & 4 deletions R/deploy_quarto-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ for (i in seq_along(types)) {
mustWork = TRUE
)
private$checker(
deploy_quarto(quarto_dir, account, debug_level = debug_level)
deploy_quarto(quarto_dir, account, debug_level = debug_level),
debug_level
)

return(invisible(NULL))
invisible(NULL)
}
),
private = list(
Expand Down Expand Up @@ -79,9 +80,10 @@ check_deploy_quarto_python = R6::R6Class(
python_files = "index.qmd",
rsconnect_type = "quarto",
debug_level = debug_level
)
),
debug_level
)
return(invisible(NULL))
invisible(NULL)
}
),
private = list(
Expand Down
2 changes: 1 addition & 1 deletion R/deploy_quarto.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ deploy_quarto = function(
forceUpdate = TRUE,
logLevel = "quiet"
))
return(invisible(has_deployed))
invisible(has_deployed)
}

cleanup_quarto = function(tmp_dir, debug_level) {
Expand Down
3 changes: 2 additions & 1 deletion R/deploy_rmd-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ for (type in types) {
mustWork = TRUE
)
private$checker(
deploy_app(rmd_dir, debug_level = debug_level)
deploy_app(rmd_dir, debug_level = debug_level),
debug_level
)

invisible(NULL)
Expand Down
5 changes: 4 additions & 1 deletion R/deploy_shiny-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ check_deploy_shiny = R6::R6Class(
package = "audit.connect",
mustWork = TRUE
)
private$checker(deploy_app(shiny_dir, debug_level, appFiles = "app.R"))
private$checker(
deploy_app(shiny_dir, debug_level, appFiles = "app.R"),
debug_level
)
invisible(NULL)
}
),
Expand Down
15 changes: 9 additions & 6 deletions R/deploy_streamlit-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ check_deploy_python_streamlit = R6::R6Class(
package = "audit.connect",
mustWork = TRUE
)
private$checker(deploy_python(
python_dir,
python_files = "app.py",
rsconnect_type = "streamlit",
debug_level = debug_level
))
private$checker(
deploy_python(
python_dir,
python_files = "app.py",
rsconnect_type = "streamlit",
debug_level = debug_level
),
debug_level
)
invisible(NULL)
}
),
Expand Down
5 changes: 3 additions & 2 deletions R/summarise_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ check_rsconnect_python = function() {
"rsconnect_python",
as.logical(nchar(Sys.which("rsconnect")) > 0)
)
sym = ifelse(
# fmt: skip
sym = ifelse( #nolint
value,
cli::col_green(cli::symbol$tick),
cli::col_red(cli::symbol$cross)
) #nolint
)
cli::cli_alert_info("rsconnect-python: {sym}")
if (isFALSE(value)) {
cli::cli_alert_warning("rsconnect-python not installed")
Expand Down
13 changes: 7 additions & 6 deletions R/summarise_users.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ print_audit_users = function(user_list) {
sep = ": "
)
user_string = paste(user_vec, collapse = ", ") # nolint: object_usage_linter
admins = dplyr::filter(
# fmt: skip
admins = dplyr::filter( # nolint: object_usage_linter
user_list$users,
.data$user_role == "administrator" & !.data$locked
) # nolint: object_usage_linter
)

cli::cli_alert_info(
"Users: {sum(user_summary$n)} out of {user_list$user_account_limit}"
Expand All @@ -58,15 +59,15 @@ print_audit_users = function(user_list) {
print_audit_user_apps = function(client, debug_level) {
suppress = get_suppress(debug_level)
content = suppress(connectapi::get_content(client))
locked_users = suppress(connectapi::get_users(client)) |>
locked_users = suppress(connectapi::get_users(client)) %>%
dplyr::filter(.data$locked)
locked_content = dplyr::inner_join(
content,
locked_users,
by = dplyr::join_by("owner_guid" == "guid")
) |>
dplyr::group_by(.data$username) |>
dplyr::summarise(n = dplyr::n()) |>
) %>%
dplyr::group_by(.data$username) %>%
dplyr::summarise(n = dplyr::n()) %>%
dplyr::arrange(dplyr::desc(.data$n))

cli::cli_alert_info(
Expand Down
10 changes: 5 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Alternatively, you can set environmental variables, `CONNECT_SERVER` and `CONNEC

## Connect Package Pollution

If you are running this package on a machine you normally use to deploy to Connect, then
If you are running this package on a machine you normally use to deploy to Connect, then
this isn't an issue - you can skip the next part.

**If** you are using a machine where you are deploying to Connect for the
Expand All @@ -58,8 +58,8 @@ Connect package pollution occurs when

* we use package manager binaries, **and**
* the OS on Connect differs to the OS on the deployment machine.
If you aren't using binaries or the OS is the same, then you won't have any issue.

If you aren't using binaries or the OS is the same, then you won't have any issue.
If you want to be sure, we can use {renv}

```{r, eval = FALSE}
Expand Down Expand Up @@ -97,8 +97,8 @@ check_example = R6::R6Class(
# This runs the test, detects errors, and logs the result
public = list(
#' @description Runs a UAT check
check = function(account = NULL) {
private$checker(example_test())
check = function(debug_level) {
private$checker(example_test(), debug_level)
return(invisible(NULL))
}
),
Expand Down
Empty file added air.toml
Empty file.
Loading