-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Add experimental plugin support #139
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
- Add plugin metadata classes (PluginMetadata, SdkMetadata, ApplicationMetadata, EnvironmentMetadata) - Create abstract Plugin base class with GetMetadata(), Register(), and GetHooks() methods - Add PluginConfigurationBuilder and PluginConfiguration for plugin management - Integrate plugin support into Components, Configuration, and ConfigurationBuilder - Update LdClient to register plugins and collect their hooks during initialization - Follow plugin specification requirements for hook collection before registration - Maintain backward compatibility with existing hook system Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Fix plugin registration timing: move plugin registration after hook executor is configured - Add missing XML documentation summaries to PluginConfigurationBuilder class - Improve error handling and logging for plugin registration process Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
…nvironmentMetadata Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
| _configuration = config; | ||
|
|
||
| var logConfig = (config.Logging ?? Components.Logging()).Build(new LdClientContext(config.SdkKey)); | ||
| var logConfig = (_configuration.Logging ?? Components.Logging()).Build(new LdClientContext(_configuration.SdkKey)); |
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.
The use of config and _configuration was mixed throughout this method. Unifying it to use the instance property once it is set.
…y names - Address GitHub comment from jsonbailey about unifying config vs _configuration usage in LdClient constructor - Fix WrapperInfo compilation error by using correct property names (Name/Version instead of WrapperName/WrapperVersion) - Ensure consistent use of _configuration instance property throughout constructor method Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
- Complete constructor documentation for PluginMetadata and PluginConfiguration - Address GitHub PR comments about missing XML documentation - Ensure all plugin classes have comprehensive documentation following .NET conventions Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
|
The CI builds will fail until we publish an updated common nuget package first. I wanted to get feedback before splitting the common work into its own PR. |
pkgs/sdk/server/test/Integrations/PluginConfigurationBuilderTest.cs
Outdated
Show resolved
Hide resolved
|
Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it. |
| /// <summary> | ||
| /// Gets the application identifier. | ||
| /// </summary> | ||
| public string Id { get; } |
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 don't remember, do we use dotnet targets that support nullable reference types?
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.
Some do and some do not. Nullable reference types were introduced in C# 8 which is anything after 3.x and netstandard 2.1. We currently use C# 7.3 so that we can keep targeting netstandard 2.0 and net462.
🤖 I have created a release *beep* *boop* --- ## [8.10.0](LaunchDarkly.ServerSdk-v8.9.2...LaunchDarkly.ServerSdk-v8.10.0) (2025-07-11) ### Features * Add experimental plugin support ([#139](#139)) ([b34431e](b34431e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
feat: Add experimental plugin support
Summary
This PR implements experimental plugin support for the .NET Server SDK following the plugin specification. The implementation adds a complete plugin system including:
Pluginclass with metadata, registration, and hooks supportPluginConfigurationand builder pattern for plugin setupThe implementation follows established patterns from other LaunchDarkly SDK implementations and maintains backward compatibility.
Review & Testing Checklist for Human
configvs_configurationusage doesn't introduce regressions in configuration handlingName/Version) are correct and don't break wrapper functionalityRecommended test plan: Create a simple test plugin that implements all three methods (GetMetadata, Register, GetHooks), configure it via PluginConfigurationBuilder, and verify it integrates correctly with flag evaluations.
Diagram
graph TD LdClient[LdClient.cs]:::major-edit Plugin[Plugin.cs]:::major-edit PluginConfig[PluginConfiguration.cs]:::major-edit PluginBuilder[PluginConfigurationBuilder.cs]:::major-edit AppMeta[ApplicationMetadata.cs]:::major-edit SdkMeta[SdkMetadata.cs]:::major-edit EnvMeta[EnvironmentMetadata.cs]:::major-edit PluginMeta[PluginMetadata.cs]:::major-edit Components[Components.cs]:::minor-edit Config[Configuration.cs]:::minor-edit Hooks[Hook System]:::context EventProcessor[Event Processor]:::context DataSource[Data Source]:::context LdClient --> PluginConfig LdClient --> EnvMeta PluginConfig --> Plugin Plugin --> PluginMeta EnvMeta --> SdkMeta EnvMeta --> AppMeta PluginBuilder --> PluginConfig Components --> PluginConfig Config --> PluginConfig Plugin -.-> Hooks LdClient --> Hooks LdClient --> EventProcessor LdClient --> DataSource subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes