Repository navigation
fix(multi): preserve provider reason on successful evaluations - #632
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Preserve reasons in multi-provider evaluations openfeature/multi/isolation.go, openfeature/multi/isolation_test.go |
The conversion retains the provider’s reason when no error code is set and returns a general resolution error in the default branch. Tests check successful evaluations retain reason, variant, and flag metadata without producing an error. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related PRs
- open-feature/go-sdk#631: It changes the same conversion path to preserve provider reasons and map error codes.
Suggested reviewers: erka
Merge Risk: 
Minimal · up to 37d4b
-
The PR meets its stated goal without an established merge-blocking regression.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#626requires preserving the providerReasonon successful multi-provider evaluations and returningERRORonly for error codes.toProviderResolutionDetailnow copiesevalDetails.ReasonwhenErrorCodeis empty and keeps the error mapping for error paths. Tests cover the conversion andHookIsolatorpath, including reason, variant, metadata, and no error.
Full details: Out of Scope Changes check
-
Explanation
The pull request changes only
openfeature/multi/isolation.goand its focused test file. The implementation and tests directly support issue#626. No unrelated changes are present in the reviewed diff.
-
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #632 +/- ##
=======================================
Coverage 90.93% 90.93%
=======================================
Files 22 22
Lines 2239 2240 +1
=======================================
+ Hits 2036 2037 +1
Misses 164 164
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
toProviderResolutionDetail only set reason inside the error-code switch, dropping the underlying provider reason (e.g. TARGETING_MATCH) on success. Preserve evalDetails.Reason when no error code is set; ERROR is still set only on error paths. Fixes open-feature#626 Signed-off-by: Anurag-S1ngh <anuragsingh2313@gmail.com>
Head branch was pushed to by a user without write access
dc6a6bf to
938bad5
Compare
|
Thanks @Anurag-S1ngh! |
Fixes #626
When a flag is evaluated successfully through the multi provider,
toProviderResolutionDetailreturned an emptyReasonbecause it onlyset
reasoninside the error-code switch.Preserve
evalDetails.Reasonwhen no error code is set;ERRORis stillset only on error paths.
Tests:
Test_toProviderResolutionDetail_PreservesSuccessReasonTest_HookIsolator_PreservesSuccessReasongo test -tags testtools -short -race ./openfeature/...green