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

Comparing changes on demo-shinyserver-v310 #811

Draft
wants to merge 9 commits into
base: demo-shinyapps.io-v310
Choose a base branch
from
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ auto_decisions.json
docs/
*.sqlite
!*demo.sqlite
tarballs/
report_preferences/
.Renviron
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 @@ -218,8 +218,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 @@ -243,8 +245,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
8 changes: 2 additions & 6 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ riskassessment::run_app(
"<em>Note:</em><br>
Use the following credentials to log on with varying roles & privileges in the app, expanded upon <a href='https://pharmar.github.io/riskassessment/articles/User_Roles_and_Privileges.html#roles' target='_blank'>here</a>:
<br><br>
U: <span style='text-transform:none;'><u>demo_admin</u></span>; &nbsp;&nbsp;&nbsp; P: <u><span style='text-transform:none;'>Admin@1</span></u>
<br>
U: <span style='text-transform:none;'><u>demo_lead</u></span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; P: <u><span style='text-transform:none;'>Lead@1</span></u>
<br>
U: <span style='text-transform:none;'><u>demo_reviewer</u></span>; P: <u><span style='text-transform:none;'>Reviewer@1</span></u>
U: <span style='text-transform:none;'><u>pkg_reviewer</u></span>; P: <u><span style='text-transform:none;'>Reviewer@1</span></u>
<br>
U: <span style='text-transform:none;'><u>demo_viewer</u></span>; &nbsp;&nbsp; P: <u><span style='text-transform:none;'>Viewer@1</span></u>")
U: <span style='text-transform:none;'><u>pkg_viewer</u></span>; &nbsp;&nbsp; P: <u><span style='text-transform:none;'>Viewer@1</span></u>")
)
Binary file modified credentials_demo.sqlite
Binary file not shown.
Binary file modified database_demo.sqlite
Binary file not shown.
19 changes: 2 additions & 17 deletions inst/db-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ default:
- viewer
privileges:
admin: [admin, weight_adjust, auto_decision_adjust, final_decision, revert_decision, add_package, delete_package, overall_comment, general_comment]
lead: [weight_adjust, auto_decision_adjust, final_decision, revert_decision, add_package, delete_package, overall_comment, general_comment]
lead: [final_decision, revert_decision, add_package, delete_package, overall_comment, general_comment]
reviewer: [add_package, general_comment]
viewer:
decisions:
categories:
- Low Risk
- Undecided
- Medium Risk
- High Risk
example:
Expand Down Expand Up @@ -78,22 +79,6 @@ demo:
credential_db: credentials_demo.sqlite
metric_weights:
covr_coverage: 0
decisions:
rules:
rule_1:
metric: bugs_status
condition: ~ metric_score(.x) <= .25
decision: High Risk
rule_2:
metric: dependencies
condition: ~ length(.x) >= 30
decision: High Risk
Medium Risk:
- .3983
- .6391
High Risk:
- .6391
- 1
noncredentialed:
use_shinymanager: false
assessment_db: database_noncredentialed.sqlite
Expand Down
Loading
Loading