-
Notifications
You must be signed in to change notification settings - Fork 36
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
[RFE] Dynamic File-Based Input for Rules #192
Comments
This issue is currently awaiting triage. |
Hello, I think that we would only accept xml (run through the shim) and yaml files. today we can accept xml rules if you use the `--rules`` flag. |
actually just tested and you can pass in a yaml file as well:
|
Let me know if that will cover the usecase, I am not fully clear on how a CSV would be used and I don't know if we want to go about supporting a different type of rule format. |
Well, not really. Let me give you an example of a use case: Customer has a list of domains/URLs they want to check if they are hardcoded in the source code. Today, one option is to write a custom rule. Alternatively, we would like to see the ability of the Rule parser to read data from external files in addition to the rule file definition. Let's look at the localhost rule. Right now, it looks for when:
builtin.filecontent:
filePattern: .*\.(java|properties|jsp|jspf|tag|xml|txt|yaml)
pattern: http(s)?://((localhost)|(127\.0\.0\.1))+(:[0-9]+)?(/.*)? In the code above, I'd like to provide a parameter instead of Another common scenario is imports. |
Thank you, this feature request is making much more sense to me now! It sounds like you are asking for some way loop over an external source of some interpolated pattern in the rules, creating new rules from that source for each pattern that is found in the external source. I'll let @rromannissen weigh in on the priority, but I think I understand the ask now and think that it is worth exploring if the priority is high enough |
I'm a bit concerned about how this request might affect the concept of rules as "automated pieces of knowledge", as this would leave the door open to some uncertainty about how a rule might behave. By design, rules are expected to be very explicit about the antipatterns to look for and provide a solution for those antipatterns, and if this was implemented, rules could stop being self contained and behave differently depending on certain input at runtime, which could potentially be a bit non deterministic. I totally see how this could be convenient for some custom rules development scenarios, but it would be kind of dangerous for rules that come out of the box with Konveyor, especially for potential downstream distributions, as it would be hard to support those rules if their behavior is not preestablished. Nevertheless, I would definitely not oppose to this being implemented, but considering that the same results could be achieved at the moment via custom rules by adding additional when criteria entries, I don't think our team would be tackling this on the short to mid term, although we would be open to contributions on this direction. |
Enable Konveyor / Kantra to accept files as input to rules, allowing these files to be parsed and utilized as dynamic input parameters. This feature would enhance flexibility by supporting the inclusion of various data formats (e.g., JSON, YAML, CSV) for rule execution. Users could upload a configuration or data file, which the system would parse to extract necessary parameters, thus allowing more complex and customized rule conditions without manual input. This capability would streamline workflows, especially in scenarios requiring detailed configuration or large data sets.
The text was updated successfully, but these errors were encountered: