Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update shinyapps.io demo with a few more features (v3.1.1.9002) #831

Merged
merged 26 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1c4451e
Remove evaluation recording from riskmetric assessments
jthompson-arcus Aug 2, 2024
243754e
Merge branch 'dev' into jt-rm_with_eval_recording
jthompson-arcus Aug 5, 2024
dcb0728
Update NEWS
jthompson-arcus Aug 5, 2024
3148426
Merge pull request #810 from pharmaR/jt-rm_with_eval_recording
aclark02-arcus Aug 5, 2024
db35932
Check for tarball directory before returning from `initialize_raa()`
jthompson-arcus Aug 5, 2024
7ab8821
Update NEWS
jthompson-arcus Aug 5, 2024
1265f76
Re-build manifest file
actions-user Aug 5, 2024
b04110a
Merge pull request #813 from pharmaR/jt-tarball_directory_creation
aclark02-arcus Aug 5, 2024
f6c133c
Increment version number to 3.1.1.9000
aclark02-arcus Aug 5, 2024
90d06d4
Add `target="_blank"` to hyperlink
jthompson-arcus Jan 9, 2025
3994373
Update version and NEWS
jthompson-arcus Jan 9, 2025
16ebe96
Update pkg_explorer.md
jthompson-arcus Jan 9, 2025
b44c684
Ignore temporary testing files
jthompson-arcus Jan 9, 2025
5973a39
Use renv repo in R CMD check
jthompson-arcus Jan 9, 2025
e5787bd
Standardize window size for snapshots
jthompson-arcus Jan 9, 2025
9b84423
Re-build manifest file
actions-user Jan 9, 2025
d0a92d4
Re-build manifest file
actions-user Jan 10, 2025
6cb226f
Open new tabs for hyperlinks in HTML reports
jthompson-arcus Jan 10, 2025
d323319
Merge branch 'jt-card_url_new_tab' of github.com:pharmaR/riskassessme…
jthompson-arcus Jan 10, 2025
350b568
Re-build manifest file
actions-user Jan 10, 2025
ce8b196
Merge pull request #828 from pharmaR/jt-card_url_new_tab
aclark02-arcus Jan 10, 2025
630d030
Only setup `fn` if `rule$mapper` is a function or formula
jthompson-arcus Jan 16, 2025
6c40270
Update version & NEWS
jthompson-arcus Jan 16, 2025
a3e6ff0
Update pkgdown.yaml
jthompson-arcus Jan 16, 2025
175ccb1
Re-build manifest file
actions-user Jan 16, 2025
40520d9
Merge pull request #829 from pharmaR/jt-fix_else_cond_bug
aclark02-arcus Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'renv'
use-public-rspm: true
use-public-rspm: false
- uses: r-lib/actions/setup-renv@v2

- name: Install riskassessment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
use-public-rspm: false
r-version: 'renv'

- uses: r-lib/actions/setup-renv@v2
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: riskassessment
Title: A web app designed to interface with the `riskmetric` package
Version: 3.1.1
Version: 3.1.1.9002
Authors@R: c(
person("Aaron", "Clark", role = c("aut", "cre"), email = "clark.aaronchris@gmail.com"),
person("Jeff", "Thompson", role = c("aut"), email = "jeff.thompson51317@gmail.com", comment = "Co-Lead"),
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# riskassessment (development version)

* Open hyperlinks in a new tab from cards.
* Fix bug causing app to crash with ELSE condition in rules

# riskassessment 3.1.1

* Added navigation controls in Function Explorer tab (#644)
* Fixed bug that crashed the Package Dependencies page for pkgs without any dependency info available (#802)
* Fixed bug that incorrectly displayed 0 dependencies as 1 (#805)
* Fixed bug that kept full list of available packages from populating (#776)
* Removed `.recording` attribute from `riskmetric` assessments for storage purposes
* Ensured `tarballs` directory existed before returning from `initialize_raa()`

# riskassessment 3.1.0

Expand Down
3 changes: 2 additions & 1 deletion R/mod_decision_automation_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ assign_decisions <- function(rule_list, package, db_name = golem::get_golem_opti
if (!is.na(decision)) break
rule <- rule_list[[i]]

fn <- purrr::possibly(rule$mapper, otherwise = FALSE)
if (rlang::is_function(rule$mapper) || rlang::is_formula(rule$mapper))
fn <- purrr::possibly(rule$mapper, otherwise = FALSE)
if (rule$type == "overall_score") {
decision <- if (fn(get_pkg_info(package)$score)) rule$decision else NA_character_
log_message <- glue::glue("Decision for the package {package} was assigned {decision} because the risk score returned TRUE for `{rule$condition}`")
Expand Down
2 changes: 1 addition & 1 deletion R/mod_metricBox.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ metricBoxServer <- function(id, title, desc, value, score = "NULL",
} else if (is_url) {
value <- a(ifelse(nchar(value) <= val_max_nchar, value,
glue::glue("{stringr::str_sub(value, 1, (val_max_nchar - 3))}...")
), href = value)
), target = "_blank", href = value)
} # unfortunately, adding the href can sometimes force the footer to fall
# outside the card when val_max_nchar is too large.
else if (value %in% c("TRUE", "FALSE")) {
Expand Down
15 changes: 14 additions & 1 deletion R/utils_insert_db.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,20 @@ insert_riskmetric_to_db <- function(pkg_name, pkg_version = "",
loggit::loggit("WARN", paste("Package", pkg_name, "not found."))
return()
}


riskmetric_assess <-
lapply(riskmetric_assess[-(1:3)], \(x) {
out <-
list(
structure(
x[[1]],
.recording = NULL,
class = setdiff(class(x[[1]]), "with_eval_recording")
)
)
attributes(out) <- attributes(x)
out
})
assessment_serialized <- data.frame(pkg_assess = I(lapply(riskmetric_assess, serialize, connection = NULL)))

# Insert all the metrics (columns of class "pkg_score") into the db.
Expand Down
8 changes: 4 additions & 4 deletions R/utils_startup.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ initialize_raa <- function(assess_db, cred_db, configuration) {

check_repos(db_config[["package_repo"]])

if (file.exists(assessment_db) && (isTRUE(getOption("shiny.testmode")) || use_shinymanager && file.exists(credentials_db)))
return(invisible(c(assessment_db, if (!isTRUE(getOption("shiny.testmode")) & use_shinymanager) credentials_db)))
if (!dir.exists("tarballs")) dir.create("tarballs")

if (file.exists(assessment_db) && (use_shinymanager && file.exists(credentials_db)))
return(invisible(c(assessment_db, if (use_shinymanager) credentials_db)))

check_credentials(db_config[["credentials"]])

Expand All @@ -242,8 +244,6 @@ initialize_raa <- function(assess_db, cred_db, configuration) {
} else if (!identical(decisions$decision, decision_categories)) {
stop("The decision categories in the configuration file do not match those in the assessment database.")
}

if (!dir.exists("tarballs")) dir.create("tarballs")

invisible(c(assessment_db, if (use_shinymanager) credentials_db))
}
Expand Down
2 changes: 1 addition & 1 deletion inst/report_downloads/reportHtml.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ createCard <- function(title, desc, value, score = "NULL",
else if(is_url)
value <- a(ifelse(nchar(value) <= val_max_nchar, value,
glue::glue('{stringr::str_sub(value, 1, (val_max_nchar - 3))}...')
), href = value)
), target = "_blank", href = value)
# unfortunately, adding the href can sometimes force the footer to fall
# outside the card when val_max_nchar is too large.
else if(value %in% c('TRUE', 'FALSE'))
Expand Down
Loading
Loading