Skip to content

Commit

Permalink
Merge pull request #144 from hubverse-org/ak/downgrade-missing-metdat…
Browse files Browse the repository at this point in the history
…a-severity/138
annakrystalli authored Oct 30, 2024
2 parents 5c83952 + 2f94d14 commit b40c5bd
Showing 9 changed files with 718 additions and 178 deletions.
2 changes: 1 addition & 1 deletion R/check_submission_metadata_file_exists.R
Original file line number Diff line number Diff line change
@@ -38,6 +38,6 @@ check_submission_metadata_file_exists <- function(file_path, hub_path = ".") {
msg_subject = "Metadata file",
msg_attribute = msg_attribute,
msg_verbs = c("exists", "does not exist"),
error = TRUE
error = FALSE
)
}
3 changes: 0 additions & 3 deletions R/validate_model_file.R
Original file line number Diff line number Diff line change
@@ -91,9 +91,6 @@ validate_model_file <- function(hub_path, file_path,
file_path = file_path
), file_path
)
if (is_any_error(checks$metadata_exists)) {
return(checks)
}

custom_checks <- execute_custom_checks(validations_cfg_path = validations_cfg_path)
checks <- combine(checks, custom_checks)
2 changes: 1 addition & 1 deletion inst/check_table.csv
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ file_name,File name valid,TRUE,check_error,validate_model_file,check_file_name,,
file_location,File located in correct team directory,FALSE,check_failure,validate_model_file,check_file_location,,FALSE
round_id_valid,File round ID is valid hub round IDs,TRUE,check_error,validate_model_file,check_valid_round_id,,FALSE
file_format,File format is accepted hub/round format,TRUE,check_error,validate_model_file,check_file_format,,FALSE
metadata_exists,Model metadata file exists in expected location,TRUE,check_error,validate_model_file,check_submission_metadata_file_exists,,FALSE
metadata_exists,Model metadata file exists in expected location,FALSE,check_failure,validate_model_file,check_submission_metadata_file_exists,,FALSE
file_read,File can be read without errors,TRUE,check_error,validate_model_data,check_file_read,,FALSE
valid_round_id_col,Round ID var from config exists in data column names. Skipped if `round_id_from_var` is FALSE in config.,FALSE,check_failure,validate_model_data,check_valid_round_id_col,,FALSE
unique_round_id,Round ID column contains a single unique round ID. Skipped if `round_id_from_var` is FALSE in config.,TRUE,check_error,validate_model_data,check_tbl_unique_round_id,,FALSE
4 changes: 2 additions & 2 deletions man/validate_model_file.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/validate_pr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/validate_submission.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
Code
check_submission_metadata_file_exists(hub_path = hub_path, file_path = "random-model/2022-10-01-random-model.csv")
Output
<error/check_error>
<error/check_failure>
Error:
! Metadata file does not exist at path 'model-metadata/random-model.yml' or 'model-metadata/random-model.yaml'.

867 changes: 701 additions & 166 deletions tests/testthat/_snaps/validate_pr.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions tests/testthat/test-validate_pr.R
Original file line number Diff line number Diff line change
@@ -63,6 +63,10 @@ test_that("validate_pr flags modifications and deletions in PR", {
branch = "test-mod-del"
)

# This checks that removed metadata and model-output files are detected and
# flagged as check errors.
# It also checks that missing metadata files do not cause early return
# of submission validation of model output file.
mod_checks_error <- suppressMessages(
validate_pr(
hub_path = temp_hub,
@@ -90,6 +94,10 @@ test_that("validate_pr flags modifications and deletions in PR", {
)
)

# This checks that removed metadata and model-output files are detected and
# flagged as check failure.
# It also checks that missing metadata files do not cause early return
# of submission validation of model output file.
mod_checks_warn <- suppressMessages(
validate_pr(
hub_path = temp_hub,

0 comments on commit b40c5bd

Please sign in to comment.