-
Notifications
You must be signed in to change notification settings - Fork 75
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
Remove easy-rules #540
base: main
Are you sure you want to change the base?
Remove easy-rules #540
Conversation
Have not looked but removing one layer of indirection that just adds security issues and a bunch of syntax sugar seems like a good idea. |
Can you ask in the maintainers group about any potential suggestion or preference for a rules engine |
2c476fc
to
e398d98
Compare
@@ -67,7 +67,6 @@ static Stream<String> provideRoutingRuleConfigFiles() | |||
String rulesDir = "src/test/resources/rules/"; | |||
return Stream.of( | |||
rulesDir + "routing_rules_atomic.yml", | |||
rulesDir + "routing_rules_composite.yml", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR removes support for composite rules
de8b88e
to
d2d6bfa
Compare
d2d6bfa
to
3603a80
Compare
We should get that into 13 imho .. I wont be able to review this week before Friday |
18d7e42
to
206eab6
Compare
I agree to remove the unmaintained |
Do the rest of the examples and rules are supported by your 'MVEL adapter' How to check a user? can you give me an equivalent rule with the changes, I tried the below rule with your branch but could not get to work.
|
@vishalya it is tested with all the rules in https://github.com/willmostly/trino-gateway/tree/will/mvel-rules/gateway-ha/src/test/resources/rules. I think your issue is that |
gateway-ha/src/main/java/io/trino/gateway/ha/router/MVELFileRoutingGroupSelector.java
Outdated
Show resolved
Hide resolved
206eab6
to
efbe2d1
Compare
efbe2d1
to
fe0e040
Compare
Co-Authored-By: Prakhar Sapre <[email protected]>
fe0e040
to
e821140
Compare
@oneonestar ptal, I've refactored to remove abstractions for multi-engine support, with the exception of an interface to define the form of a rule. |
Description
Remove easy-rules and use mvel directly for rule evaluation This PR closes #527. The existing rule format is retained, with the exception that
easy-rules
style composite rules have been removed and replaced with astate
map that allows passing information between rule executions.Additional context and related issues
Trino Gateway currently leverages easy-rules to evaluate routing rules against an http request. This PR
The
MVELRoutingRule
andFileBasedRoutingGroupSelector
replicate the existing easy-rules functionality, minus composite rules. Easy-rules uses mvel as the execution engine, so rule condition and action syntax does not need to be migrated. This PR drops support for composite rules, which may be a breaking change for some users.An additional
state
object is made available to allow passing evaluation results from lower priority rules to higher priority rules. This should compensate for the removal of theeasy-rules
composite rules. For usage examples, see tests and docs.Database storage for MVEL rules will be added as a follow up.
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x ) Release notes are required, with the following suggested text:
Remove easy-rules library. Breaking change: composite rules are deprecated