fix(openfeature): map invalid FFE configs to parse errors#5948
Conversation
|
👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description. If changes need to be present in CHANGELOG.md you can state it this way **Change log entry**
Yes. A brief summary to be placed into the CHANGELOG.md(possible answers Yes/Yep/Yeah) Or you can opt out like that **Change log entry**
None.(possible answers No/Nope/None) Visited at: 2026-06-24 10:22:26 UTC |
BenchmarksBenchmark execution time: 2026-06-24 10:43:25 Comparing candidate commit 8727217 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 unstable metrics.
|
Motivation
The libdatadog v36 bump in #5928 changes invalid per-flag FFE configuration failures to surface through the native result as caller-default behavior. Ruby then reports OpenFeature evaluation metrics with
feature_flag.result.reason:defaultand noerror.type, which breaks the existing system-test contract for invalid regex and variant type mismatch cases.Changes
This adds a narrow compatibility shim in the OpenFeature native evaluator. When libdatadog returns the v36 invalid-flag sentinel (
DEFAULT, no error code, andflag configuration is invalid or unsupported), Ruby converts it into the existing OpenFeature parse-error resolution using the caller default value.The change also adds the missing OpenFeature constants and RBS updates needed for that mapping, plus a regression spec for the invalid-configuration case and a guard that ordinary default fallthrough still remains default behavior.
Decisions
The mapping stays at the OpenFeature evaluator boundary instead of metrics code, so provider resolution, hooks, exposure reporting, and metric tagging all see the same
ERROR/PARSE_ERRORresult. The check is intentionally narrow to avoid changing disabled flags, default allocations, or normal no-match fallthrough from libdatadog v36.Change log entry
Yes. Fix OpenFeature invalid FFE flag configurations to report parse errors instead of default evaluations.
Validation
bundle installbundle exec rake test:open_feature 2>&1 | tee /tmp/full_rspec.log | grep -E 'Pending:|Failures:|Finished' -A 99(ruby_3.2_openfeature_latest: 100 examples, 0 failures; ruby_3.2_openfeature_min: 100 examples, 0 failures)STANDARDOPTS="lib/datadog/open_feature/ext.rb lib/datadog/open_feature/native_evaluator.rb spec/datadog/open_feature/native_evaluator_spec.rb" bundle exec rake standardbundle exec rake steep:check