Skip to contents

Checks network access, the tools webrarian uses, the collection's configuration and its packages. Every problem is collected and reported, and nothing stops the checks early.

Usage

diagnose_collection(path = ".")

Arguments

path

A collection, or any directory inside one. Outside a collection only the network and tool checks run.

Value

Invisibly, a list with ok (FALSE when something would make bind() fail, such as an invalid configuration, local or GitHub packages without a running Docker, or, for a build that bundles its packages (build.bundle-engine, the default, or build.offline), a configured pre-built package that no repository has), problems (a data frame with one row per problem found, warnings included, where severity is "error" or "warning", area is "network", "config", "tools" or "packages", and message says what is wrong), overall ("ok", "warning" or "error"), and the details of each check in network, tools, config and packages.

Examples

# \donttest{
# Probes the webR repository and GitHub; without a network connection those
# checks report the failure and the others still run.
path <- collection_example("basic")
#> ✔ Copied the "basic" example to /tmp/RtmpQU25pJ/webrarian-basic-206b35315011
result <- diagnose_collection(path)
#> 
#> ── Webrarian Diagnostics ───────────────────────────────────────────────────────
#> 
#> ── Network Connectivity ──
#> 
#> ✔ webR Package Repository: OK
#> ✔ GitHub Releases: OK
#> ✔ webR CDN: OK
#> 
#> ── Tool Availability ──
#> 
#> ✔ Docker: running (for custom package compilation)
#> ✔ httpuv: Available (for preview server)
#> 
#> ── Project Configuration ──
#> 
#> ✔ Configuration file: Valid
#> webR version: "0.6.0"
#> Files to include: 3
#> 
#> ── Package Availability ──
#> 
#> ℹ No pre-built packages configured
#> 
#> ── Cache Information ──
#> 
#> ── Webrarian Cache ──
#> 
#> Location: /home/runner/.cache/R/webrarian
#> 
#> ℹ Cache directory does not exist
#> 
#> ── Summary ──
#> 
#> ✔ All checks passed
result$ok
#> [1] TRUE
result$problems[result$problems$severity == "error", ]
#> [1] severity area     message 
#> <0 rows> (or 0-length row.names)
unlink(path, recursive = TRUE)
# }