@@ -89,6 +89,27 @@ safe_sd <- function(x) {
8989 sd(x , na.rm = TRUE )
9090}
9191
92+ build_workspace_run_url <- function (run_id , group , existing_url = " " ) {
93+ existing_url <- clean_scalar_chr(existing_url )
94+ group <- clean_scalar_chr(group )
95+
96+ base_url <- dplyr :: if_else(
97+ grepl(" ^Batch" , group , ignore.case = TRUE ),
98+ " https://seqera.io/orgs/scidev/workspaces/testing/watch" ,
99+ " https://cloud.dev-seqera.io/orgs/unified-compute/workspaces/sched-testing"
100+ )
101+
102+ has_watch <- grepl(" /watch/?$" , base_url )
103+ run_path <- ifelse(has_watch , paste0(" /" , run_id ), paste0(" /watch/" , run_id ))
104+ fallback_url <- paste0(sub(" /$" , " " , base_url ), run_path )
105+
106+ dplyr :: if_else(
107+ nzchar(existing_url ) & ! grepl(" example\\ .invalid" , existing_url , ignore.case = TRUE ),
108+ existing_url ,
109+ fallback_url
110+ )
111+ }
112+
92113build_cost_table <- function (task_data , merged_logs , aws_cost = NULL , remove_failed_tasks = FALSE ) {
93114 accurate_task_costs <- data.frame ()
94115 run_group_lookup <- merged_logs %> %
@@ -341,7 +362,11 @@ run_costs <- task_data_aug %>%
341362 )
342363
343364workspace_values <- clean_scalar_chr(first_present(merged_logs , c(" workspaceFullName" , " workspaceName" , " workspaceId" ), " " ))
344- platform_urls <- clean_scalar_chr(first_present(merged_logs , c(" runUrl" ), " " ))
365+ platform_urls <- build_workspace_run_url(
366+ run_id = clean_scalar_chr(merged_logs $ run_id ),
367+ group = clean_scalar_chr(merged_logs $ group ),
368+ existing_url = first_present(merged_logs , c(" runUrl" ), " " )
369+ )
345370
346371benchmark_overview <- merged_logs %> %
347372 transmute(
0 commit comments