Commit b7fb6fc
fix(openfeature): allow null targeting key for static and rule-only flags (#10990)
fix(openfeature): defer null targeting key check to shard evaluation point
- Remove early null targeting key guard at evaluate() entry point
- Add deferred null check inside shard else-branch before matchesShard call
- Static and rule-only flags can now evaluate with null targeting key
- TARGETING_KEY_MISSING only returned when shard computation needs it
test(openfeature): add 3 null targeting key test cases for DDEvaluatorTest
- Update existing test: null TK on static flag now expects success (was
incorrectly expecting TARGETING_KEY_MISSING error)
- Add test: null TK on sharded flag expects TARGETING_KEY_MISSING error
- Add test: null TK on rule-only flag (country attribute) expects success
- Add createCountryRuleFlag() helper: rule matching on 'country' attribute
with no shards, validates rule evaluation works without targeting key
style: fix spotless formatting in DDEvaluatorTest
fix: remove accidentally staged ffe-system-test-data submodule pointer
Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>1 parent c55fb32 commit b7fb6fc
2 files changed
Lines changed: 45 additions & 4 deletions
File tree
- products/feature-flagging/feature-flagging-api/src
- main/java/datadog/trace/api/openfeature
- test/java/datadog/trace/api/openfeature
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 90 | | |
95 | 91 | | |
96 | 92 | | |
| |||
127 | 123 | | |
128 | 124 | | |
129 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
215 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
216 | 230 | | |
217 | 231 | | |
218 | 232 | | |
| |||
536 | 550 | | |
537 | 551 | | |
538 | 552 | | |
| 553 | + | |
539 | 554 | | |
540 | 555 | | |
541 | 556 | | |
| |||
1194 | 1209 | | |
1195 | 1210 | | |
1196 | 1211 | | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1197 | 1239 | | |
1198 | 1240 | | |
1199 | 1241 | | |
| |||
0 commit comments