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

Enhance config error logging and add validation to custom rulesets (remote and local) #17

Open
3 tasks
mkcomer opened this issue Jul 21, 2021 · 0 comments
Open
3 tasks
Labels
enhancement New feature or request

Comments

@mkcomer
Copy link

mkcomer commented Jul 21, 2021

Description:
Currently when applying a custom ruleset to woke (local or remote), there is no validation on the ruleset and various cases where rulesets silently "die" and are not applied to the final ruleset. The developer/user is not notified that their ruleset was not applied (or errored out while configuring), nor does it suggest to the developer/user why their ruleset was not applied.

For example, if the applied ruleset yaml contains just "hello" --> we get the error:
FTL error="yaml: unmarshal errors:\n line 1: cannot unmarshal !!str hello into config.Config"
exit status 1

However, another ruleset yaml containing: "rules: man" --> there is no error.
yaml: unmarshal believes it is a valid yaml in general, but woke does not see it as a valid rule set. Woke doesn't add the custom rules to the final ruleset. The ruleset silently "dies" and no errors are logged to the user.

Acceptance Criteria:

  • Post issue on get-woke/woke repo to get maintainer input on design & implementation and update description based on feedback
  • Enhance error handling for applying custom rulesets for cases that silently die
  • (Stretch) Implement adding a schema validator to validate the applied ruleset yaml. The validator should parse the yaml looking for the correct ruleset yaml structure and log out any errors with your ruleset (as opposed to silently dying and not applying rules which is the current state).
@mkcomer mkcomer added the enhancement New feature or request label Jul 21, 2021
@mkcomer mkcomer changed the title Add a schema validator for parsing a custom ruleset and enable custom error logging Add validation for custom ruleset and error logging Oct 13, 2021
@mkcomer mkcomer changed the title Add validation for custom ruleset and error logging Add validation to custom rulesets (remote and local) and enhance error logging Oct 13, 2021
@mkcomer mkcomer changed the title Add validation to custom rulesets (remote and local) and enhance error logging Enhance config error logging and add validation to custom rulesets (remote and local) and Oct 13, 2021
@mkcomer mkcomer changed the title Enhance config error logging and add validation to custom rulesets (remote and local) and Enhance config error logging and add validation to custom rulesets (remote and local) Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant