fix: audit workflows
Some checks failed
ci/crow/manual/weekly-rebuild-missing-alpine-322-arm64 Pipeline failed
Some checks failed
ci/crow/manual/weekly-rebuild-missing-alpine-322-arm64 Pipeline failed
This commit is contained in:
parent
dfad39ebf1
commit
d0a243a1dc
1 changed files with 49 additions and 295 deletions
|
|
@ -38,7 +38,38 @@ cat(sprintf("Platform: %s | Arch: %s | S3 codename: %s | OS family: %s\n",
|
|||
platform, arch, s3_codename, os_family))
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 1. CRAN release packages
|
||||
# 1. Query PostgreSQL for known build failures (before s3fs init to avoid
|
||||
# C++ pointer conflicts between s3fs/curl and RPostgres/libpq)
|
||||
# ---------------------------------------------------------------------------
|
||||
cat("Connecting to PostgreSQL...\n")
|
||||
con <- DBI::dbConnect(
|
||||
RPostgres::Postgres(),
|
||||
dbname = "build_metadata",
|
||||
host = "r-binaries.devxy.io",
|
||||
port = 15432,
|
||||
user = "rpkgs",
|
||||
password = Sys.getenv("PGPASS"),
|
||||
sslmode = "require"
|
||||
)
|
||||
|
||||
errored_pkgs <- DBI::dbGetQuery(
|
||||
con,
|
||||
sprintf(
|
||||
"SELECT name, tag FROM single_builds WHERE error_occurred = TRUE AND platform = '%s' AND arch = '%s'",
|
||||
platform, arch
|
||||
)
|
||||
)
|
||||
DBI::dbDisconnect(con)
|
||||
|
||||
errored_dt <- as.data.table(errored_pkgs)
|
||||
if (nrow(errored_dt) > 0) {
|
||||
setnames(errored_dt, c("Package", "Version"))
|
||||
setkey(errored_dt, Package, Version)
|
||||
}
|
||||
cat(sprintf("Found %d known build failures for %s/%s\n", nrow(errored_dt), platform, arch))
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 2. CRAN release packages (uses curl internally - must come after PG)
|
||||
# ---------------------------------------------------------------------------
|
||||
cat("Fetching CRAN package database...\n")
|
||||
cran_release <- tools::CRAN_package_db()
|
||||
|
|
@ -48,7 +79,7 @@ cran_dt <- data.table(
|
|||
)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 2. S3 tarballs
|
||||
# 3. S3 tarballs
|
||||
# ---------------------------------------------------------------------------
|
||||
cat("Connecting to S3...\n")
|
||||
s3fs::s3_file_system(
|
||||
|
|
@ -82,7 +113,7 @@ s3_dt <- data.table(
|
|||
cat(sprintf("S3 contains %d tarballs for %s/%s\n", nrow(s3_dt), arch, s3_codename))
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 3. Find missing packages (CRAN release version not in S3)
|
||||
# 4. Find missing packages (CRAN release version not in S3)
|
||||
# ---------------------------------------------------------------------------
|
||||
setkey(cran_dt, Package, Version)
|
||||
setkey(s3_dt, Package, Version)
|
||||
|
|
@ -90,7 +121,7 @@ missing_dt <- cran_dt[!s3_dt]
|
|||
cat(sprintf("%d CRAN release packages missing from S3\n", nrow(missing_dt)))
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 4. Remove excluded packages
|
||||
# 5. Remove excluded packages
|
||||
# ---------------------------------------------------------------------------
|
||||
script_dir <- tryCatch(
|
||||
dirname(normalizePath(
|
||||
|
|
@ -114,36 +145,6 @@ if (file.exists(excluded_path)) {
|
|||
cat(sprintf("No excluded-packages.json found at %s -- skipping exclusion step\n", excluded_path))
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 5. Query PostgreSQL for known build failures
|
||||
# ---------------------------------------------------------------------------
|
||||
cat("Connecting to PostgreSQL...\n")
|
||||
con <- DBI::dbConnect(
|
||||
RPostgres::Postgres(),
|
||||
dbname = "build_metadata",
|
||||
host = "r-binaries.devxy.io",
|
||||
port = 15432,
|
||||
user = "rpkgs",
|
||||
password = Sys.getenv("PGPASS"),
|
||||
sslmode = "require"
|
||||
)
|
||||
on.exit(DBI::dbDisconnect(con), add = TRUE)
|
||||
|
||||
errored_pkgs <- DBI::dbGetQuery(
|
||||
con,
|
||||
sprintf(
|
||||
"SELECT name, tag FROM single_builds WHERE error_occurred = TRUE AND platform = '%s' AND arch = '%s'",
|
||||
platform, arch
|
||||
)
|
||||
)
|
||||
errored_dt <- as.data.table(errored_pkgs)
|
||||
if (nrow(errored_dt) > 0) {
|
||||
setnames(errored_dt, c("Package", "Version"))
|
||||
setkey(errored_dt, Package, Version)
|
||||
}
|
||||
|
||||
cat(sprintf("Found %d known build failures for %s/%s\n", nrow(errored_dt), platform, arch))
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 6. Split into rebuildable vs known failures
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue