Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/understand/weblogs/parametric_weblog.md
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,32 @@ Response: not declared by the reference server. It contains `value`, `reason`, `
(see [Feature Flag evaluation provider status](../scenarios/parametric.md#feature-flag-evaluation-provider-status)),
and `exposureHooks` when requested.

#### `POST /ffe/core-provider`

Called by `ParametricTestClientApi.ffe_core_provider()`. Node.js-only fresh-process
portable-provider probe; it loads the `@datadog/openfeature-node-server/rules-based`
bundle that `dd-trace` ships under `vendor/dist`, without importing or initializing
the tracer. It does not require a separately installed Node provider package or
public tracer wrapper exports.

The request contains `operation` (`bootstrap`, `overlap`, `refresh`, `tracking`, `roundtrip`, or `invalid-codec`),
portable `wire`, and an array of evaluation `contexts`. `refresh` additionally takes
`replacementWire` and server-channel `fetchOptions`. The custom Fetch transport
uses `SYSTEM_TESTS_FFE_RULES_BASE_URL`, as for the standalone rules helper.
For `roundtrip`, `format: "rules"` retains the rules snapshot; any other value
precomputes it for `contexts[0]`. Hashed (version 2) keys require a `clientFingerprint`
advertising `assignment-encoding-flag-key-256-v1`; `format: "encoded"` alone does
not select key encoding. The response includes serialized/restored snapshots and evaluations.
`invalid-codec` accepts `invalidWires` and returns codec diagnostic categories,
replacement errors, and evaluations from the retained configuration.

The response reports actual OpenFeature startup/final status, operation results,
configuration-change notifications or explicit sink records, tracer/runtime
versions, and HTTP/exposure-channel counts observed until child-process exit.
An unexpected failure, process timeout, or invalid child output returns HTTP 500.
The parent strips `NODE_OPTIONS` and imposes a 10-second deadline.
This does not test tracer hook attachment or delivery to an intake.

#### `POST /ffe/fetch-rules-configuration`

Called by `ParametricTestClientApi.ffe_fetch_rules_configuration()`. Fetch and serialize portable rules in a process without tracer/provider initialization.
Expand Down
1 change: 1 addition & 0 deletions manifests/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ manifest:
tests/parametric/test_extract_behavior.py::Test_ExtractBehavior_Restart::test_baggage: missing_feature (Automatic baggage propagation is not implemented)
tests/parametric/test_extract_behavior.py::Test_ExtractBehavior_Restart_With_Extract_First::test_baggage: missing_feature (Automatic baggage propagation is not implemented)
tests/parametric/test_ffe/test_configuration_sources.py: irrelevant (cpp is not in scope for v1 agentless server SDK configuration-source coverage)
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: missing_feature
Expand Down
1 change: 1 addition & 0 deletions manifests/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,7 @@ manifest:
: # TODO: a lower version might be supported
- declaration: bug (FFL-3325)
component_version: <3.55.0
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: '>=3.36.0' # Modified by easy win activation script
Expand Down
1 change: 1 addition & 0 deletions manifests/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2348,6 +2348,7 @@ manifest:
tests/parametric/test_extract_behavior.py::Test_ExtractBehavior_Restart: incomplete_test_app (The parametric test app does not emit restart span links or preserve baggage)
tests/parametric/test_extract_behavior.py::Test_ExtractBehavior_Restart_With_Extract_First: missing_feature (DD_TRACE_PROPAGATION_EXTRACT_FIRST=true is unsupported; dd-trace-go panics when extraction fails)
tests/parametric/test_ffe/test_configuration_sources.py: v2.11.0-dev # Easy win for all weblogs and version 2.10.1
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: v2.5.0-dev
Expand Down
1 change: 1 addition & 0 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4385,6 +4385,7 @@ manifest:
? tests/parametric/test_ffe/test_configuration_sources.py::Test_Feature_Flag_Configuration_Source_Selection::test_stable_true_preserves_default_agentless
: v1.65.0
tests/parametric/test_ffe/test_configuration_sources.py::Test_Feature_Flag_Configuration_Source_Warm_State_Preservation: v1.65.0
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: v1.56.0
Expand Down
1 change: 1 addition & 0 deletions manifests/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2749,6 +2749,7 @@ manifest:
: # TODO: a lower version might be supported
- declaration: missing_feature (Requires a release containing dd-trace-js#11111)
component_version: <6.25.0
tests/parametric/test_ffe/test_core_provider.py: 'missing_feature (Requires a dd-trace-js release whose vendored openfeature-node-server bundle contains DatadogCoreProvider, openfeature-js-client#469)'
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: *ref_5_75_0
Expand Down
1 change: 1 addition & 0 deletions manifests/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,7 @@ manifest:
? tests/parametric/test_ffe/test_configuration_sources.py::Test_Feature_Flag_Configuration_Source_Selection::test_stable_true_preserves_default_agentless
: missing_feature (FFL-2705 tracks PHP agentless configuration-source implementation; FFL-2731 tracks system-tests configuration-source contract)
tests/parametric/test_ffe/test_configuration_sources.py::Test_Feature_Flag_Configuration_Source_Warm_State_Preservation: missing_feature (FFL-2705 tracks PHP agentless configuration-source implementation; FFL-2731 tracks system-tests configuration-source contract)
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: v1.21.0-dev
Expand Down
1 change: 1 addition & 0 deletions manifests/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3199,6 +3199,7 @@ manifest:
tests/parametric/test_ffe/test_configuration_sources.py: v4.14.0-dev
? tests/parametric/test_ffe/test_configuration_sources.py::Test_Feature_Flag_Configuration_Source_Missing_Api_Key::test_default_endpoint_fails_fast
: 'missing_feature (Requires a release containing dd-trace-py#21548)'
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release; dd-trace-py PR 21346)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC:
- declaration: irrelevant (Legacy coverage is pinned to Python 4.16.0)
Expand Down
1 change: 1 addition & 0 deletions manifests/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2736,6 +2736,7 @@ manifest:
tests/parametric/test_extract_behavior.py::Test_ExtractBehavior_Restart: incomplete_test_app (The parametric test app does not emit restart span links or preserve baggage)
tests/parametric/test_extract_behavior.py::Test_ExtractBehavior_Restart_With_Extract_First: incomplete_test_app (The parametric test app does not emit restart span links or preserve baggage)
tests/parametric/test_ffe/test_configuration_sources.py: v2.46.0-dev
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: v2.23.0
Expand Down
1 change: 1 addition & 0 deletions manifests/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ manifest:
tests/parametric/test_dynamic_configuration.py::Test_DynamicConfigSdkConfiguration::test_sdk_config_profiling_enabled: missing_feature (SDK_CONFIGURATION capability not yet implemented)
tests/parametric/test_extract_behavior.py: '>=0.4.1-dev'
tests/parametric/test_ffe/test_configuration_sources.py: irrelevant (rust is not in scope for v1 agentless server SDK configuration-source coverage)
tests/parametric/test_ffe/test_core_provider.py: incomplete_test_app (Standalone portable-provider endpoint is only implemented in Node.js)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Dependent_Flags_RC: missing_feature (Dependent flag support must be enabled with the SDK release)
tests/parametric/test_ffe/test_dependent_flags_rc.py::Test_FFE_Without_Dependent_Flags_RC: irrelevant (Requires a known legacy build without dependent flag support)
tests/parametric/test_ffe/test_dynamic_evaluation.py::Test_Feature_Flag_Dynamic_Evaluation: '>=0.5.3-dev+fd1307f' # TODO: a lower version might be supported
Expand Down
28 changes: 27 additions & 1 deletion tests/ffe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,33 @@ configuration copies are needed.

Standalone rules-configuration helpers are covered in `tests/parametric/test_ffe/test_rules_configuration.py` (Node.js only for now). These tests use `dd-trace/openfeature/rules-based` in a fresh process without initializing a tracer or provider, fetch protobuf over HTTP, and validate the portable wire output, channel credentials, typed errors, deadlines and cancellation during headers/body delivery, transport failures, invalid options, and redirect protection. They do not initialize a browser SDK or contact Datadog.

These tests report to [Offline initialization and portable configuration helpers (#562)](https://feature-parity.us1.prod.dog/?feature=562). Current coverage is limited to Node's rules-based fetching and serialization; precomputed helpers and provider offline initialization are not covered here.
These tests report to [Offline initialization and portable configuration helpers (#562)](https://feature-parity.us1.prod.dog/?feature=562).

`tests/parametric/test_ffe/test_core_provider.py` separately exercises the built Node
`DatadogCoreProvider` through the real OpenFeature SDK in fresh processes. It covers
synchronous READY registration, zero-request local evaluation, overlapping contexts
with different root/dependency values, explicit server-channel refresh, rejected
replacement retention, configuration-change events, and opt-in exposure sinks with
deduplication, a hook attached after startup, rollback when a later application
hook fails, and cache retention/reset for unchanged/changed configuration generations.
It also covers semantic codec round-trips for rules and plaintext/hashed precomputed
snapshots, metadata and context binding, and malformed/versioned input rejection.
These are bundled-SDK integration checks, not tracer evaluation-upload or intake-delivery tests.
The adapter loads the provider bundle that `dd-trace` ships under
`vendor/dist/@datadog/openfeature-node-server/rules-based`, without importing the
tracer; no public `dd-trace` wrapper exports are required. The Node manifest remains
`missing_feature` until a tracer release contains that provider in its vendor bundle;
other libraries are gated too.
With a custom containing Node build, select this file and force it with `-F`:

```sh
PYTEST_XDIST_AUTO_NUM_WORKERS=1 TEST_LIBRARY=nodejs ./run.sh PARAMETRIC \
tests/parametric/test_ffe/test_core_provider.py -F tests/parametric/test_ffe/test_core_provider.py
```

Fixture provenance and deterministic expected behavior are documented in
[`core-provider-rules-wire.md`](../parametric/test_ffe/core-provider-rules-wire.md).
Standalone precomputation helper coverage is a separate change in [#8267](https://github.com/DataDog/system-tests/pull/8267).

`Test_FFE_Rules_Configuration_Selection` covers tag/key-pattern query parameters on both distribution channels, invalid/URL-overflow selections dropped with diagnostics, quiet empty-selection omission, and retention of the full response when the backend ignores selection. It also checks diagnostics for nonempty `DD-Flag-Selection-Ignored` response headers, including unknown reasons. The mock does not implement backend filtering. These cases require [openfeature-js-client #445](https://github.com/DataDog/openfeature-js-client/pull/445) in the `dd-trace` dependency and remain gated in the Node manifest until a containing build is available. Other SDKs retain the existing file-level gate.

Expand Down
7 changes: 7 additions & 0 deletions tests/parametric/test_ffe/core-provider-rules-wire.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 1,
"rules": {
"response": "CgASBHByb2QacQoJdGVzdC1mbGFnEmQQBBoCKAEaBAgBKAAiKgoKYWxsb2NhdGlvbhABGgwSCgoEc2FsdBABGGQiCgoECAAQZBgHIAEoASIqCghmYWxsYmFjaxACGgwSCgoEc2FsdBABGGQiDAoECAAQZBABGAcgAigBGnIKDHByZXJlcXVpc2l0ZRJiEAQaAigBGgQIASgAIioKCmFsbG9jYXRpb24QABoMEgoKBHNhbHQQARhkIgoKBAgAEGQYByABKAEiKAoIZmFsbGJhY2saDBIKCgRzYWx0EAEYZCIMCgQIABBkEAEYByACKAEiBhIECgIIAyICCgAqAm9uKgNvZmYqAlVTKgdjb3VudHJ5KgxwcmVyZXF1aXNpdGUyBF5VUyQ6CQoBMQoBMgoBM0oFKgMSAQJKB1oFCAQSAQBKB1oFCAQSAQE=",
"etag": "rules-etag"
}
}
27 changes: 27 additions & 0 deletions tests/parametric/test_ffe/core-provider-rules-wire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Offline provider fixture

`core-provider-rules-wire.json` is a harness-specific derivative of the existing
`rules-wire.json`, originally from `openfeature-js-client/packages/browser/test/data/rules-v1-wire.json`.
The portable wire was generated with the rules codec at
[`d50b38c2`](https://github.com/DataDog/openfeature-js-client/commit/d50b38c2e4040946af79ec3d19f6483589a7ce13).
No credentials or customer configuration are included.

The decoded configuration has these deterministic rules:

| Flag | Condition | Value | Variant | Reason |
|--|--|--|--|--|
| `prerequisite` | `country` is `US` | `true` | `on` | `TARGETING_MATCH` |
| `prerequisite` | otherwise | `false` | `off` | `SPLIT` |
| `test-flag` | `prerequisite` has variant `on` | `true` | `on` | `TARGETING_MATCH` |
| `test-flag` | `prerequisite` has variant `off` | `false` | `off` | `SPLIT` |

Relative to `rules-wire.json`: add a boolean `off=false` variation and select it
in the fallback allocation; enable exposure logging for that allocation; clone
the flag as `prerequisite`; and give `test-flag`'s two allocations
`flagEvaluationStringMembership` conditions on `prerequisite`'s `on`/`off` variants.
Both flags use the original full 100-shard range, serial ID 7, and allocation keys.
The original fixture remains unchanged and is also used by the shared HTTP mock:
its fallback is `on=true`, so a successful server-channel refresh changes the value.

Expected values and subjects are asserted in Python, not computed by the adapter.
The adapter only deserializes the wire and uses the built package's public entry point.
Loading
Loading