Check whether breaking-changes database entries are stale
Source:R/check_db_staleness.R
check_db_staleness.RdCompares the to_version ceiling and from_version floor of each entry
in the breaking-changes database against the current version of that
package on CRAN. Two types of staleness are detected:
stale_ceiling– the package has released a new version above theto_versionceiling. The window may need extending.stale_floor– the current CRAN version is so far ahead offrom_versionthat the window captures users who are already well past the breaking-change transition. The entry may need closing or thefrom_versionfloor raising.
This function is primarily intended for use by reproducr maintainers
and contributors. It is also run as a scheduled GitHub Actions workflow
on the reproducr repository to automatically open issues when staleness
is detected.
Usage
check_db_staleness(
packages = NULL,
verbose = TRUE,
source = "cran",
from_version_major_threshold = 1L
)Arguments
- packages
characterorNULL. Package names to check. IfNULL(the default), all packages tracked in the breaking-changes database are checked.- verbose
logical(1). Print progress messages. DefaultTRUE.- source
character(1). Where to resolve current package versions. One of:"cran"Query the CRAN package database via
utils::available.packages(). Requires an internet connection."installed"Use locally installed versions via
utils::installed.packages(). Fast and offline, but only reflects what is installed on the current machine.
Default
"cran".- from_version_major_threshold
integer(1)orInf. Number of full major versions the current CRAN release must be ahead offrom_versionbefore the entry is flagged as having a stale floor. Set toInfto disable this check. Default1L.
Value
A data.frame of class c("staleness_report", "data.frame")
with one row per database entry. Columns:
keyThe
pkg::fnkey.pkgPackage name.
fnFunction name.
from_versionThe floor version currently in the database.
to_versionThe ceiling version currently in the database.
current_versionThe current version on CRAN or installed.
statusOne of
"ok","stale_ceiling","stale_floor", or"unknown".gapDescription of the version gap.
NAwhen status is"ok"or"unknown".
Rows are ordered: stale_ceiling first, stale_floor second, then ok, then unknown.
See also
risk_score() which uses the database at runtime;
vignette("contributing-to-the-database") for the database schema and
version window design principles.
Examples
if (FALSE) { # \dontrun{
# Check all tracked packages against CRAN
report <- check_db_staleness()
print(report)
# Check specific packages only
check_db_staleness(packages = c("dplyr", "tidyr"))
# Offline check using installed versions
check_db_staleness(source = "installed")
# Filter to stale entries only
report <- check_db_staleness()
report[report$status != "ok", ]
} # }