Skip to content

Commit

Permalink
utils: display warning messages about REANA spec validation
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppe-steduto committed Aug 31, 2023
1 parent 5fc10fb commit 15a01ad
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changes
Version 0.9.1 (UNRELEASED)
--------------------------

- Changes ``validate`` command to display non-critical validation warnings when checking the REANA specification file.
- Adds ``prune`` command to delete all intermediate files of a given workflow.
- Fixes ``list`` command to correctly list workflows when sorting them by their run number or by the size of their workspace.
- Fixes ``du`` command help message typo.
Expand Down
39 changes: 33 additions & 6 deletions reana_client/validation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,39 @@ def validate_reana_spec(
f"Verifying REANA specification file... {filepath}",
msg_type="info",
)
validate_reana_yaml(reana_yaml)
display_message(
"Valid REANA specification file.",
msg_type="success",
indented=True,
)
validation_warnings = validate_reana_yaml(reana_yaml)
if validation_warnings:
display_message(
"The REANA specification appears valid, but some warnings were found.",
msg_type="warning",
indented=True,
)
for warning_key, warning_value in validation_warnings.items():
if warning_key == "additional_properties":
# warning_values is a list of unexpected properties
message = (
f"Unexpected properties found in REANA specification file: "
f"{', '.join(warning_value)}"
)
else:
message = warning_value
display_message(
message,
msg_type="warning",
indented=True,
)
if validation_warnings:
display_message(
"Please make sure that the REANA specification file is correct.",
msg_type="warning",
indented=True,
)
else:
display_message(
"Valid REANA specification file.",
msg_type="success",
indented=True,
)

validate_parameters(reana_yaml)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"click>=7",
"pathspec==0.9.0",
"jsonpointer>=2.0",
"reana-commons[yadage,snakemake,cwl]>=0.9.3a4,<0.10.0",
"reana-commons[yadage,snakemake,cwl]>=0.9.3a5,<0.10.0",
"tablib>=0.12.1,<0.13",
"werkzeug>=0.14.1 ; python_version<'3.10'",
"werkzeug>=0.15.0 ; python_version>='3.10'",
Expand Down

0 comments on commit 15a01ad

Please sign in to comment.