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

validate: Clarify output messages #441

Merged
merged 3 commits into from
Feb 25, 2020
Merged

Conversation

tsibley
Copy link
Member

@tsibley tsibley commented Feb 10, 2020

Distinguishes between schema validation and internal consistency (e.g.
data) checks and includes filenames in top-level messages so the subject
is clear.

Resolves #440.

Distinguishes between schema validation and internal consistency (e.g.
data) checks and includes filenames in top-level messages so the subject
is clear.

Resolves #440.
@tsibley tsibley force-pushed the validation-clarification branch from c7421dd to a2ab713 Compare February 10, 2020 20:19
Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much improved 👍

Note that during augur export v2, if the call to verifyMainJSONIsInternallyConsistent raises an error, which it can, then we print "Validation of ... failed ..." but the dataset file still remains and the augur command still exits with code 0. This is different from a call to augur validate export-v2 which will return a non-zero exit code. Not sure what's best practice here.

This can happen both because of inconsistent data/config provided by the
user or bugs in Augur.  In either case, the exported JSON is likely not
good and `augur validate v2` would exit with an error code too.
@tsibley
Copy link
Member Author

tsibley commented Feb 10, 2020

Note that during augur export v2, if the call to verifyMainJSONIsInternallyConsistent raises an error, which it can, then we print "Validation of ... failed ..." but the dataset file still remains and the augur command still exits with code 0. This is different from a call to augur validate export-v2 which will return a non-zero exit code. Not sure what's best practice here.

Ah, yeah, thanks for noting that. I was focused on augur validate, not augur export. If a JSON produced by augur export fails internal validation, I think the command should exit with an error status to indicate failure but leave the JSON file as-is for troubleshooting/debugging. Pushed a commit to do so.

…y object

Allows the validation function to know the name of the file for
messaging.
@emmahodcroft
Copy link
Member

@tsibley , sorry for the delay! Thanks for tackling this - it has irked me occasionally that these messages weren't very clear at all, so I think this is a good improvement. It generally looks good to me!

@jameshadfield jameshadfield merged commit 9800528 into master Feb 25, 2020
@jameshadfield jameshadfield deleted the validation-clarification branch February 25, 2020 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

augur validate output isn't easily interpretable
3 participants