Merged
Conversation
TODO: update constructors, then write first +/- test using rules engine
It was a faulty rule, logic works perfectly
Helps with debugging.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a runtime rules engine for feature flags using JsonLogic, enabling complex runtime evaluation rules beyond the simple key-value matching previously supported. The implementation maintains backward compatibility by keeping the legacy runtime evaluation alongside the new JsonLogic-based system.
Key Changes
- Added JsonLogic dependency for complex rule evaluation with case-insensitive matching
- Introduced new utility classes (
JsonLogicEngine,JsonCaseDesensitizer) to handle JsonLogic rule evaluation and case normalization - Extended
Rolloutmodel to support both legacy and new runtime evaluation formats
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Added json-logic-java dependency (v1.1.0) and configured Surefire plugin for test logging |
| src/test/resources/logging.properties | New logging configuration for test output |
| src/main/java/com/mixpanel/mixpanelapi/featureflags/model/Rollout.java | Extended to support both legacy runtime evaluation and new JsonLogic rules with backward-compatible constructors |
| src/main/java/com/mixpanel/mixpanelapi/featureflags/provider/LocalFlagsProvider.java | Updated flag evaluation logic to check both legacy and new runtime conditions |
| src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonLogicEngine.java | New utility class for evaluating JsonLogic rules with case-insensitive data handling |
| src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonCaseDesensitizer.java | New utility for case-insensitive normalization of JSON structures and Maps |
| src/test/java/com/mixpanel/mixpanelapi/featureflags/provider/LocalFlagsProviderTest.java | Added comprehensive tests for new JsonLogic runtime evaluation (16 new test cases) and updated existing tests to use constants |
src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonLogicEngine.java
Outdated
Show resolved
Hide resolved
src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonLogicEngine.java
Outdated
Show resolved
Hide resolved
src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonCaseDesensitizer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonCaseDesensitizer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonLogicEngine.java
Show resolved
Hide resolved
src/main/java/com/mixpanel/mixpanelapi/featureflags/provider/LocalFlagsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/mixpanel/mixpanelapi/featureflags/util/JsonCaseDesensitizer.java
Show resolved
Hide resolved
…ogicEngine.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…aseDesensitizer.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ocalFlagsProvider.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…out.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…anel-java into runtime-rules-engine
reduce likelihood of future bug due to edge case in the util
… runtime-rules-engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Support complex runtime rules defined in JsonLogic DML.
QA'd remotely and locally ✅ https://github.com/mixpanel/sdk-integration-testing/blob/main/src/test/java/com/mixpanel/testing/RuntimeRuleEvaluationTest.java