test(openfeature): demonstrate span enrichment type mismatch attribution#4953
test(openfeature): demonstrate span enrichment type mismatch attribution#4953leoromanovsky wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8e5624783
ℹ️ 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".
| expected: &i.FeatureFlagEvaluation{ | ||
| FlagKey: "typed-flag", | ||
| DefaultValue: "fallback", | ||
| }, |
There was a problem hiding this comment.
Fix the failing span-enrichment test
With this new case, go test ./openfeature -run '^TestBuildEvaluation$/type_mismatch' -count=1 fails: the current buildEvaluation path still treats the non-empty variant plus serial metadata as an assignment and returns Subject/SerialID with no DefaultValue, so the test-only commit breaks the package test suite until the implementation change lands in the same change set.
Useful? React with 👍 / 👎.
BenchmarksBenchmark execution time: 2026-06-25 04:13:10 Comparing candidate commit d8e5624 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 298 metrics, 1 unstable metrics, 1 flaky benchmarks without significant changes.
|
Motivation
The span-enrichment implementation in the base PR currently trusts serial ID metadata before checking whether OpenFeature returned the caller default for a type mismatch. The existing evaluation logging path treats
TypeMismatchCodeas a runtime default even when a variant is present; this stacked PR captures the same expectation for span enrichment.Changes
TestBuildEvaluationcase where the evaluation details contain a variant and serial ID metadata, but also carryTypeMismatchCodeand the returned default value.Decisions
TypeMismatchCodebefore the serial-ID branch.Validation
go test ./openfeature -run '^TestBuildEvaluation$' -count=1fails on the new regression case: current code records subject/serial attribution and no default value.