feat(openfeature): activate delivery during provider initialization - #6295
pavlokhrebto wants to merge 13 commits into
Conversation
|
Thank you for updating Change log entry section 👏 Visited at: 2026-09-09 09:35:43 UTC |
Typing analysisNote: Ignored files are excluded from the next sections. Untyped methodsThis PR introduces 1 partially typed method. It increases the percentage of typed methods from 71.71% to 71.92% (+0.21%). Partially typed methods (+1-0)❌ Introduced:Untyped other declarationsThis PR introduces 1 partially typed other declaration. It increases the percentage of typed other declarations from 86.09% to 86.22% (+0.13%). Partially typed other declarations (+1-0)❌ Introduced:If you believe a method or an attribute is rightfully untyped or partially typed, you can add |
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 6da2a15 | Docs | View more details | Give us feedback! |
There was a problem hiding this comment.
🟡 Changes recommended
The system-tests.yml reusable workflow call is no longer pinned to an immutable commit SHA, which is a supply-chain and reproducibility risk for CI.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR wires the OpenFeature provider’s initialization lifecycle to Datadog Feature Flags configuration delivery: adopting a provider now activates the configured delivery source, waits for the first valid configuration (or times out), and emits OpenFeature SDK provider events to reflect readiness/error transitions. It also introduces runtime Remote Configuration registration and receiver updates so Feature Flags capabilities can be enabled dynamically when the provider is adopted.
Changes:
- Add
Datadog::OpenFeature::Activationto manage eager Remote Configuration start vs. lazy agentless delivery start on provider adoption, and to forward component configuration-change events to the provider. - Update
Datadog::OpenFeature::Provider#initto activate delivery, block until initial configuration (with timeout/error reporting), and emit OpenFeature SDK events (PROVIDER_ERROR,PROVIDER_READY,PROVIDER_CONFIGURATION_CHANGED). - Extend Remote Configuration runtime plumbing (dispatcher, component, capabilities) to support idempotent receiver/capability registration for already-running clients.
File summaries
| File | Description |
|---|---|
| vendor/rbs/openfeature-sdk/0/openfeature-sdk.rbs | Expand vendored OpenFeature SDK stubs to cover event emitter, provider events/state, and configuration handlers used by the provider lifecycle. |
| spec/datadog/open_feature/provider_spec.rb | Add provider initialization and event-ordering coverage (timeout/error then late recovery, config-changed emission). |
| spec/datadog/open_feature/provider_span_enrichment_spec.rb | Update provider installation path to account for initialization waiting/activation behavior. |
| spec/datadog/open_feature/component_spec.rb | Update component build signature and add expectations for configuration-change callback behavior. |
| spec/datadog/open_feature/activation_spec.rb | New spec suite covering activation idempotency, concurrency serialization, delivery source selection, and shutdown behavior. |
| spec/datadog/open_feature_spec.rb | Adjust expectations to reflect engine build vs. delivery/provider adoption timing. |
| spec/datadog/core/remote/dispatcher_spec.rb | Add coverage for dynamic receiver registration and receiver collection encapsulation. |
| spec/datadog/core/remote/component_spec.rb | Add coverage ensuring runtime register updates both future and current client dispatchers/capabilities. |
| spec/datadog/core/remote/client/capabilities_spec.rb | Update base64 helper signature usage and add coverage for runtime registration idempotency/atomicity. |
| spec/datadog/core/configuration/components_state_spec.rb | Add coverage for persisting adopted OpenFeature provider across component-tree replacement. |
| spec/datadog/core/configuration/components_spec.rb | Add coverage for eager OpenFeature delivery start and provider reactivation from prior component state. |
| sig/datadog/open_feature/provider.rbs | Type provider initialization state, OpenFeature event emitter inclusion, and internal lifecycle helpers. |
| sig/datadog/open_feature/component.rbs | Add configuration event type and callback typing for configuration-change notifications. |
| sig/datadog/open_feature/activation.rbs | New RBS for Activation API and its delivery-start helpers. |
| sig/datadog/core/remote/dispatcher.rbs | Type the new receiver encapsulation and runtime receiver registration methods. |
| sig/datadog/core/remote/component.rbs | Type new register API for runtime Remote Configuration capability/receiver updates. |
| sig/datadog/core/remote/client/capabilities.rbs | Type runtime registration and adjust the base64 helper signature to accept explicit capabilities. |
| sig/datadog/core/configuration/components.rbs | Update component API surface for OpenFeature activation and startup state carry-over. |
| sig/datadog/core/configuration/components_state.rbs | Add open_feature_provider state typing for component-tree replacement behavior. |
| lib/datadog/open_feature/provider.rb | Implement initialization lifecycle: activate delivery, wait for initial config, handle timeouts, and emit OpenFeature SDK events. |
| lib/datadog/open_feature/component.rb | Add configuration-change event reporting and callback forwarding from reconfigure!. |
| lib/datadog/open_feature/activation.rb | New activation orchestrator to start selected delivery source and bridge component events to the adopted provider. |
| lib/datadog/core/remote/dispatcher.rb | Encapsulate receiver list and add thread-safe runtime receiver registration. |
| lib/datadog/core/remote/component.rb | Add register to update both future client capabilities and the current client dispatcher. |
| lib/datadog/core/remote/client/capabilities.rb | Add atomic runtime registration (capabilities/products/receivers) and synchronize access to capability state/base64. |
| lib/datadog/core/configuration/components.rb | Replace direct OpenFeature component construction with activation-driven lifecycle; persist adopted provider in state and reactivate after rebuild. |
| lib/datadog/core/configuration/components_state.rb | Persist adopted OpenFeature provider across component tree replacements. |
| .github/workflows/system-tests.yml | Update system-tests workflow reference (currently to a branch ref). |
Review details
Suppressed comments (4)
sig/datadog/core/remote/client/capabilities.rbs:27
- These method return types also use unnecessary
::prefixes for core types; preferArray[...]/Integer/Stringwithout::for consistency with other signatures in this repo.
def capabilities: () -> ::Array[::Integer]
def products: () -> ::Array[::String]
def receivers: () -> ::Array[Core::Remote::Dispatcher::Receiver]
sig/datadog/core/remote/client/capabilities.rbs:35
- Keyword argument types here also don’t need
::prefixes for core classes; usingArray[Integer]/Array[String]keeps the signatures aligned with repo conventions.
def register_runtime: (
capabilities: ::Array[::Integer],
products: ::Array[::String],
receivers: ::Array[Core::Remote::Dispatcher::Receiver]
) -> void
sig/datadog/core/configuration/components_state.rbs:17
- This keyword arg type can also drop the redundant
Datadog::prefix within theDatadognamespace (OpenFeature::Provider?).
?open_feature_provider: Datadog::OpenFeature::Provider?
sig/datadog/core/configuration/components_state.rbs:26
- The
attr_readertype should beOpenFeature::Provider?here as well for consistency (no redundantDatadog::prefix inside theDatadogmodule).
attr_reader open_feature_provider: Datadog::OpenFeature::Provider?
- Files reviewed: 27/28 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8601fb1164
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
0aa28d6 to
e47bd59
Compare
What does this PR do?
Activates the selected Feature Flags configuration source when the Datadog OpenFeature provider initializes and waits for the first valid configuration. It reports initialization timeouts as provider errors, supports late recovery to ready, emits configuration-change events, and dynamically registers Remote Configuration capabilities and receivers.
Configuration activation is owned by the Datadog component tree, including preservation of the adopted provider across
Datadog.configurecomponent rebuilds.Motivation:
This layer connects the configuration, readiness, and delivery primitives introduced by the preceding PRs to the public OpenFeature provider. Provider replacement, fork recovery, configuration-loss events, and Remote Configuration synchronization were extracted into #6323 so both PRs remain focused and reviewable.
Change log entry
Yes. Adds agentless configuration delivery and initialization lifecycle support to the Datadog OpenFeature provider.
Additional Notes:
Warning
This is PR 4 of a 5-PR stack. It contains code that depends on its parent PRs and is completed by #6323; it must not be merged directly into
master.Merge the stack last-to-first: #6323 into #6295, #6295 into #6294, #6294 into #6292, #6292 into #6291, and finally #6291 into
master.The five PRs are split only to allow focused reviews and will land atomically as one feature.
How to test the change?
StandardRB and full Steep type checking pass. The OpenFeature rake suite passes on Ruby 3.1 and Ruby 4.0. Targeted activation, provider initialization, component-tree, Remote Configuration registration, dispatcher, and component-state coverage is included.