Skip to content

Conversation

@joshua-koehler
Copy link

Support complex runtime rules defined in JsonLogic DML.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Rollout model 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

joshua-koehler and others added 8 commits December 1, 2025 17:56
…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>
reduce likelihood of future bug due to edge case in the util
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