fix(ffe): replace refreshed remote config - #9054
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes stale feature flags by replacing refreshed remote configurations at the same path while preserving merge precedence.
Changes:
- Replace existing path entries instead of appending duplicates.
- Add regression coverage confirming removed flags become unavailable after refresh.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tracer/src/Datadog.Trace/FeatureFlags/Rcm/FfeProduct.cs |
Replaces matching configurations in place. |
tracer/test/Datadog.Trace.Tests/FeatureFlags/FeatureFlagsModuleTests.cs |
Tests same-path refresh behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9054) and master. ✅ No regressions detected |
BenchmarksBenchmark execution time: 2026-08-14 06:17:41 Comparing candidate commit fa49fec in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 63 known flaky benchmarks, 63 flaky benchmarks without significant changes.
|
Summary of changes
Changes
Replace an existing FFE remote configuration when Remote Configuration refreshes the same path, instead of appending a second copy.
Reason for change
Motivation
FfeProductappended every successful update. When a refreshed UFC at the same path removed a flag, the stale earlier copy remained in the merged evaluator configuration, so customers could continue evaluating a flag that no longer existed.Implementation details
Decisions
Look up configurations by their Remote Configuration path and replace the existing entry in place. Replacing in place preserves the existing merge precedence across distinct configuration paths, while ensuring each path contributes only its latest contents.
New paths are still appended, and invalid updates keep the previously applied configuration through the existing failure path.
Test coverage
old-flag, refreshes the same path with onlynew-flag, then verifiesold-flagreturnsFLAG_NOT_FOUNDandnew-flagremains available.FeatureFlagsModuleTests: 2 passed onnet9.0.FeatureFlagsModuleTests: 2 passed onnetcoreapp3.1.Other details
This fixes a pre-existing refresh bug identified during the final review of #8616.