[FFE] Bump OpenFeature shim package to match OpenFeature#8198
[FFE] Bump OpenFeature shim package to match OpenFeature#8198daniel-romano-DD merged 6 commits intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cbe707800
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
BenchmarksBenchmark execution time: 2026-02-17 09:46:49 Comparing candidate commit 359bfe3 in PR branch Found 5 performance improvements and 9 performance regressions! Performance is the same for 163 metrics, 15 unstable metrics. scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1
scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
|
leoromanovsky
left a comment
There was a problem hiding this comment.
very nice; thanks for adjusting the api to the openfeature spec
| } | ||
|
|
||
| var value = typeof(T) == typeof(Value) ? JsonToValue(evaluation.Value as string) : evaluation.Value!; | ||
| var value = typeof(T) == typeof(Value) ? JsonToValue(evaluation.Value) : evaluation.Value!; |
andrewlock
left a comment
There was a problem hiding this comment.
Thanks! a few suggestions, and one question, but LGTM overall 👍
| private static Value ConvertObject(object? obj) | ||
| { | ||
| switch (token.Type) | ||
| if (obj is Dictionary<string, object?> dic) | ||
| { | ||
| case JTokenType.Object: | ||
| return new Value(ConvertObject((JObject)token)); | ||
| case JTokenType.Array: | ||
| return new Value(ConvertArray((JArray)token)); | ||
| case JTokenType.Integer: | ||
| return new Value((long)token); | ||
| case JTokenType.Float: | ||
| return new Value((double)token); | ||
| case JTokenType.String: | ||
| return new Value((string)token); | ||
| case JTokenType.Boolean: | ||
| return new Value((bool)token); | ||
| case JTokenType.Null: | ||
| return new Value(); | ||
| default: | ||
| return new Value(); | ||
| return ConvertStructure(dic); | ||
| } | ||
| } | ||
|
|
||
| private static Structure ConvertObject(JObject obj) | ||
| { | ||
| var dict = new Dictionary<string, Value>(); | ||
| foreach (var property in obj.Properties()) | ||
| else if (obj is object?[] arr) | ||
| { | ||
| return ConvertArray(arr); | ||
| } | ||
| else if (obj is long intVal) | ||
| { | ||
| return new Value(intVal); | ||
| } | ||
| else if (obj is double doubleVal) | ||
| { | ||
| dict.Add(property.Name, ConvertToken(property.Value)); | ||
| return new Value(doubleVal); | ||
| } | ||
| else if (obj is string strVal) | ||
| { | ||
| return new Value(strVal); | ||
| } | ||
| else if (obj is bool boolVal) | ||
| { | ||
| return new Value(boolVal); | ||
| } | ||
| else | ||
| { | ||
| return new Value(); | ||
| } | ||
| } |
There was a problem hiding this comment.
nit: switch expressions make this much nicer😄
| private static Value ConvertObject(object? obj) | |
| { | |
| switch (token.Type) | |
| if (obj is Dictionary<string, object?> dic) | |
| { | |
| case JTokenType.Object: | |
| return new Value(ConvertObject((JObject)token)); | |
| case JTokenType.Array: | |
| return new Value(ConvertArray((JArray)token)); | |
| case JTokenType.Integer: | |
| return new Value((long)token); | |
| case JTokenType.Float: | |
| return new Value((double)token); | |
| case JTokenType.String: | |
| return new Value((string)token); | |
| case JTokenType.Boolean: | |
| return new Value((bool)token); | |
| case JTokenType.Null: | |
| return new Value(); | |
| default: | |
| return new Value(); | |
| return ConvertStructure(dic); | |
| } | |
| } | |
| private static Structure ConvertObject(JObject obj) | |
| { | |
| var dict = new Dictionary<string, Value>(); | |
| foreach (var property in obj.Properties()) | |
| else if (obj is object?[] arr) | |
| { | |
| return ConvertArray(arr); | |
| } | |
| else if (obj is long intVal) | |
| { | |
| return new Value(intVal); | |
| } | |
| else if (obj is double doubleVal) | |
| { | |
| dict.Add(property.Name, ConvertToken(property.Value)); | |
| return new Value(doubleVal); | |
| } | |
| else if (obj is string strVal) | |
| { | |
| return new Value(strVal); | |
| } | |
| else if (obj is bool boolVal) | |
| { | |
| return new Value(boolVal); | |
| } | |
| else | |
| { | |
| return new Value(); | |
| } | |
| } | |
| private static Value ConvertObject(object? obj) => obj switch | |
| { | |
| Dictionary<string, object?> dic => ConvertStructure(dic), | |
| object?[] arr => ConvertArray(arr), | |
| long intVal => new Value(intVal), | |
| double doubleVal => new Value(doubleVal), | |
| string strVal => new Value(strVal), | |
| bool boolVal => new Value(boolVal), | |
| _ => new Value() | |
| }; |
tracer/src/Datadog.FeatureFlags.OpenFeature/Datadog.FeatureFlags.OpenFeature.csproj
Outdated
Show resolved
Hide resolved
tracer/src/Datadog.FeatureFlags.OpenFeature/Datadog.FeatureFlags.OpenFeature.csproj
Show resolved
Hide resolved
| #if !NETCOREAPP2_1 | ||
|
|
There was a problem hiding this comment.
Leftover from tests. Removed
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8198) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (69ms) : 67, 71
master - mean (69ms) : 67, 71
section Bailout
This PR (8198) - mean (73ms) : 72, 74
master - mean (73ms) : 71, 75
section CallTarget+Inlining+NGEN
This PR (8198) - mean (1,043ms) : 985, 1100
master - mean (1,048ms) : 976, 1119
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (115ms) : 112, 118
master - mean (115ms) : 112, 119
section Bailout
This PR (8198) - mean (116ms) : 114, 118
master - mean (116ms) : 115, 118
section CallTarget+Inlining+NGEN
This PR (8198) - mean (772ms) : 710, 834
master - mean (781ms) : 741, 820
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (102ms) : 100, 104
master - mean (102ms) : 99, 104
section Bailout
This PR (8198) - mean (102ms) : 101, 104
master - mean (103ms) : 101, 104
section CallTarget+Inlining+NGEN
This PR (8198) - mean (757ms) : 734, 781
master - mean (759ms) : 738, 781
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (94ms) : 91, 96
master - mean (93ms) : 91, 96
section Bailout
This PR (8198) - mean (95ms) : 93, 97
master - mean (95ms) : 93, 96
section CallTarget+Inlining+NGEN
This PR (8198) - mean (639ms) : 629, 650
master - mean (634ms) : 622, 647
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (193ms) : 189, 198
master - mean (191ms) : 188, 195
section Bailout
This PR (8198) - mean (196ms) : 194, 198
master - mean (195ms) : 192, 198
section CallTarget+Inlining+NGEN
This PR (8198) - mean (1,140ms) : 1092, 1189
master - mean (1,135ms) : 1093, 1177
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (288ms) : 281, 295
master - mean (287ms) : 282, 293
section Bailout
This PR (8198) - mean (288ms) : 283, 293
master - mean (288ms) : 282, 293
section CallTarget+Inlining+NGEN
This PR (8198) - mean (966ms) : 914, 1018
master - mean (963ms) : 914, 1013
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (268ms) : 264, 272
master - mean (269ms) : 265, 273
section Bailout
This PR (8198) - mean (269ms) : 264, 273
master - mean (269ms) : 264, 275
section CallTarget+Inlining+NGEN
This PR (8198) - mean (921ms) : 885, 957
master - mean (924ms) : 896, 951
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8198) - mean (278ms) : 274, 283
master - mean (279ms) : 272, 286
section Bailout
This PR (8198) - mean (280ms) : 275, 284
master - mean (279ms) : 275, 282
section CallTarget+Inlining+NGEN
This PR (8198) - mean (860ms) : 839, 880
master - mean (857ms) : 837, 877
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
…orms and remove Newtonsoft dependency
…gs.OpenFeature.csproj Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
…gs.OpenFeature.csproj Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
e6bffcb to
359bfe3
Compare
Summary of changes
OpenFeatureshim package to match the TFMs of the OpenFeature package directlyReason for change
OpenFeaturepackage, which can lead to build warnings and weird dependency behaviours. Given this is meant to be a thin wrapper forOpenFeature, we should match the TFMs they useImplementation details
Test coverage
Other details