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

mindev: Add new subcommand to validate ruletype updates #4790

Merged
merged 1 commit into from
Oct 23, 2024

Commits on Oct 23, 2024

  1. mindev: Add new subcommand to validate ruletype updates

    `mindev ruletype validate-update` (or `mindev ruletype vu` for short)
    takes two YAML files and validate if the rule type can be updated (or
    not).
    
    ```
    $ mindev ruletype validate-update -h
    The 'ruletype validate-update' subcommand allows you to validate an update of a rule type
    definition
    
    Usage:
      mindev ruletype validate-update [flags]
    
    Aliases:
      validate-update, vu
    
    Flags:
      -a, --after string    file to read rule type definition from
      -b, --before string   file to read rule type definition from
      -h, --help            help for validate-update
    ```
    
    If the validation succeeds, we should just get a "zero" return value.
    
    ```
    $ mindev ruletype vu -b before.yaml -a after.yaml
    ```
    
    If it fails, we should get the reasoning, and a non-zero return value:
    
    ```
    $ mindev ruletype vu -b before.yaml -a after.yaml
    Error: error validating param schema update: failed to validate properties: cannot remove properties from rule schema
    Message: Error on execute
    Details: error validating param schema update: failed to validate properties: cannot remove properties from rule schema
     [1] $
    ```
    
    This should help us gate rule type updates in CI more easily.
    
    Signed-off-by: Juan Antonio Osorio <[email protected]>
    JAORMX committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    baf8284 View commit details
    Browse the repository at this point in the history