open-feature / go-sdk-contrib

Community maintained OpenFeature Providers and Hooks for Go
https://openfeature.dev
Apache License 2.0
40 stars 33 forks source link

[statsig] improve evaluation context to statsig user conversion #519

Closed beeme1mr closed 5 days ago

beeme1mr commented 1 month ago

Overview

The Statsig provider converts evaluation context to a Statsig user. However, it only supports directly mapping properties to what has been defined by a Statsig user. This makes interoperability impossible for providers that require a targetKey.

Proposal

### Tasks
- [ ] Map `targetingKey` to `UserID` if `UserID` is not set on the evaluation context
- [ ] Return a `NewTargetingKeyMissingResolutionError` if `UserID` is not defined on the Statsig user after the conversion.
- [ ] Map non-matching evaluation context properties under `Custom`

Resources

beeme1mr commented 1 month ago

FYI @liran2000

liran2000 commented 1 month ago

Yeah, it was done in Java provider, seems missing here.

liran2000 commented 6 days ago

@beeme1mr can be resolved, via #520.