|
1 | 1 | { |
2 | | - "version": 1, |
| 2 | + "version": 2, |
3 | 3 | "description": "Featurevisor v3 cross SDK compatibility contracts", |
4 | 4 | "bucketing": { |
5 | 5 | "minimum": 0, |
|
26 | 26 | "pattern": "chrome", |
27 | 27 | "flags": "g", |
28 | 28 | "values": ["chrome", "chrome", "firefox", "chrome"], |
29 | | - "matches": [true, true, false, true] |
| 29 | + "matches": [true, true, false, true], |
| 30 | + "portableCases": [ |
| 31 | + { |
| 32 | + "pattern": "^chrome$", |
| 33 | + "flags": "", |
| 34 | + "value": "chrome", |
| 35 | + "expected": true |
| 36 | + }, |
| 37 | + { |
| 38 | + "pattern": "^(chrome|firefox)$", |
| 39 | + "flags": "i", |
| 40 | + "value": "Firefox", |
| 41 | + "expected": true |
| 42 | + }, |
| 43 | + { |
| 44 | + "pattern": "^second$", |
| 45 | + "flags": "m", |
| 46 | + "value": "first\nsecond", |
| 47 | + "expected": true |
| 48 | + }, |
| 49 | + { |
| 50 | + "pattern": "first.*second", |
| 51 | + "flags": "s", |
| 52 | + "value": "first\nsecond", |
| 53 | + "expected": true |
| 54 | + }, |
| 55 | + { |
| 56 | + "pattern": "\\(literal\\)", |
| 57 | + "flags": "g", |
| 58 | + "value": "(literal)", |
| 59 | + "expected": true |
| 60 | + } |
| 61 | + ], |
| 62 | + "rejectedSyntax": [ |
| 63 | + "foo(?=bar)", |
| 64 | + "(?<=foo)bar", |
| 65 | + "(?:foo|bar)", |
| 66 | + "(?<name>foo)", |
| 67 | + "(foo)\\1", |
| 68 | + "foo++" |
| 69 | + ] |
30 | 70 | }, |
31 | 71 | "typedVariables": [ |
32 | 72 | { "type": "integer", "value": 1, "valid": true }, |
|
44 | 84 | "diagnostics": { |
45 | 85 | "requiredFields": ["level", "code", "message", "details"], |
46 | 86 | "detailsType": "object", |
47 | | - "emptyDetailsJson": "{}" |
| 87 | + "emptyDetailsJson": "{}", |
| 88 | + "evaluationDetailFields": ["featureKey", "variableKey", "reason", "evaluation"], |
| 89 | + "moduleEnvelopeFields": ["module", "moduleName", "originalError"], |
| 90 | + "errorEventLevels": ["error"] |
| 91 | + }, |
| 92 | + "numericBucketKeys": [ |
| 93 | + { "value": 1.2345678901234567, "expected": "1.2345678901234567" }, |
| 94 | + { "value": 0.30000000000000004, "expected": "0.30000000000000004" }, |
| 95 | + { "value": 0.000001, "expected": "0.000001" }, |
| 96 | + { "value": 1e-7, "expected": "1e-7" }, |
| 97 | + { "value": 100000000000000000000, "expected": "100000000000000000000" }, |
| 98 | + { "value": 1e21, "expected": "1e+21" } |
| 99 | + ], |
| 100 | + "portableConditions": { |
| 101 | + "regexFlags": ["g", "i", "m", "s"], |
| 102 | + "rejectedRegexFlags": ["d", "u", "v", "y"], |
| 103 | + "dateFormat": "ISO 8601 with an explicit timezone", |
| 104 | + "dates": [ |
| 105 | + "2024-01-01T00:00:00Z", |
| 106 | + "2024-01-01T01:00:00+01:00", |
| 107 | + "2024-01-01T00:00:00.250Z", |
| 108 | + "2024-01-01T01:00:00.250+01:00" |
| 109 | + ], |
| 110 | + "semanticVersions": [ |
| 111 | + "1.2.3", |
| 112 | + "1.2.3-beta.1", |
| 113 | + "1.2.3+build.5" |
| 114 | + ], |
| 115 | + "invalidSemanticVersion": "invalid", |
| 116 | + "invalidSemanticVersionDiagnosticCode": "condition_match_error" |
| 117 | + }, |
| 118 | + "conditionCases": [ |
| 119 | + { |
| 120 | + "name": "strict primitive equality", |
| 121 | + "condition": { |
| 122 | + "attribute": "value", |
| 123 | + "operator": "equals", |
| 124 | + "value": 1 |
| 125 | + }, |
| 126 | + "context": { "value": "1" }, |
| 127 | + "expected": false |
| 128 | + }, |
| 129 | + { |
| 130 | + "name": "not negates implicit and", |
| 131 | + "condition": { |
| 132 | + "not": [ |
| 133 | + { "attribute": "country", "operator": "equals", "value": "us" }, |
| 134 | + { "attribute": "device", "operator": "equals", "value": "mobile" } |
| 135 | + ] |
| 136 | + }, |
| 137 | + "context": { "country": "us", "device": "desktop" }, |
| 138 | + "expected": true |
| 139 | + }, |
| 140 | + { |
| 141 | + "name": "not with nested or means none match", |
| 142 | + "condition": { |
| 143 | + "not": [ |
| 144 | + { |
| 145 | + "or": [ |
| 146 | + { "attribute": "country", "operator": "equals", "value": "us" }, |
| 147 | + { "attribute": "country", "operator": "equals", "value": "nl" } |
| 148 | + ] |
| 149 | + } |
| 150 | + ] |
| 151 | + }, |
| 152 | + "context": { "country": "de" }, |
| 153 | + "expected": true |
| 154 | + }, |
| 155 | + { |
| 156 | + "name": "empty not fails defensively", |
| 157 | + "condition": { "not": [] }, |
| 158 | + "context": {}, |
| 159 | + "expected": false |
| 160 | + }, |
| 161 | + { |
| 162 | + "name": "fractional ISO date with offset", |
| 163 | + "condition": { |
| 164 | + "attribute": "date", |
| 165 | + "operator": "before", |
| 166 | + "value": "2024-01-01T00:00:00.500Z" |
| 167 | + }, |
| 168 | + "context": { "date": "2024-01-01T01:00:00.250+01:00" }, |
| 169 | + "expected": true |
| 170 | + } |
| 171 | + ], |
| 172 | + "childInstances": { |
| 173 | + "contextModel": "snapshot existing parent keys at spawn, inherit newly introduced parent keys, child keys win", |
| 174 | + "closeRemovesLocalAndDelegatedSubscriptions": true, |
| 175 | + "detailedEvaluationMethods": ["flag", "variation", "variable"], |
| 176 | + "contextCase": { |
| 177 | + "parentAtSpawn": { "country": "nl", "plan": "free" }, |
| 178 | + "child": { "country": "de" }, |
| 179 | + "parentAfterSpawn": { "country": "us", "plan": "pro", "region": "eu" }, |
| 180 | + "expected": { "country": "de", "plan": "free", "region": "eu" } |
| 181 | + } |
| 182 | + }, |
| 183 | + "defaults": { |
| 184 | + "presenceBased": true, |
| 185 | + "values": ["", 0, false, null], |
| 186 | + "aggregateEvaluationPreservesEmptyVariation": true, |
| 187 | + "aggregateCase": { |
| 188 | + "datafile": { |
| 189 | + "schemaVersion": "2", |
| 190 | + "revision": "defaults", |
| 191 | + "segments": {}, |
| 192 | + "features": { |
| 193 | + "experiment": { |
| 194 | + "key": "experiment", |
| 195 | + "bucketBy": "userId", |
| 196 | + "variations": [{ "value": "control" }], |
| 197 | + "traffic": [] |
| 198 | + } |
| 199 | + } |
| 200 | + }, |
| 201 | + "defaultVariationValue": "", |
| 202 | + "expected": { |
| 203 | + "enabled": false, |
| 204 | + "variation": "" |
| 205 | + } |
| 206 | + } |
| 207 | + }, |
| 208 | + "diagnosticCase": { |
| 209 | + "featureKey": "missing", |
| 210 | + "expectedLevel": "warn", |
| 211 | + "expectedCode": "feature_not_found", |
| 212 | + "detailsMustBeObject": true |
| 213 | + }, |
| 214 | + "nativeContexts": { |
| 215 | + "numericTypesUseOneComparisonContract": true, |
| 216 | + "primitiveNativeSlicesSupportIncludes": true |
48 | 217 | } |
49 | 218 | } |
0 commit comments