fix: audit workflows
Some checks failed
ci/crow/manual/weekly-audit-missing-alpine-322-arm64 Pipeline failed

This commit is contained in:
Patrick Schratz 2026-04-21 20:30:33 +02:00
commit 7c9a82187d
Signed by: pat-s
GPG key ID: 3C6318841EF78925
2 changed files with 32 additions and 9 deletions

View file

@ -20,6 +20,8 @@ steps:
from_secret: REPO_RO_TOKEN from_secret: REPO_RO_TOKEN
GITHUB_PAT: GITHUB_PAT:
from_secret: GITHUB_PAT from_secret: GITHUB_PAT
FORGEJO_TOKEN:
from_secret: FORGEJO_TOKEN
PLATFORM: alpine-322 PLATFORM: alpine-322
ARCH: arm64 ARCH: arm64
R_LIBS_USER: /mnt/cache/R-pkgs R_LIBS_USER: /mnt/cache/R-pkgs

View file

@ -118,7 +118,8 @@ if (file.exists(excluded_path)) {
# 5. Query PostgreSQL for known build failures # 5. Query PostgreSQL for known build failures
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
cat("Connecting to PostgreSQL...\n") cat("Connecting to PostgreSQL...\n")
con <- DBI::dbConnect( pg_connect <- function() {
DBI::dbConnect(
RPostgres::Postgres(), RPostgres::Postgres(),
dbname = "build_metadata", dbname = "build_metadata",
host = "r-binaries.devxy.io", host = "r-binaries.devxy.io",
@ -126,7 +127,27 @@ con <- DBI::dbConnect(
user = "rpkgs", user = "rpkgs",
password = Sys.getenv("PGPASS"), password = Sys.getenv("PGPASS"),
sslmode = "require" sslmode = "require"
) )
}
con <- NULL
for (attempt in seq_len(3)) {
con <- tryCatch(pg_connect(), error = function(e) NULL)
if (!is.null(con) && DBI::dbIsValid(con)) {
tryCatch({
DBI::dbGetQuery(con, "SELECT 1")
break
}, error = function(e) {
try(DBI::dbDisconnect(con), silent = TRUE)
con <<- NULL
})
}
if (attempt < 3) {
cat(sprintf("PostgreSQL connection attempt %d failed, retrying...\n", attempt))
Sys.sleep(2 * attempt)
}
}
if (is.null(con) || !DBI::dbIsValid(con)) stop("Failed to connect to PostgreSQL after 3 attempts")
on.exit(DBI::dbDisconnect(con), add = TRUE) on.exit(DBI::dbDisconnect(con), add = TRUE)
errored_pkgs <- DBI::dbGetQuery( errored_pkgs <- DBI::dbGetQuery(