Skip to content

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

@mkcomer

Description

@mkcomer

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions