You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Motivation
The PHP Feature Flags and Experimentation evaluation runtime has landed in dd-trace-php and is published through the `v1.21.0-dev` artifact. PHP should run the shared FFE system tests so the runtime path is covered by live `FFE_FLAGS` Remote Config delivery and by the canonical JSON evaluation fixtures used across libraries.
Reference design doc: https://docs.google.com/document/d/1NvMfTpZWLBlFmEFNjdnlMyeVpy5l7KD8qujGFco6w2w/edit?tab=t.0
## Changes
This PR enables the existing end-to-end `tests/ffe/test_dynamic_evaluation.py` suite for PHP starting at `v1.21.0-dev` and adds the minimal PHP weblog `/ffe` endpoint needed by that shared suite. The endpoint calls the `DDTrace\FeatureFlags\Client` details API, normalizes the request shape used by system-tests, and returns provider-not-ready defaults when the runtime is unavailable.
This PR also enables the parametric canonical JSON fixture evaluation suite for PHP. The PHP parametric server implements `/ffe/start` and `/ffe/evaluate` using the same Datadog client API, and OF.7 is covered through `test-case-of-7-empty-targeting-key.json` in the shared parametrized test.
## Decisions
The parametric evaluation test still sets `FFE_FLAGS` through Remote Config and waits for the test-agent to observe an acknowledged apply state. For the PHP parametric CLI process, that ACK is not enough to make the native evaluator report loaded config: CI on `1d6ac67` showed every dynamic evaluation case still returning `PROVIDER_NOT_READY` with `providerState.hasConfig == false` after the retry loop.
To keep the parametric suite deterministic, `/ffe/start` accepts the canonical UFC fixture payload uniformly. Existing non-PHP parametric servers ignore that optional payload; PHP uses it to seed the native evaluator through `DDTrace\Testing\ffe_load_config` before constructing the client. The shared test still has no PHP branch, and the explicit readiness check remains so failures show whether the provider is still waiting for config.
The scope is deliberately evaluation-only. Exposure forwarding and `feature_flag.evaluations` metrics remain disabled here so they can be enabled in separate stacked PRs after their runtime implementations are ready.
## Verification
Current branch checks:
```text
$ ./format.sh
All good, the system-tests CI will be happy!
```
```text
$ TEST_LIBRARY=php ./run.sh PARAMETRIC --skip-parametric-build tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation --collect-only -q
24 tests collected
```
The collected set includes `test-case-of-7-empty-targeting-key.json`, so OF.7 is covered by the generic JSON parametrization.
Copy file name to clipboardExpand all lines: docs/understand/weblogs/end-to-end_weblog.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1026,6 +1026,20 @@ The endpoint must accept a query string parameter `code`, which should be an int
1026
1026
This endpoint is used for client-stats tests to provide a separate "resource" via the endpoint path `stats-unique` to disambiguate those tests from other
1027
1027
stats generating tests.
1028
1028
1029
+
### POST /ffe
1030
+
1031
+
This endpoint is used by the Feature Flags & Experimentation scenario. It must
1032
+
accept a JSON body with these fields:
1033
+
1034
+
-`flag`: the feature flag key to evaluate.
1035
+
-`variationType`: the expected variation type.
1036
+
-`defaultValue`: the value to return when evaluation cannot resolve the flag.
1037
+
-`targetingKey`: the evaluation subject key.
1038
+
-`attributes`: flat scalar targeting attributes.
1039
+
1040
+
The response must be JSON and include at least `value` and `reason`. Error
1041
+
responses should also include `errorCode` and `errorMessage`.
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: '>=3.36.0'# Modified by easy win activation script
812
812
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation::test_ffe_flag_evaluation: missing_feature # Created by easy win activation script
813
-
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation::test_ffe_of7_empty_targeting_key: missing_feature # Created by easy win activation script
tests/parametric/test_parametric_endpoints.py::Test_Parametric_DDTrace_Baggage: missing_feature (baggage is not supported)
872
872
tests/parametric/test_parametric_endpoints.py::Test_Parametric_DDTrace_Current_Span: bug (APMAPI-778) # current span endpoint should return span and trace id of zero if no span is "active"
tests/parametric/test_parametric_endpoints.py::Test_Parametric_Otel_Baggage: missing_feature (otel baggage is not supported)
875
875
tests/parametric/test_parametric_endpoints.py::Test_Parametric_Otel_Current_Span: bug (APMAPI-778) # otel current span endpoint should return a span and trace id of zero if no span is "active"
0 commit comments