From 9edd4f9296c9e3c874c23e530f6a9223d8da8ed3 Mon Sep 17 00:00:00 2001 From: Fabrizio Sandri Date: Fri, 29 Jul 2022 08:28:09 +0200 Subject: [PATCH 1/4] input columns removed --- docker/src/analyze_package.R | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docker/src/analyze_package.R b/docker/src/analyze_package.R index 0bae056..138a132 100644 --- a/docker/src/analyze_package.R +++ b/docker/src/analyze_package.R @@ -103,8 +103,8 @@ if (any(errors)) { first_error_table <- error_table[,.SD[1], by=func] # generate the report file - report_table <- data.table(function_name=c(), message=c(), inputs=c(), - file_line=c(), address_trace=c(), R_code=c()) + report_table <- data.table(function_name=c(), message=c(), file_line=c(), + address_trace=c(), R_code=c()) for (i in seq(dim(first_error_table)[1])) { @@ -115,14 +115,11 @@ if (any(errors)) { } message <- first_error_table$logtable[[i]]$message[1] - - inputs_markdown <- getInputsMarkdown(first_error_table$inputs[[i]]) executable_file <- getExecutableFile(first_error_table$inputs[[i]], first_error_table$func[i]) - new_row <- data.table(function_name=first_error_table$func[i], - inputs=inputs_markdown, message=message, - file_line=file_line_link, + new_row <- data.table(function_name=first_error_table$func[i], + message=message, file_line=file_line_link, address_trace=address_trace_link, R_code=executable_file) report_table <- rbind(report_table, new_row) From ba694f18d7d2b01f0fc5c049def2e4a0fbcc5eb0 Mon Sep 17 00:00:00 2001 From: Fabrizio Sandri Date: Fri, 29 Jul 2022 08:28:50 +0200 Subject: [PATCH 2/4] moved the comment identifier at the beginning to avoid truncation --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 060e6b5..065250d 100644 --- a/action.yml +++ b/action.yml @@ -84,7 +84,7 @@ runs: // Find the comment generated by RcppDeepState-action const comment_identifier = "" const action_comment = comments.find(comment => comment.body.includes(comment_identifier)) - const new_comment_body = `## RcppDeepState Report\n${report}\n${comment_identifier}` + const new_comment_body = `${comment_identifier}\n## RcppDeepState Report\n${report}` if (action_comment) { await github.rest.issues.updateComment({ From 08bfaa57ff032ccba37c3edf8bec5d6ec7f9df05 Mon Sep 17 00:00:00 2001 From: Fabrizio Sandri Date: Fri, 29 Jul 2022 08:36:58 +0200 Subject: [PATCH 3/4] dput problem fix, missing collapse parameter --- docker/src/analyze_package.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/src/analyze_package.R b/docker/src/analyze_package.R index 138a132..e08d74d 100644 --- a/docker/src/analyze_package.R +++ b/docker/src/analyze_package.R @@ -71,7 +71,7 @@ getInputsMarkdown <- function(inputList) { # helper function that generates the code for a test given the inputs getExecutableFile <- function(inputs, function_name) { - inputList <- capture.output(dput(inputs)) + inputList <- paste(capture.output(dput(inputs)), collapse="") executable_file <- paste0("testlist <- ", inputList, "
", "result <- do.call(", package_name, "::", function_name, ", testlist)") From 8e3401b3eb7b233e8578131f8055b8a869864287 Mon Sep 17 00:00:00 2001 From: Fabrizio Sandri Date: Fri, 29 Jul 2022 10:52:42 +0200 Subject: [PATCH 4/4] file hyperlink fix --- docker/src/analyze_package.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/src/analyze_package.R b/docker/src/analyze_package.R index e08d74d..8b81efa 100644 --- a/docker/src/analyze_package.R +++ b/docker/src/analyze_package.R @@ -49,11 +49,13 @@ getFunctionName <- function(test_path) { getHyperlink <- function(analyzed_file) { file_ref <- gsub(" ", "", analyzed_file) refs <- unlist(strsplit(file_ref, ":")) - file_hyperlink <- paste(GitHub_server_url, GitHub_repository, "blob", - GitHub_head_ref, location, "src", refs[1], sep="/") + + file_hyperlink <- paste(GitHub_repository, "blob", GitHub_head_ref, location, + "src", refs[1], sep="/") line_hyperlink <- gsub("[/]+", "/", paste0(file_hyperlink, "#L", refs[2])) + final_hyperlink <- paste(GitHub_server_url, line_hyperlink, sep="/") - gh_link <- paste0("[",file_ref,"](",line_hyperlink,")") + gh_link <- paste0("[",file_ref,"](",final_hyperlink,")") } # this function generates a markdown version of an input list