Skip to content

feat(ffe): wire remote config lifecycle#3904

Closed
leoromanovsky wants to merge 1 commit into
leo.romanovsky/pr-h-native-bridgefrom
leo.romanovsky/pr-i-remote-config-lifecycle
Closed

feat(ffe): wire remote config lifecycle#3904
leoromanovsky wants to merge 1 commit into
leo.romanovsky/pr-h-native-bridgefrom
leo.romanovsky/pr-i-remote-config-lifecycle

Conversation

@leoromanovsky
Copy link
Copy Markdown

Motivation

Continue the OpenFeature PHP compatibility stack by wiring the native evaluator to Remote Config. This PR follows the libdatadog import pattern from #3630 so the tracer subscribes to FFE Remote Config payloads and hands them to datadog-ffe instead of parsing or evaluating rules in PHP.

Reference design doc: https://docs.google.com/document/d/1NvMfTpZWLBlFmEFNjdnlMyeVpy5l7KD8qujGFco6w2w/edit?tab=t.0

Stack base: #3903

Changes

  • Enables the ffe feature on datadog-remote-config.
  • Replaces positional ddog_init_remote_config bools with a named C-ABI flags struct.
  • Adds DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED, defaulting to false.
  • Subscribes to FFE_FLAGS plus FfeFlagConfigurationRules only when the experimental provider is enabled.
  • Stores and clears datadog_ffe::rules_based::Configuration on FFE Remote Config add/remove events.
  • Adds a dev-env PHPT for FFE Remote Config add/evaluate/remove lifecycle.

Decisions

  • Keep the Remote Config subscription behind DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=false so partially landed stack work does not surprise users.
  • Keep UFC parsing and rule evaluation owned by libdatadog/datadog-ffe; PHP only bridges config lifecycle and evaluation calls.
  • Mark the lifecycle PHPT as dev-env-only because it depends on request-replayer, matching existing Remote Config tests.

Validation

  • git diff --check
  • php -n -l tests/ext/ffe/remote_config_lifecycle.phpt
  • RUSTC_BOOTSTRAP=1 cargo check -p ddtrace-php
  • EXTRA_CFLAGS="-I$(brew --prefix pcre2)/include" EXTRA_LDFLAGS="-L$(brew --prefix pcre2)/lib" make -j"$(sysctl -n hw.ncpu)"
  • php -n -d extension=tmp/build_extension/modules/ddtrace.so -m | rg -i '^ddtrace$'
  • make test_c TESTS=tests/ext/ffe/native_bridge_evaluate.phpt
  • make test_c TESTS=tests/ext/ffe/remote_config_lifecycle.phpt skipped locally because request-replayer is not available outside the Datadog dev env.

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented May 22, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 17 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | API unit tests: [7.0]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). 1 failed test in ClientTest::testUnavailableRuntimeReturnsDefaultWithProviderNotReadyDetailsAndWarning. Expected string not identical to actual output at tests/api/Unit/FeatureFlags/ClientTest.php:107.

DataDog/apm-reliability/dd-trace-php | API unit tests: [7.1]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). 1 failed test. Error: Failed asserting that two strings are identical in ClientTest.php:107.

DataDog/apm-reliability/dd-trace-php | API unit tests: [7.2]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). 1 failed test. Error: Failed asserting that two strings are identical in ClientTest.php:107.

View all 17 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.74% (+0.04%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cae2759 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 22, 2026

Benchmarks [ tracer ]

Benchmark execution time: 2026-05-22 02:02:17

Comparing candidate commit cae2759 in PR branch leo.romanovsky/pr-i-remote-config-lifecycle with baseline commit d712d6b in branch leo.romanovsky/pr-h-native-bridge.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 194 metrics, 0 unstable metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant