Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Conversation

ploomiz
Copy link
Contributor

@ploomiz ploomiz commented Jun 9, 2022


labels: mergeable

Fixes: #3404

Motivation and Context

This implements evaluation of targeting rules based on the spec in this document:
https://www.notion.so/eppo/Targeting-Rules-64b9b5b25fff42a489c56b11ce0ba95d

Description

This assumes the RAC endpoint will pass an optional array of rules with each experiment config. The assignment function will return null if the targeted attributes passed to the SDK do not match at least one rule.

{
  "experiments": {
    "exp1": {
      "rules": [
        {
          "type": "AND",
          "conditions": [
            {
              "operator": "GTE",
              "attribute": "totalSales",
              "value": 100
            },
            {
              "operator": "LTE",
              "attribute": "totalSales",
              "value": 999
            }
          ]
        }
      ]
    }
  }
}

How has this been tested?

SDK integration and unit tests

@ploomiz ploomiz marked this pull request as ready for review June 9, 2022 02:40
@ploomiz ploomiz requested review from petzel and vpai June 9, 2022 02:40
@ploomiz ploomiz self-assigned this Jun 9, 2022
@ploomiz ploomiz merged commit d180ace into main Jun 15, 2022
@ploomiz ploomiz deleted the targeting-rules branch June 15, 2022 17:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants