Skip to content

Commit

Permalink
filter on x86 only
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rodrigues committed Mar 3, 2025
1 parent 91f0c82 commit 274b5f5
Showing 1 changed file with 97 additions and 51 deletions.
148 changes: 97 additions & 51 deletions _targets.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
library(targets)
library(tarchetypes)

tar_option_set(packages = c(
"jsonlite",
"rvest"
))
tar_option_set(
packages = c(
"jsonlite",
"rvest"
)
)

source("functions.R")

Expand All @@ -26,7 +28,9 @@ list(
html_table(
html_nodes(
evaluations_tables,
"[class = 'table table-condensed table-striped clickable-rows']"))[[1]] |>
"[class = 'table table-condensed table-striped clickable-rows']"
)
)[[1]] |>
subset(Date != "Date", select = `#`)
}
),
Expand All @@ -38,27 +42,38 @@ list(

tar_target(
last_jobset_still_fail_url,
paste0("https://hydra.vk3.wtf/eval/", last_evaluation, "?full=1#tabs-still-fail")
paste0(
"https://hydra.vk3.wtf/eval/",
last_evaluation,
"?full=1#tabs-still-fail#filter=x86"
)
),

tar_target(
last_jobset_now_fail_url,
paste0("https://hydra.vk3.wtf/eval/", last_evaluation, "?full=1#tabs-now-fail")
paste0(
"https://hydra.vk3.wtf/eval/",
last_evaluation,
"?full=1#tabs-now-fail#filter=x86"
)
),

tar_target(
still_failing_jobs_html,
read_html(last_jobset_still_fail_url)
),

tar_target(
tar_target(
now_failing_jobs_html,
read_html(last_jobset_now_fail_url)
),

tar_target(
still_failing_jobs_raw,
html_table(html_nodes(still_failing_jobs_html, "[id = 'tabs-still-fail']"))[[1]]
html_table(html_nodes(
still_failing_jobs_html,
"[id = 'tabs-still-fail']"
))[[1]]
),

tar_target(
Expand All @@ -73,33 +88,45 @@ list(

tar_target(
failing_jobs_raw_clean,
subset(failing_jobs_raw,
subset =!grepl("builds omitted", System),
select = c("#", "Finished at", "Package/release name", "System")) |>
transform(packages = gsub("^r-", "", `Package/release name`)) |>
transform(packages = gsub("-.*$", "", packages)) |>
transform(build = paste0("https://hydra.vk3.wtf/build/", "#")) |>
transform(`Finished at` = convert_hours_days(`Finished at`))
subset(
failing_jobs_raw,
subset = !grepl("builds omitted", System),
select = c("#", "Finished at", "Package/release name", "System")
) |>
transform(packages = gsub("^r-", "", `Package/release name`)) |>
transform(packages = gsub("-.*$", "", packages)) |>
transform(build = paste0("https://hydra.vk3.wtf/build/", "#")) |>
transform(`Finished at` = convert_hours_days(`Finished at`))
),

tar_target(
failing_jobs_with_deps,
transform(failing_jobs_raw_clean,
fails_because_of = sapply(build, safe_get_failed_dep)) |>
transform(fails_because_of =
ifelse(
grepl("Build of .nix.store", fails_because_of),
"",
fails_because_of)
) |>
transform(fails_because_of =
ifelse(fails_because_of == "", packages, fails_because_of))
transform(
failing_jobs_raw_clean,
fails_because_of = sapply(build, safe_get_failed_dep)
) |>
transform(
fails_because_of = ifelse(
grepl("Build of .nix.store", fails_because_of),
"",
fails_because_of
)
) |>
transform(
fails_because_of = ifelse(
fails_because_of == "",
packages,
fails_because_of
)
)
),

tar_target(
failing_jobs,
transform(failing_jobs_with_deps,
build = paste0('<a href="', build, '">', build, '</a>'))
transform(
failing_jobs_with_deps,
build = paste0('<a href="', build, '">', build, '</a>')
)
),

tar_target(
Expand All @@ -115,7 +142,7 @@ list(
tar_target(
packages_df_with_rank,
safe_packageRank(packages = unique_packages) |>
subset(select = c(-date, -total.downloads, -total.packages, -downloads))
subset(select = c(-date, -total.downloads, -total.packages, -downloads))
),

tar_target(
Expand All @@ -133,13 +160,12 @@ list(
tar_target(
open_prs_raw,
fromJSON(open_prs_file) |>
subset(subset = grepl("r(p|P)ackages", title))
subset(subset = grepl("r(p|P)ackages", title))
),

tar_target(
merged_prs_raw,
subset(fromJSON(merged_prs_file),
subset = grepl("r(p|P)ackages", title))
subset(fromJSON(merged_prs_file), subset = grepl("r(p|P)ackages", title))
),

tar_target(
Expand All @@ -155,19 +181,18 @@ list(
tar_target(
prs_df,
rbind(open_prs, merged_prs) |>
subset(#subset = state != "merged",
select = c("fails_because_of", "PR", "PR_date", "state"),
PR_date > as.Date("2024-05-10") # change this date manually to avoid having
# merged PRs listed from old fixes. This happens
# if packages fail again
)
subset(
#subset = state != "merged",
select = c("fails_because_of", "PR", "PR_date", "state"),
PR_date > as.Date("2024-05-10") # change this date manually to avoid having
# merged PRs listed from old fixes. This happens
# if packages fail again
)
),

tar_target(
failing_jobs_with_prs,
merge(failing_jobs,
prs_df,
all.x = TRUE)
merge(failing_jobs, prs_df, all.x = TRUE)
),

# Bioconductor rank
Expand All @@ -180,35 +205,56 @@ list(
tar_target(
bioc_pkg_scores.tab,
read.csv(bioc_pkg_scores.tab_path, sep = "\t") |>
subset(Package != "monocle")
subset(Package != "monocle")
),

tar_target(
bioc_pkg_failing,
bioc_pkg_scores.tab |>
subset(subset = (Package %in% unique_packages)) |>
transform(fails_because_of = Package,
rank = Download_score) |>
subset(select = c(fails_because_of, rank))
subset(subset = (Package %in% unique_packages)) |>
transform(fails_because_of = Package, rank = Download_score) |>
subset(select = c(fails_because_of, rank))
),

tar_target(
final_results,
merge(failing_jobs_with_prs, packages_df_with_rank) |>
subset(select = c(packages, fails_because_of, `Finished at`, System,
build, rank, percentile, PR, PR_date, state))
subset(
select = c(
packages,
fails_because_of,
`Finished at`,
System,
build,
rank,
percentile,
PR,
PR_date,
state
)
)
),

tar_target(
final_results_bioc,
merge(failing_jobs_with_prs, bioc_pkg_failing) |>
subset(select = c(packages, fails_because_of, `Finished at`, System,
build, rank, PR, PR_date, state))
subset(
select = c(
packages,
fails_because_of,
`Finished at`,
System,
build,
rank,
PR,
PR_date,
state
)
)
),

tar_render(
name = paper,
path = "r-updates-fails.Rmd"
)

)

0 comments on commit 274b5f5

Please sign in to comment.