Skip to content

Fix pkg length checks, cached summary flag, and sitrep github-ref - #911

Open
sims1253 wants to merge 3 commits into
r-lib:mainfrom
sims1253:fix/ry-audit-round2
Open

sims1253 wants to merge 3 commits into
r-lib:mainfrom
sims1253:fix/ry-audit-round2

Conversation

@sims1253

@sims1253 sims1253 commented Sep 9, 2026

Copy link
Copy Markdown

Scalar pkg check

pkg_status() and pkg_deps_tree() in R/package.R and pkg_deps_explain() in R/deps-explain.R guarded pkg with:

stopifnot(length(pkg == 1) && is.character(pkg))

pkg == 1 compares elementwise, so length(pkg == 1) is 1 for every non-empty input. The guard rejected only the empty vector, and calls like pkg_status(c("rlang", "cli")) passed it.

Dead cached summary branch

print_install_details() in R/confirmation.R computed:

u_dl <- sum(is.na(sol$filesize[w_dl]))
any_unk <- length(u_dl) > 0

u_dl is a sum(), so it always has length 1. length(u_dl) > 0 was therefore always TRUE, and the !any_unk branch that prints download and cached counts in a single line never ran.

Missing github-ref sitrep entry

pak_sitrep_data() in R/pak-sitrep-data.R built its list with:

"github-ref" <- Sys.getenv("GITHUB_REF", "-"),

<- inside list() does not name the element, so the sitrep data carried github-repository and github-sha but no github-ref.

Found during my most recent ry audit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant