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

Release 3.0.0 #170

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Release 3.0.0 #170

wants to merge 6 commits into from

Conversation

luispfgarces
Copy link
Contributor

@luispfgarces luispfgarces commented Sep 1, 2024

Description

Release 3.0.0

Includes:

Warning

BREAKING CHANGES:

  • PriotityCriteria property on RulesEngineOptions - previously deprecated due to a typo.

  • Old rule builder APIs - were already marked obsolete.

  • Condition default constructor.

  • On rules engine build-up. Current usages of the library will have to remove TContentType and TConditionType from builder methods and use and additional MakeGeneric<TContentType, TConditionType>() method to get a equivalent instance of RulesEngine<TContentType, TConditionType>.

  • Additional APIs were added to create and get content types from the rules engine.
    From now on, the library users will be required to create explicitly the content types using the new API, except if the AutoCreateContentTypes option is true.
    This is a breaking change on behavior.

  • The rule builder API was refactored to align with the Rule Query Language specification (being developed on a separate branch).

    Take as example the RQL sentence:

    create rule "Test rule" on ruleset "TexasHoldemPokerSingleCombinations"
    set content "{\"BasePoints\":0,\"Combination\":\"Test combination\"}"
    since $2023-01-01Z$ until $2023-12-31Z$
    apply when @NumberOfAces >= 5
    set priority top;
    

    It would be written on rule builder API as:

    var rule = Rule.Create("Test rule")
        .OnRuleset("TexasHoldemPokerSingleCombinations")
        .SetContent("{\"BasePoints\":0,\"Combination\":\"Test combination\"}")
        .Since(DateTime.Parse("2023-01-01Z"))
        .Until(DateTime.Parse("2023-12-31Z"))
        .ApplyWhen("NumberOfAces", Operators.GreaterOrEqualThan, 5)
        .Build().Rule;
    
    var operationResult = await rulesEngine.AddRuleAsync(rule, RuleAddPriorityOption.AtTop);
  • Conditions are no longer accepted via a collection of Condition and a dictionary is accepted instead. As such, all calls to MatchOneAsync(...), MatchAllAsync(...), and SearchAsync(...) will need adjustment to provide a dictionary of conditions alternatively.

  • It was possible to set up on which resource the Web UI was exposed (e.g. /rules or /xyz). Now it is statically exposed on /rules-ui without the possibility of configuring it - Blazor's rooting limitation. It might possible to configure it but it will require experimenting on creating custom Blazor routing discovery classes.

  • Multiple rules engine instances were exposed under different resources. Now all rules engine instances are exposed under the same resource /rules-ui.

  • The conditions "pretty print" was removed.

Change checklist

  • Code follows the code rules guidelines of this project
  • Commit messages follow the commit rules of this project
  • I have self-reviewed my changes before submitting this pull request
  • I have covered new/changed code with new tests and/or adjusted existent ones
  • I have made changes necessary to update the documentation accordingly

Please also check the I want to contribute guidelines and make sure you have done accordingly.

Disclaimer

By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement

luispfgarces and others added 2 commits July 26, 2024 17:03
Bumps System.Text.Json from 6.0.6 to 8.0.4.

---
updated-dependencies:
- dependency-name: System.Text.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@luispfgarces luispfgarces added this to the Release 3.0.0 milestone Sep 1, 2024
* refactor!: create non-generic rules engine

* chore: change var style rules for C#

* feat!: add APIs to create content types

* chore: resolve codacy code analysis issues

* chore: resolve codacy code analysis issues #2
* refactor!: rename content type/ruleset and condition type/condition

* chore: code review changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant