-
Notifications
You must be signed in to change notification settings - Fork 6
feat!: Upgrade to LaunchDarkly.ServerSdk 7.0.0+ and implement support for building contexts. #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
README.md
Outdated
| ## OpenFeature Specific Considerations | ||
|
|
||
| When evaluating a `User` with the LaunchDarkly Server-Side SDK for .NET a string `key` attribute would normally be required. When using OpenFeature the `targetingKey` attribute should be used instead of `key`. If a `key` attribute is provided in the `EvaluationContext`, then it will be discarded in favor of `targetingKey`. If a `targetingKey` is not provided, or if the `EvaluationContext` is omitted entirely, then the `defaultValue` will be returned from OpenFeature evaluation methods. | ||
| LaunchDarkly evaluates contexts, and it can either evaluate a single-context, or a multi-context. When using OpenFeature both single and multi-contexts must be encoded into a single `EvaluationContext`. This is accomplished by looking an attribute named `kind` in the `EvaluationContext`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not have docs on the docs site yet for OpenFeature providers, so the README needs to be more elaborate to explain contexts and how you make them.
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="LaunchDarkly.ServerSdk" Version="[6.3.2,7.0)" /> | ||
| <PackageReference Include="LaunchDarkly.ServerSdk" Version="[7.0,8.0)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work with major versions until 8, which it should not work with.
| _client = client; | ||
| var logConfig = (config?.LoggingConfigurationFactory ?? Components.Logging()) | ||
| .CreateLoggingConfiguration(); | ||
| .Build(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is extremely questionable. I've not determined if there is anything else I can really do about it.
| .Set("anonymous", true).Build(); | ||
|
|
||
| var convertedUser = _converter.ToLdUser(evaluationContext); | ||
| var convertedUser = _converter.ToLdContext(evaluationContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left these tests mostly intact using User, and then added new a couple new tests.
Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
Requirements
Related issues
Provide links to any issues in this repository or elsewhere relating to this pull request.
Describe the solution you've provided
Provide a clear and concise description of what you expect to happen.
Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context about the pull request here.