Closed liorzam closed 3 months ago
Latest commit: 38dd6744e8a5849a4f0247450e2c64824fb50054
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The recent changes to the Rule Engine module in the workflows service primarily involve simplifying the data structure returned by the validateRule
and runRuleSet
functions by removing the passed
property and relying on the status
attribute instead. Additionally, a new test data helper file is introduced, and test cases are updated to reflect these changes. The RuleEngine constructor’s run
method signature has also been adjusted to expect an explicit data object parameter.
Files | Change Summary |
---|---|
.../src/rule-engine/core/rule-engine.ts |
Modified return objects in validateRule and runRuleSet to remove passed property, updated logic to use status . Adjusted run . |
.../src/rule-engine/core/test/data-helper.ts |
Introduced new file with context providing detailed business data for testing. |
.../src/rule-engine/core/test/rule-engine.unit.test.ts |
Updated imports to use absolute paths, reorganized test cases to align with changes in validateRule and runRuleSet return structures. |
.../src/rule-engine/core/types.ts |
Removed passed property from PassedRuleResult and FailedRuleResult types, adjusted error and rules properties accordingly. |
In the code, a change took flight,
Status now guides with clearer light,
Passed
is gone, but fear not, dear,
For rules still drive, the path is clear.
Testing joined with newfound cheer,
Context brightens, far and near.
The engines hum, refined, sincere. 🐇🚀
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Refactor
passed
property withstatus
.Tests