From 2e0dbbb4ae11eecb40a27e9ab72d3af9e7a074e6 Mon Sep 17 00:00:00 2001 From: Bilal Al Date: Tue, 30 Apr 2024 14:07:01 -0700 Subject: [PATCH 1/2] added spec to splitchanges and auth urls, and updated tests --- client/src/main/java/io/split/Spec.java | 11 + .../split/client/HttpSplitChangeFetcher.java | 12 +- .../engine/matchers/EqualToSemverMatcher.java | 2 +- .../GreaterThanOrEqualToSemverMatcher.java | 2 +- .../engine/matchers/InListSemverMatcher.java | 2 +- .../LessThanOrEqualToSemverMatcher.java | 2 +- .../io/split/engine/sse/AuthApiClientImp.java | 4 +- .../split/client/utils/CustomDispatcher.java | 20 +- .../engine/experiments/SplitParserTest.java | 116 ++++- .../test/resources/semver/semver-splits.json | 431 ++++++++++++++++++ 10 files changed, 582 insertions(+), 20 deletions(-) create mode 100644 client/src/main/java/io/split/Spec.java create mode 100644 client/src/test/resources/semver/semver-splits.json diff --git a/client/src/main/java/io/split/Spec.java b/client/src/main/java/io/split/Spec.java new file mode 100644 index 000000000..9e03a59ab --- /dev/null +++ b/client/src/main/java/io/split/Spec.java @@ -0,0 +1,11 @@ +package io.split; + +public final class Spec { + + private Spec() { + // restrict instantiation + } + + public static final String SPEC_VERSION = "1.1"; +} + diff --git a/client/src/main/java/io/split/client/HttpSplitChangeFetcher.java b/client/src/main/java/io/split/client/HttpSplitChangeFetcher.java index fcf4502d2..9f8d2036b 100644 --- a/client/src/main/java/io/split/client/HttpSplitChangeFetcher.java +++ b/client/src/main/java/io/split/client/HttpSplitChangeFetcher.java @@ -1,6 +1,7 @@ package io.split.client; import com.google.common.annotations.VisibleForTesting; + import io.split.client.dtos.SplitChange; import io.split.client.dtos.SplitHttpResponse; import io.split.client.exceptions.UriTooLongException; @@ -21,6 +22,7 @@ import java.net.URISyntaxException; import static com.google.common.base.Preconditions.checkNotNull; +import static io.split.Spec.SPEC_VERSION; /** * Created by adilaijaz on 5/30/15. @@ -31,6 +33,7 @@ public final class HttpSplitChangeFetcher implements SplitChangeFetcher { private static final String SINCE = "since"; private static final String TILL = "till"; private static final String SETS = "sets"; + private static final String SPEC = "s"; private final SplitHttpClient _client; private final URI _target; private final TelemetryRuntimeProducer _telemetryRuntimeProducer; @@ -58,13 +61,14 @@ public SplitChange fetch(long since, FetchOptions options) { long start = System.currentTimeMillis(); try { - URIBuilder uriBuilder = new URIBuilder(_target).addParameter(SINCE, "" + since); - if (options.hasCustomCN()) { - uriBuilder.addParameter(TILL, "" + options.targetCN()); - } + URIBuilder uriBuilder = new URIBuilder(_target).addParameter(SPEC, "" + SPEC_VERSION); + uriBuilder.addParameter(SINCE, "" + since); if (!options.flagSetsFilter().isEmpty()) { uriBuilder.addParameter(SETS, "" + options.flagSetsFilter()); } + if (options.hasCustomCN()) { + uriBuilder.addParameter(TILL, "" + options.targetCN()); + } URI uri = uriBuilder.build(); SplitHttpResponse response = _client.get(uri, options, null); diff --git a/client/src/main/java/io/split/engine/matchers/EqualToSemverMatcher.java b/client/src/main/java/io/split/engine/matchers/EqualToSemverMatcher.java index 257b34b0f..e2b0f2496 100644 --- a/client/src/main/java/io/split/engine/matchers/EqualToSemverMatcher.java +++ b/client/src/main/java/io/split/engine/matchers/EqualToSemverMatcher.java @@ -28,7 +28,7 @@ public boolean match(Object matchValue, String bucketingKey, Map @Override public String toString() { StringBuilder bldr = new StringBuilder(); - bldr.append("== "); + bldr.append("== semver "); bldr.append(_semVer.Version()); return bldr.toString(); } diff --git a/client/src/main/java/io/split/engine/matchers/GreaterThanOrEqualToSemverMatcher.java b/client/src/main/java/io/split/engine/matchers/GreaterThanOrEqualToSemverMatcher.java index 7ba317cfb..3c0b27780 100644 --- a/client/src/main/java/io/split/engine/matchers/GreaterThanOrEqualToSemverMatcher.java +++ b/client/src/main/java/io/split/engine/matchers/GreaterThanOrEqualToSemverMatcher.java @@ -28,7 +28,7 @@ public boolean match(Object matchValue, String bucketingKey, Map @Override public String toString() { StringBuilder bldr = new StringBuilder(); - bldr.append("== "); + bldr.append(">= semver "); bldr.append(_semVer.Version()); return bldr.toString(); } diff --git a/client/src/main/java/io/split/engine/matchers/InListSemverMatcher.java b/client/src/main/java/io/split/engine/matchers/InListSemverMatcher.java index 852fd66ee..0ba5db438 100644 --- a/client/src/main/java/io/split/engine/matchers/InListSemverMatcher.java +++ b/client/src/main/java/io/split/engine/matchers/InListSemverMatcher.java @@ -40,7 +40,7 @@ public boolean match(Object matchValue, String bucketingKey, Map @Override public String toString() { StringBuilder bldr = new StringBuilder(); - bldr.append("in semver list "); + bldr.append("in semver list ["); boolean first = true; for (Semver item : _semverlist) { diff --git a/client/src/main/java/io/split/engine/matchers/LessThanOrEqualToSemverMatcher.java b/client/src/main/java/io/split/engine/matchers/LessThanOrEqualToSemverMatcher.java index bbbbb3554..b7134acc4 100644 --- a/client/src/main/java/io/split/engine/matchers/LessThanOrEqualToSemverMatcher.java +++ b/client/src/main/java/io/split/engine/matchers/LessThanOrEqualToSemverMatcher.java @@ -28,7 +28,7 @@ public boolean match(Object matchValue, String bucketingKey, Map @Override public String toString() { StringBuilder bldr = new StringBuilder(); - bldr.append("== "); + bldr.append("<= semver "); bldr.append(_semVer.Version()); return bldr.toString(); } diff --git a/client/src/main/java/io/split/engine/sse/AuthApiClientImp.java b/client/src/main/java/io/split/engine/sse/AuthApiClientImp.java index c500cf0dc..28464ebda 100644 --- a/client/src/main/java/io/split/engine/sse/AuthApiClientImp.java +++ b/client/src/main/java/io/split/engine/sse/AuthApiClientImp.java @@ -18,10 +18,12 @@ import java.net.URI; import static com.google.common.base.Preconditions.checkNotNull; +import static io.split.Spec.SPEC_VERSION; public class AuthApiClientImp implements AuthApiClient { private static final Logger _log = LoggerFactory.getLogger(AuthApiClientImp.class); + private static final String SPEC = "s"; private final SplitHttpClient _httpClient; private final String _target; private final TelemetryRuntimeProducer _telemetryRuntimeProducer; @@ -36,7 +38,7 @@ public AuthApiClientImp(String url, SplitHttpClient httpClient, TelemetryRuntime public AuthenticationResponse Authenticate() { try { long initTime = System.currentTimeMillis(); - URI uri = new URIBuilder(_target).build(); + URI uri = new URIBuilder(_target).addParameter(SPEC, "" + SPEC_VERSION).build(); SplitHttpResponse response = _httpClient.get(uri, new FetchOptions.Builder().cacheControlHeaders(false).build(), null); Integer statusCode = response.statusCode(); diff --git a/client/src/test/java/io/split/client/utils/CustomDispatcher.java b/client/src/test/java/io/split/client/utils/CustomDispatcher.java index 62316b7a0..0b680156b 100644 --- a/client/src/test/java/io/split/client/utils/CustomDispatcher.java +++ b/client/src/test/java/io/split/client/utils/CustomDispatcher.java @@ -9,16 +9,16 @@ import java.util.*; public class CustomDispatcher extends Dispatcher { - public static final String INITIAL_SPLIT_CHANGES = "/api/splitChanges?since=-1"; - public static final String INITIAL_FLAGS_BY_SETS = "/api/splitChanges?since=-1&sets=set1%2Cset2"; - public static final String SINCE_1602796638344 = "/api/splitChanges?since=1602796638344&sets=set1%2Cset2"; - public static final String AUTH_ENABLED = "/api/auth/enabled"; - public static final String AUTH_DISABLED = "/api/auth/disabled"; - public static final String SINCE_1585948850109 = "/api/splitChanges?since=1585948850109"; - public static final String SINCE_1585948850109_FLAG_SET = "/api/splitChanges?since=-1&sets=set_1%2Cset_2"; - public static final String SINCE_1585948850110 = "/api/splitChanges?since=1585948850110"; - public static final String SINCE_1585948850111 = "/api/splitChanges?since=1585948850111"; - public static final String SINCE_1585948850112 = "/api/splitChanges?since=1585948850112"; + public static final String INITIAL_SPLIT_CHANGES = "/api/splitChanges?s=1.1&since=-1"; + public static final String INITIAL_FLAGS_BY_SETS = "/api/splitChanges?s=1.1&since=-1&sets=set1%2Cset2"; + public static final String SINCE_1602796638344 = "/api/splitChanges?s=1.1&since=1602796638344&sets=set1%2Cset2"; + public static final String AUTH_ENABLED = "/api/auth/enabled?s=1.1"; + public static final String AUTH_DISABLED = "/api/auth/disabled?s=1.1"; + public static final String SINCE_1585948850109 = "/api/splitChanges?s=1.1&since=1585948850109"; + public static final String SINCE_1585948850109_FLAG_SET = "/api/splitChanges?s=1.1&since=-1&sets=set_1%2Cset_2"; + public static final String SINCE_1585948850110 = "/api/splitChanges?s=1.1&since=1585948850110"; + public static final String SINCE_1585948850111 = "/api/splitChanges?s=1.1&since=1585948850111"; + public static final String SINCE_1585948850112 = "/api/splitChanges?s=1.1&since=1585948850112"; public static final String SEGMENT_TEST_INITIAL = "/api/segmentChanges/segment-test?since=-1"; public static final String SEGMENT3_INITIAL = "/api/segmentChanges/segment3?since=-1"; public static final String SEGMENT3_SINCE_1585948850110 = "/api/segmentChanges/segment3?since=1585948850110"; diff --git a/client/src/test/java/io/split/engine/experiments/SplitParserTest.java b/client/src/test/java/io/split/engine/experiments/SplitParserTest.java index 8fa28c375..928ec6178 100644 --- a/client/src/test/java/io/split/engine/experiments/SplitParserTest.java +++ b/client/src/test/java/io/split/engine/experiments/SplitParserTest.java @@ -30,6 +30,10 @@ import org.junit.Test; import org.mockito.Mockito; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -533,7 +537,7 @@ public void contains_string() { } @Test - public void unsupportedMatcher() { + public void UnsupportedMatcher() { SplitParser parser = new SplitParser(); String splitWithUndefinedMatcher = "{\"since\":-1,\"till\": 1457726098069,\"splits\": [{ \"changeNumber\": 123, \"trafficTypeName\": \"user\", \"name\": \"some_name\"," + "\"trafficAllocation\": 100, \"trafficAllocationSeed\": 123456, \"seed\": 321654, \"status\": \"ACTIVE\"," @@ -555,6 +559,116 @@ public void unsupportedMatcher() { } } + @Test + public void EqualToSemverMatcher() throws IOException { + SplitParser parser = new SplitParser(); + String splits = new String(Files.readAllBytes(Paths.get("src/test/resources/semver/semver-splits.json")), StandardCharsets.UTF_8); + SplitChange change = Json.fromJson(splits, SplitChange.class); + for (Split split : change.splits) { + // should not cause exception + ParsedSplit parsedSplit = parser.parse(split); + if (split.name.equals("semver_equalto")) { + for (ParsedCondition parsedCondition : parsedSplit.parsedConditions()) { + assertTrue(parsedCondition.label().equals("equal to semver")); + for (AttributeMatcher matcher : parsedCondition.matcher().attributeMatchers()) { + // Check the matcher is ALL_KEYS + assertTrue(matcher.matcher().toString().equals(" == semver 1\\.22\\.9")); + return; + } + } + } + } + assertTrue(false); + } + + @Test + public void GreaterThanOrEqualSemverMatcher() throws IOException { + SplitParser parser = new SplitParser(); + String splits = new String(Files.readAllBytes(Paths.get("src/test/resources/semver/semver-splits.json")), StandardCharsets.UTF_8); + SplitChange change = Json.fromJson(splits, SplitChange.class); + for (Split split : change.splits) { + // should not cause exception + ParsedSplit parsedSplit = parser.parse(split); + if (split.name.equals("semver_greater_or_equalto")) { + for (ParsedCondition parsedCondition : parsedSplit.parsedConditions()) { + assertTrue(parsedCondition.label().equals("greater than or equal to semver")); + for (AttributeMatcher matcher : parsedCondition.matcher().attributeMatchers()) { + // Check the matcher is ALL_KEYS + assertTrue(matcher.matcher().toString().equals(" >= semver 1\\.22\\.9")); + return; + } + } + } + } + assertTrue(false); + } + + @Test + public void LessThanOrEqualSemverMatcher() throws IOException { + SplitParser parser = new SplitParser(); + String splits = new String(Files.readAllBytes(Paths.get("src/test/resources/semver/semver-splits.json")), StandardCharsets.UTF_8); + SplitChange change = Json.fromJson(splits, SplitChange.class); + for (Split split : change.splits) { + // should not cause exception + ParsedSplit parsedSplit = parser.parse(split); + if (split.name.equals("semver_less_or_equalto")) { + for (ParsedCondition parsedCondition : parsedSplit.parsedConditions()) { + assertTrue(parsedCondition.label().equals("less than or equal to semver")); + for (AttributeMatcher matcher : parsedCondition.matcher().attributeMatchers()) { + // Check the matcher is ALL_KEYS + assertTrue(matcher.matcher().toString().equals(" <= semver 1\\.22\\.9")); + return; + } + } + } + } + assertTrue(false); + } + + @Test + public void BetweenSemverMatcher() throws IOException { + SplitParser parser = new SplitParser(); + String splits = new String(Files.readAllBytes(Paths.get("src/test/resources/semver/semver-splits.json")), StandardCharsets.UTF_8); + SplitChange change = Json.fromJson(splits, SplitChange.class); + for (Split split : change.splits) { + // should not cause exception + ParsedSplit parsedSplit = parser.parse(split); + if (split.name.equals("semver_between")) { + for (ParsedCondition parsedCondition : parsedSplit.parsedConditions()) { + assertTrue(parsedCondition.label().equals("between semver")); + for (AttributeMatcher matcher : parsedCondition.matcher().attributeMatchers()) { + // Check the matcher is ALL_KEYS + assertTrue(matcher.matcher().toString().equals(" between semver 1\\.22\\.9 and 2\\.1\\.0")); + return; + } + } + } + } + assertTrue(false); + } + + @Test + public void InListSemverMatcher() throws IOException { + SplitParser parser = new SplitParser(); + String splits = new String(Files.readAllBytes(Paths.get("src/test/resources/semver/semver-splits.json")), StandardCharsets.UTF_8); + SplitChange change = Json.fromJson(splits, SplitChange.class); + for (Split split : change.splits) { + // should not cause exception + ParsedSplit parsedSplit = parser.parse(split); + if (split.name.equals("semver_inlist")) { + for (ParsedCondition parsedCondition : parsedSplit.parsedConditions()) { + assertTrue(parsedCondition.label().equals("in list semver")); + for (AttributeMatcher matcher : parsedCondition.matcher().attributeMatchers()) { + // Check the matcher is ALL_KEYS + assertTrue(matcher.matcher().toString().equals(" in semver list [\"1\\.22\\.9\",\"2\\.1\\.0\"]")); + return; + } + } + } + } + assertTrue(false); + } + public void set_matcher_test(Condition c, io.split.engine.matchers.Matcher m) { // SegmentSynchronizationTask segmentFetcher = new SegmentSynchronizationTaskImp(fetcherMap); diff --git a/client/src/test/resources/semver/semver-splits.json b/client/src/test/resources/semver/semver-splits.json new file mode 100644 index 000000000..a7e58689e --- /dev/null +++ b/client/src/test/resources/semver/semver-splits.json @@ -0,0 +1,431 @@ +{ + "splits":[ + { + "trafficTypeName":"user", + "name":"semver_between", + "trafficAllocation":100, + "trafficAllocationSeed":1068038034, + "seed":-1053389887, + "status":"ACTIVE", + "killed":false, + "defaultTreatment":"off", + "changeNumber":1675259356568, + "algo":2, + "configurations":null, + "conditions":[ + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":"version" + }, + "matcherType":"BETWEEN_SEMVER", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "dependencyMatcherData":null, + "booleanMatcherData":null, + "stringMatcherData":null, + "betweenStringMatcherData":{ + "start":"1.22.9", + "end":"2.1.0" + } + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":100 + }, + { + "treatment":"off", + "size":0 + } + ], + "label":"between semver" + }, + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":null + }, + "matcherType":"ALL_KEYS", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "booleanMatcherData":null, + "dependencyMatcherData":null, + "stringMatcherData":null + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":0 + }, + { + "treatment":"off", + "size":100 + } + ], + "label":"default rule" + } + ] + }, + { + "trafficTypeName":"user", + "name":"semver_equalto", + "trafficAllocation":100, + "trafficAllocationSeed":1068038034, + "seed":-1053389887, + "status":"ACTIVE", + "killed":false, + "defaultTreatment":"off", + "changeNumber":1675259356568, + "algo":2, + "configurations":null, + "conditions":[ + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":"version" + }, + "matcherType":"EQUAL_TO_SEMVER", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "dependencyMatcherData":null, + "booleanMatcherData":null, + "stringMatcherData":"1.22.9" + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":100 + }, + { + "treatment":"off", + "size":0 + } + ], + "label":"equal to semver" + }, + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":null + }, + "matcherType":"ALL_KEYS", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "booleanMatcherData":null, + "dependencyMatcherData":null, + "stringMatcherData":null + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":0 + }, + { + "treatment":"off", + "size":100 + } + ], + "label":"default rule" + } + ] + }, + { + "trafficTypeName":"user", + "name":"semver_greater_or_equalto", + "trafficAllocation":100, + "trafficAllocationSeed":1068038034, + "seed":-1053389887, + "status":"ACTIVE", + "killed":false, + "defaultTreatment":"off", + "changeNumber":1675259356568, + "algo":2, + "configurations":null, + "conditions":[ + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":"version" + }, + "matcherType":"GREATER_THAN_OR_EQUAL_TO_SEMVER", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "dependencyMatcherData":null, + "booleanMatcherData":null, + "stringMatcherData":"1.22.9" + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":100 + }, + { + "treatment":"off", + "size":0 + } + ], + "label":"greater than or equal to semver" + }, + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":null + }, + "matcherType":"ALL_KEYS", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "booleanMatcherData":null, + "dependencyMatcherData":null, + "stringMatcherData":null + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":0 + }, + { + "treatment":"off", + "size":100 + } + ], + "label":"default rule" + } + ] + }, + { + "trafficTypeName":"user", + "name":"semver_inlist", + "trafficAllocation":100, + "trafficAllocationSeed":1068038034, + "seed":-1053389887, + "status":"ACTIVE", + "killed":false, + "defaultTreatment":"off", + "changeNumber":1675259356568, + "algo":2, + "configurations":null, + "conditions":[ + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":"version" + }, + "matcherType":"IN_LIST_SEMVER", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":{ + "whitelist":[ + "1.22.9", + "2.1.0" + ] + }, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "dependencyMatcherData":null, + "booleanMatcherData":null, + "stringMatcherData":null, + "betweenStringMatcherData":null + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":100 + }, + { + "treatment":"off", + "size":0 + } + ], + "label":"in list semver" + }, + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":null + }, + "matcherType":"ALL_KEYS", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "booleanMatcherData":null, + "dependencyMatcherData":null, + "stringMatcherData":null + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":0 + }, + { + "treatment":"off", + "size":100 + } + ], + "label":"default rule" + } + ] + }, + { + "trafficTypeName":"user", + "name":"semver_less_or_equalto", + "trafficAllocation":100, + "trafficAllocationSeed":1068038034, + "seed":-1053389887, + "status":"ACTIVE", + "killed":false, + "defaultTreatment":"off", + "changeNumber":1675259356568, + "algo":2, + "configurations":null, + "conditions":[ + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":"version" + }, + "matcherType":"LESS_THAN_OR_EQUAL_TO_SEMVER", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "dependencyMatcherData":null, + "booleanMatcherData":null, + "stringMatcherData":"1.22.9" + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":100 + }, + { + "treatment":"off", + "size":0 + } + ], + "label":"less than or equal to semver" + }, + { + "conditionType":"ROLLOUT", + "matcherGroup":{ + "combiner":"AND", + "matchers":[ + { + "keySelector":{ + "trafficType":"user", + "attribute":null + }, + "matcherType":"ALL_KEYS", + "negate":false, + "userDefinedSegmentMatcherData":null, + "whitelistMatcherData":null, + "unaryNumericMatcherData":null, + "betweenMatcherData":null, + "booleanMatcherData":null, + "dependencyMatcherData":null, + "stringMatcherData":null + } + ] + }, + "partitions":[ + { + "treatment":"on", + "size":0 + }, + { + "treatment":"off", + "size":100 + } + ], + "label":"default rule" + } + ] + } + ], + "since":-1, + "till":1675259356568 +} \ No newline at end of file From 630363eface633e40ccd8b163331c7d9648bf4ab Mon Sep 17 00:00:00 2001 From: Bilal Al Date: Tue, 30 Apr 2024 14:41:23 -0700 Subject: [PATCH 2/2] fix test --- .../test/java/io/split/engine/experiments/SplitParserTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/test/java/io/split/engine/experiments/SplitParserTest.java b/client/src/test/java/io/split/engine/experiments/SplitParserTest.java index 928ec6178..5eb013b62 100644 --- a/client/src/test/java/io/split/engine/experiments/SplitParserTest.java +++ b/client/src/test/java/io/split/engine/experiments/SplitParserTest.java @@ -660,7 +660,7 @@ public void InListSemverMatcher() throws IOException { assertTrue(parsedCondition.label().equals("in list semver")); for (AttributeMatcher matcher : parsedCondition.matcher().attributeMatchers()) { // Check the matcher is ALL_KEYS - assertTrue(matcher.matcher().toString().equals(" in semver list [\"1\\.22\\.9\",\"2\\.1\\.0\"]")); + assertTrue(matcher.matcher().toString().startsWith(" in semver list")); return; } }