fix(openfeature): compute correct reason from allocation structure#10971
Draft
leoromanovsky wants to merge 4 commits intomasterfrom
Draft
fix(openfeature): compute correct reason from allocation structure#10971leoromanovsky wants to merge 4 commits intomasterfrom
leoromanovsky wants to merge 4 commits intomasterfrom
Conversation
…ng TARGETING_MATCH - Add Split parameter to resolveVariant for three-way reason computation - Return STATIC for flags with no rules and no shards (simple flags) - Return SPLIT for flags with no rules but with shards (shard-based flags) - Return TARGETING_MATCH for flags with rules (rule-based flags) - Update 9 test assertions: 7 to STATIC, 2 to SPLIT
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 65 metrics, 6 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1062211
Total [baseline] (11.156 s) : 0, 11155928
Agent [candidate] (1.066 s) : 0, 1065986
Total [candidate] (11.092 s) : 0, 11092304
section appsec
Agent [baseline] (1.247 s) : 0, 1246971
Total [baseline] (11.165 s) : 0, 11164921
Agent [candidate] (1.26 s) : 0, 1259897
Total [candidate] (11.271 s) : 0, 11271293
section iast
Agent [baseline] (1.24 s) : 0, 1240016
Total [baseline] (11.414 s) : 0, 11414238
Agent [candidate] (1.232 s) : 0, 1231671
Total [candidate] (11.353 s) : 0, 11353459
section profiling
Agent [baseline] (1.182 s) : 0, 1182135
Total [baseline] (11.004 s) : 0, 11003964
Agent [candidate] (1.192 s) : 0, 1191822
Total [candidate] (11.141 s) : 0, 11140687
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.202 ms) : 0, 1202
BytebuddyAgent [baseline] (629.77 ms) : 0, 629770
BytebuddyAgent [candidate] (633.538 ms) : 0, 633538
AgentMeter [baseline] (29.471 ms) : 0, 29471
AgentMeter [candidate] (29.77 ms) : 0, 29770
GlobalTracer [baseline] (258.293 ms) : 0, 258293
GlobalTracer [candidate] (258.687 ms) : 0, 258687
AppSec [baseline] (32.057 ms) : 0, 32057
AppSec [candidate] (32.06 ms) : 0, 32060
Debugger [baseline] (60.804 ms) : 0, 60804
Debugger [candidate] (60.755 ms) : 0, 60755
Remote Config [baseline] (615.997 µs) : 0, 616
Remote Config [candidate] (593.365 µs) : 0, 593
Telemetry [baseline] (8.856 ms) : 0, 8856
Telemetry [candidate] (8.761 ms) : 0, 8761
Flare Poller [baseline] (5.07 ms) : 0, 5070
Flare Poller [candidate] (4.336 ms) : 0, 4336
section appsec
crashtracking [baseline] (1.203 ms) : 0, 1203
crashtracking [candidate] (1.198 ms) : 0, 1198
BytebuddyAgent [baseline] (659.438 ms) : 0, 659438
BytebuddyAgent [candidate] (666.892 ms) : 0, 666892
AgentMeter [baseline] (12.149 ms) : 0, 12149
AgentMeter [candidate] (12.326 ms) : 0, 12326
GlobalTracer [baseline] (257.887 ms) : 0, 257887
GlobalTracer [candidate] (260.615 ms) : 0, 260615
AppSec [baseline] (177.307 ms) : 0, 177307
AppSec [candidate] (178.543 ms) : 0, 178543
Debugger [baseline] (66.053 ms) : 0, 66053
Debugger [candidate] (66.698 ms) : 0, 66698
Remote Config [baseline] (635.381 µs) : 0, 635
Remote Config [candidate] (648.399 µs) : 0, 648
Telemetry [baseline] (8.389 ms) : 0, 8389
Telemetry [candidate] (8.544 ms) : 0, 8544
Flare Poller [baseline] (3.535 ms) : 0, 3535
Flare Poller [candidate] (3.643 ms) : 0, 3643
IAST [baseline] (24.116 ms) : 0, 24116
IAST [candidate] (24.381 ms) : 0, 24381
section iast
crashtracking [baseline] (1.207 ms) : 0, 1207
crashtracking [candidate] (1.195 ms) : 0, 1195
BytebuddyAgent [baseline] (805.198 ms) : 0, 805198
BytebuddyAgent [candidate] (798.715 ms) : 0, 798715
AgentMeter [baseline] (11.559 ms) : 0, 11559
AgentMeter [candidate] (11.413 ms) : 0, 11413
GlobalTracer [baseline] (249.752 ms) : 0, 249752
GlobalTracer [candidate] (248.451 ms) : 0, 248451
AppSec [baseline] (26.813 ms) : 0, 26813
AppSec [candidate] (26.623 ms) : 0, 26623
Debugger [baseline] (70.447 ms) : 0, 70447
Debugger [candidate] (70.671 ms) : 0, 70671
Remote Config [baseline] (531.214 µs) : 0, 531
Remote Config [candidate] (525.422 µs) : 0, 525
Telemetry [baseline] (9.224 ms) : 0, 9224
Telemetry [candidate] (9.203 ms) : 0, 9203
Flare Poller [baseline] (3.508 ms) : 0, 3508
Flare Poller [candidate] (3.442 ms) : 0, 3442
IAST [baseline] (25.612 ms) : 0, 25612
IAST [candidate] (25.338 ms) : 0, 25338
section profiling
crashtracking [baseline] (1.172 ms) : 0, 1172
crashtracking [candidate] (1.178 ms) : 0, 1178
BytebuddyAgent [baseline] (682.841 ms) : 0, 682841
BytebuddyAgent [candidate] (689.203 ms) : 0, 689203
AgentMeter [baseline] (8.971 ms) : 0, 8971
AgentMeter [candidate] (9.058 ms) : 0, 9058
GlobalTracer [baseline] (214.631 ms) : 0, 214631
GlobalTracer [candidate] (215.755 ms) : 0, 215755
AppSec [baseline] (32.318 ms) : 0, 32318
AppSec [candidate] (32.444 ms) : 0, 32444
Debugger [baseline] (65.011 ms) : 0, 65011
Debugger [candidate] (66.458 ms) : 0, 66458
Remote Config [baseline] (565.818 µs) : 0, 566
Remote Config [candidate] (564.507 µs) : 0, 565
Telemetry [baseline] (7.762 ms) : 0, 7762
Telemetry [candidate] (7.821 ms) : 0, 7821
Flare Poller [baseline] (4.268 ms) : 0, 4268
Flare Poller [candidate] (3.503 ms) : 0, 3503
ProfilingAgent [baseline] (93.777 ms) : 0, 93777
ProfilingAgent [candidate] (94.56 ms) : 0, 94560
Profiling [baseline] (94.324 ms) : 0, 94324
Profiling [candidate] (95.123 ms) : 0, 95123
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.056 s) : 0, 1056470
Total [baseline] (8.843 s) : 0, 8842788
Agent [candidate] (1.056 s) : 0, 1055971
Total [candidate] (8.872 s) : 0, 8872290
section iast
Agent [baseline] (1.227 s) : 0, 1227147
Total [baseline] (9.538 s) : 0, 9538232
Agent [candidate] (1.228 s) : 0, 1227744
Total [candidate] (9.538 s) : 0, 9538211
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (628.107 ms) : 0, 628107
BytebuddyAgent [candidate] (628.711 ms) : 0, 628711
AgentMeter [baseline] (29.372 ms) : 0, 29372
AgentMeter [candidate] (29.451 ms) : 0, 29451
GlobalTracer [baseline] (256.812 ms) : 0, 256812
GlobalTracer [candidate] (257.187 ms) : 0, 257187
AppSec [baseline] (31.82 ms) : 0, 31820
AppSec [candidate] (31.743 ms) : 0, 31743
Debugger [baseline] (59.394 ms) : 0, 59394
Debugger [candidate] (59.513 ms) : 0, 59513
Remote Config [baseline] (591.118 µs) : 0, 591
Remote Config [candidate] (582.188 µs) : 0, 582
Telemetry [baseline] (8.056 ms) : 0, 8056
Telemetry [candidate] (7.992 ms) : 0, 7992
Flare Poller [baseline] (4.985 ms) : 0, 4985
Flare Poller [candidate] (3.505 ms) : 0, 3505
section iast
crashtracking [baseline] (1.187 ms) : 0, 1187
crashtracking [candidate] (1.194 ms) : 0, 1194
BytebuddyAgent [baseline] (797.021 ms) : 0, 797021
BytebuddyAgent [candidate] (796.71 ms) : 0, 796710
AgentMeter [baseline] (11.384 ms) : 0, 11384
AgentMeter [candidate] (11.394 ms) : 0, 11394
GlobalTracer [baseline] (247.25 ms) : 0, 247250
GlobalTracer [candidate] (247.84 ms) : 0, 247840
AppSec [baseline] (26.475 ms) : 0, 26475
AppSec [candidate] (26.453 ms) : 0, 26453
Debugger [baseline] (67.459 ms) : 0, 67459
Debugger [candidate] (68.92 ms) : 0, 68920
Remote Config [baseline] (521.377 µs) : 0, 521
Remote Config [candidate] (521.887 µs) : 0, 522
Telemetry [baseline] (11.06 ms) : 0, 11060
Telemetry [candidate] (9.794 ms) : 0, 9794
Flare Poller [baseline] (3.415 ms) : 0, 3415
Flare Poller [candidate] (3.45 ms) : 0, 3450
IAST [baseline] (25.308 ms) : 0, 25308
IAST [candidate] (25.352 ms) : 0, 25352
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 19 metrics, 17 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (1.172 ms) : 1160, 1183
. : milestone, 1172,
iast (3.188 ms) : 3145, 3231
. : milestone, 3188,
iast_FULL (5.993 ms) : 5932, 6054
. : milestone, 5993,
iast_GLOBAL (3.707 ms) : 3648, 3766
. : milestone, 3707,
profiling (2.056 ms) : 2038, 2073
. : milestone, 2056,
tracing (1.814 ms) : 1799, 1829
. : milestone, 1814,
section candidate
no_agent (1.192 ms) : 1180, 1204
. : milestone, 1192,
iast (3.157 ms) : 3116, 3198
. : milestone, 3157,
iast_FULL (6.154 ms) : 6090, 6217
. : milestone, 6154,
iast_GLOBAL (3.526 ms) : 3465, 3586
. : milestone, 3526,
profiling (2.157 ms) : 2137, 2177
. : milestone, 2157,
tracing (1.824 ms) : 1809, 1839
. : milestone, 1824,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (17.289 ms) : 17116, 17461
. : milestone, 17289,
appsec (19.624 ms) : 19428, 19821
. : milestone, 19624,
code_origins (17.582 ms) : 17404, 17760
. : milestone, 17582,
iast (18.215 ms) : 18037, 18393
. : milestone, 18215,
profiling (18.733 ms) : 18548, 18919
. : milestone, 18733,
tracing (17.684 ms) : 17510, 17859
. : milestone, 17684,
section candidate
no_agent (17.413 ms) : 17237, 17588
. : milestone, 17413,
appsec (19.494 ms) : 19291, 19697
. : milestone, 19494,
code_origins (17.567 ms) : 17392, 17742
. : milestone, 17567,
iast (17.799 ms) : 17621, 17976
. : milestone, 17799,
profiling (19.071 ms) : 18881, 19261
. : milestone, 19071,
tracing (17.665 ms) : 17490, 17839
. : milestone, 17665,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (14.887 s) : 14887000, 14887000
. : milestone, 14887000,
appsec (14.799 s) : 14799000, 14799000
. : milestone, 14799000,
iast (18.387 s) : 18387000, 18387000
. : milestone, 18387000,
iast_GLOBAL (17.948 s) : 17948000, 17948000
. : milestone, 17948000,
profiling (15.182 s) : 15182000, 15182000
. : milestone, 15182000,
tracing (14.713 s) : 14713000, 14713000
. : milestone, 14713000,
section candidate
no_agent (15.537 s) : 15537000, 15537000
. : milestone, 15537000,
appsec (14.916 s) : 14916000, 14916000
. : milestone, 14916000,
iast (18.073 s) : 18073000, 18073000
. : milestone, 18073000,
iast_GLOBAL (17.837 s) : 17837000, 17837000
. : milestone, 17837000,
profiling (14.82 s) : 14820000, 14820000
. : milestone, 14820000,
tracing (14.952 s) : 14952000, 14952000
. : milestone, 14952000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~80ea54941c, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (1.482 ms) : 1470, 1493
. : milestone, 1482,
appsec (2.525 ms) : 2470, 2579
. : milestone, 2525,
iast (2.265 ms) : 2196, 2334
. : milestone, 2265,
iast_GLOBAL (2.308 ms) : 2239, 2378
. : milestone, 2308,
profiling (2.106 ms) : 2050, 2162
. : milestone, 2106,
tracing (2.096 ms) : 2042, 2150
. : milestone, 2096,
section candidate
no_agent (1.476 ms) : 1465, 1487
. : milestone, 1476,
appsec (3.791 ms) : 3568, 4015
. : milestone, 3791,
iast (2.265 ms) : 2196, 2334
. : milestone, 2265,
iast_GLOBAL (2.309 ms) : 2239, 2378
. : milestone, 2309,
profiling (2.091 ms) : 2036, 2145
. : milestone, 2091,
tracing (2.09 ms) : 2037, 2144
. : milestone, 2090,
|
- Add ufc-config.json (canonical server configuration) - Add 24 evaluation-case JSON files from dd-trace-go - Files are byte-identical copies of Go reference fixtures
…cal cases - JUnit 5 @testfactory generates dynamic tests from 24 evaluation-case JSON files - Parses ufc-config.json into ServerConfiguration using Moshi with DateAdapter - Asserts both value and reason for each fixture case - Handles Java/Go divergences: Java returns ERROR where Go returns DEFAULT for missing flags and empty allocations - Skips null attribute values in context building (null = missing)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
DDEvaluatorhardcodesReason.TARGETING_MATCHfor all successful flag evaluations. The correct reason depends on the allocation structure:This aligns with the Go reference implementation and the OpenFeature spec.
Changes
DDEvaluator.java: AddedSplitparameter toresolveVariant()so it can inspect shards. Replaced hardcodedTARGETING_MATCHwith inline three-way ternary:!isEmpty(rules) ? TARGETING_MATCH : !isEmpty(shards) ? SPLIT : STATICDDEvaluatorTest.java: Updated 9 test assertions — 7 to STATIC, 2 to SPLIT. Added imports forReason.STATICandReason.SPLIT.Decisions
startAt/endAtare NOT reason signals — they are time-window pre-filters only