-
Notifications
You must be signed in to change notification settings - Fork 124
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
Workflow schema validation errors should include more information #267
Comments
So as it turned out the class name changed for the notification, so I did not change anything, but the class that used to exists no longer exists, so my workflow was now invalid. I figured that out by diffing the template in the code with my template. If I did not have the ability to run a diff I would have NEVER figured this out from the error above. Ok maybe not never but it would have taken me hours.... |
👍 I have had the same problem |
This still seems high value. The workflow schema validation output is customizable with https://dry-rb.org/gems/dry-validation/1.0/messages/ They are actually currently pretty informative:
but the output is formatted just like that. Much better would be to loop through the messages and output a nicely descriptive error describing the path to the errant key, and the outputting the message text (in this case "name must be a Class") with the actual value. for example: "Error on workflow entry [:workflows, 0, :actions, 1, :notifications, 0, :name] name must be Class Got: FooBar" |
This is a hack at formatting errors for workflow schema issues. The new errors are formatted like: ``` Error on workflow entry [:workflows, 0, :label] label must be filled Got: Error on workflow entry [:workflows, 0, :description] description must be filled Got: Input was: {:workflows=>[{:name=>"ulra_submission", :label=>"", :description=>"", :actions=>[{:name=>"approve", :from_states=>[{:names=>["under_review"], :roles=>["ulra_reviewing"]}], :transition_to=>"reviewed"}]}]} ``` Fixes #267.
This is a hack at formatting errors for workflow schema issues. The new errors are formatted like: ``` Error on workflow entry [:workflows, 0, :label] label must be filled Got: Error on workflow entry [:workflows, 0, :description] description must be filled Got: Input was: {:workflows=>[{:name=>"ulra_submission", :label=>"", :description=>"", :actions=>[{:name=>"approve", :from_states=>[{:names=>["under_review"], :roles=>["ulra_reviewing"]}], :transition_to=>"reviewed"}]}]} ``` Fixes #267.
This is a hack at formatting errors for workflow schema issues. The new errors are formatted like: ``` Error on workflow entry [:workflows, 0, :label] label must be filled Got: Error on workflow entry [:workflows, 0, :description] description must be filled Got: Input was: {:workflows=>[{:name=>"ulra_submission", :label=>"", :description=>"", :actions=>[{:name=>"approve", :from_states=>[{:names=>["under_review"], :roles=>["ulra_reviewing"]}], :transition_to=>"reviewed"}]}]} ``` Fixes #267.
This is a hack at formatting errors for workflow schema issues. The new errors are formatted like: ``` Error on workflow entry [:workflows, 0, :label] label must be filled Got: Error on workflow entry [:workflows, 0, :description] description must be filled Got: Input was: {:workflows=>[{:name=>"ulra_submission", :label=>"", :description=>"", :actions=>[{:name=>"approve", :from_states=>[{:names=>["under_review"], :roles=>["ulra_reviewing"]}], :transition_to=>"reviewed"}]}]} ``` Fixes #267.
Descriptive summary
I got the following information from loading workflows in the spec internal in hyrax:
There are two workflows in the system and I obviously tweaked one of them, but there is no indication of which workflow file failed, what the workflow name, action name, notification name, or the value of the item that does not match the validation.
I'm sure I tweaked the workflow by accident, but which one and exactly where is not easy to discern from the error that was produced.
The text was updated successfully, but these errors were encountered: