Skip to content

Improve user experience of usage of custom rules #258

@dymurray

Description

@dymurray

Today, the usage of custom rules within the project is inconsistent and confusing for a few reasons. At runtime within the CLI or within the UI workflow, the selection of rules to process for violations always depends upon a label selector. This label selector is built up a few different ways across these 2 workflows, but changing that is not relevant nor in scope for this RFE. It it sometimes possible for a user to specify a custom rule or ruleset and for that rule to never be processed at analysis time if the corresponding label selector does not match the labels on the provided rule. Additionally, if a user supplies a custom rule with some labels that match other rules in the default ruleset, it is possible for those rules to be included in the analysis.

I propose that we conform to two axioms:

  • If a user supplies a custom rule, ALWAYS process that rule at analysis time.
  • If a user supplies a custom rule, this should have zero impact on the inclusion of other rules at analysis time

In the CLI, this means if a user runs:

kantra analyze --input <app> --source=eap6 --target eap8 --rules ./custom-rules.yaml

The rules in custom-rules.yaml will always be processed, even if the rule does not have labels that match the source/target label selector that is built up. The same should apply to the UI workflow, but in the UI it also means that we do zero processing of the labels on that rule so that analysis does not include additional rules based on those labels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-kindIndicates an issue or PR lacks a `kind/foo` label and requires one.needs-priorityIndicates an issue or PR lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions