Skip to content

Releases: rapatao/ruleset-engine

2.0.0-RC1

2.0.0-RC1 Pre-release
Pre-release

Choose a tag to compare

@rapatao rapatao released this 31 Aug 22:30
2.0.0-RC1
2ad6249

Release candidate for 2.0.0, published to Maven Central as 2.0.0-RC1.

The major bump is not cosmetic: rule evaluation results changed. Re-run your
rule set against this candidate before adopting 2.0.0.

Breaking

Numeric comparison is value based. Equals compared operands with ==, and
BigDecimal.equals is scale sensitive, so a rule comparing 10 against a
BigDecimal("10.00") field answered false. It compares with compareTo now
and answers true. BigInteger operands convert directly rather than through
toLong, which overflowed above Long.MAX_VALUE, and collections compare
element by element under the same rule. The same rule against the same input can
return a different boolean than it did in 1.6.0.

KotlinContext(Evaluator, Map<String, Any?>) is now
KotlinContext(Evaluator, Any).
The Kotlin engine no longer flattens the input
into a map of every path; it resolves the paths a rule names, on demand.

GraalJSEvaluator gained a reuseContextPerThread parameter. Source
compatible, but the primary constructor's JVM signature changed, so recompile
against this version rather than swapping the jar.

ifFail on a group expression keeps its matchers. It rebuilt the expression
from left, operator and right only, so allMatch(...) ifFail FALSE
discarded every matcher and produced an expression that then failed validation.

Fixed

  • An operator whose name carries an uppercase letter is reachable again. Names
    were stored lowercased but looked up raw, so a custom myOperator could never
    be resolved.
  • A quoted literal spanning lines parses as a literal. The check was a regex
    whose . does not match a newline, so the literal fell through to path
    resolution and threw NoSuchElementException.
  • The Unknown operator: message printed null rather than the operator name.

Performance

  • Kotlin: operand paths resolve lazily instead of flattening the whole input
    per evaluation, so cost tracks the rule rather than the input size. Operands
    skip the number parses unless they start like a number.
  • Rhino: one sealed set of standard objects is shared across evaluations and
    each evaluation runs in a child scope.
  • GraalJS: opt in with reuseContextPerThread = true to keep one context per
    thread.

See BENCHMARKS.md
for the measured figures and the trade offs of each.

Checking the candidate

implementation "com.rapatao.ruleset:kotlin-evaluator:2.0.0-RC1"

Worth exercising specifically: any rule comparing numbers where scale differs
(10 against 10.00), anything constructing KotlinContext directly, and any
GraalJSEvaluator built with positional constructor arguments.

Full Changelog: 1.6.0...2.0.0-RC1

1.6.0

Choose a tag to compare

@rapatao rapatao released this 23 May 14:36
b2a7f96

What's Changed

  • build(deps): bump org.graalvm.polyglot:polyglot from 24.0.2 to 24.1.0 by @dependabot[bot] in #39
  • Update Gradle wrapper to version 9.5.1 and enhance workflows by @rapatao in #45

Full Changelog: 1.5.1...1.6.0

1.5.1

Choose a tag to compare

@rapatao rapatao released this 31 Aug 11:42
e6339a7

What's Changed

  • chore: update build package and project dependencies by @rapatao in #38

Full Changelog: 1.5.0...1.5.1

1.5.0

Choose a tag to compare

@rapatao rapatao released this 27 Jul 13:31
287598d

What's Changed

  • feat: improved project coverage and minor code fixes by @rapatao in #36
  • chore: bump project dependencies by @rapatao in #37
  • project is now using Kotlin 2.0.0

Full Changelog: 1.4.2...1.5.0

1.4.2

Choose a tag to compare

@rapatao rapatao released this 27 Jul 10:26
8d19c9a

What's Changed

  • feat: add not_starts_with and not_ends_with operators by @rapatao in #35

Full Changelog: 1.4.1...1.4.2

1.4.1

Choose a tag to compare

@rapatao rapatao released this 25 Jul 09:29
d3e8ade

What's Changed

  • feat: add not_contains operator by @rapatao in #32
  • refactor: use constants instead of plain strings to declare built-in operators by @rapatao in #33
  • feat: improving evaluating performance by @rapatao in #34

Full Changelog: 1.4.0...1.4.1

1.4.0

Choose a tag to compare

@rapatao rapatao released this 23 Jul 10:24
9f37f29

What's Changed

  • feat: inject evaluator in the context to allow using it in custom operators by @rapatao in #28
  • build(deps): bump org.graalvm.polyglot:polyglot from 24.0.1 to 24.0.2 by @dependabot in #30
  • refactor: move each operator to its own file and fix readme typo by @rapatao in #31

New Contributors

Full Changelog: 1.3.0...1.4.0

1.3.0

Choose a tag to compare

@rapatao rapatao released this 06 Jul 13:37
9bce6f3

What's Changed

  • feat: enable library user to extend Engines to have customizable operators by @rapatao in #27

Full Changelog: 1.2.1...1.3.0

1.2.1

Choose a tag to compare

@rapatao rapatao released this 05 Jul 21:27
b542633

What's Changed

  • fix: Kotlin evaluator is not supporting nullable values by @rapatao in #26

Full Changelog: 1.2.0...1.2.1

1.2.0

Choose a tag to compare

@rapatao rapatao released this 05 Jul 14:50
049bc2b

What's Changed

  • feat: remove EvalEngine class replacing its usage by creating Evaluator for each engine by @rapatao in #24
  • feat: on failure was not being used in group operations by @rapatao in #25

Full Changelog: 1.1.0...1.2.0