Skip to content

test(ffe): cover Node precomputed configuration fetching - #8630

Open
sameerank wants to merge 3 commits into
sameerank/node-core-provider-system-testsfrom
sameerank/node-precomputed-fetch-system-tests
Open

sameerank wants to merge 3 commits into
sameerank/node-core-provider-system-testsfrom
sameerank/node-precomputed-fetch-system-tests

Conversation

@sameerank

@sameerank sameerank commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add direct coverage for the Node fetchPrecomputedConfiguration() helper introduced in the merged openfeature-js-client #462. Verify request mapping and fetched snapshot consumption, rather than local rules precomputation.

Related PRs

PR Coverage Branch relationship
#8267 Produce precomputed snapshots locally from rules with precomputeConfiguration() Targets main; independent of the other two PRs
#8604 Consume portable rules/precomputed configurations with DatadogCoreProvider; codecs, lifecycle, updates, and opt-in exposure tracking Targets main; base for this PR
#8630 (this PR) Fetch precomputed snapshots over HTTP with fetchPrecomputedConfiguration() and consume them with the provider Stacked on #8604; does not depend on #8267

These are complementary slices, not a three-PR stack. Merge #8604 before this PR, then retarget this PR to main. #8267 can merge independently. This PR adds the fetch-specific slice; #8604 owns provider lifecycle and standalone codec coverage.

Changes

  • Exercise both Node SDK entry-point bundles shipped in the tracer package in fresh child processes, without loading or initializing the tracer or requiring its standalone development dependency.
  • Verify the SDK's original HTTPS origin/site and real HTTP method/path/query/headers/JSON:API body, target fingerprint query mapping, deeply immutable context binding, portable serialization, and evaluation through OpenFeature. Pair zero-event assertions with an explicitly enabled SDK exposure sink on the same observer.
  • Cover scripted plaintext/encoded responses, unsupported encoding rejection, false/null values and metadata, flag selection and diagnostics, immediate/future-only opt-out acknowledgments, invalid options, HTTP/transport/decode failures, redirects, deadlines and cancellation during headers/body delivery.
  • Extend the shared mock with a separate precomputed response timeline and detached POST-body capture. Reuse the existing rules transport-fault machinery. Self-tests cover raw JSON:API bytes, malformed/invalid-UTF-8 bodies without response consumption, redirect destinations, and wrong content types. Existing JSON/protobuf timelines remain independent.
  • Keep Node activation missing_feature; other SDK adapters remain incomplete_test_app. Report under portable configuration feature #562.

The mock's encoding, selection and opt-out outcomes are scripted: these tests pin SDK request mapping and response handling, not live Datadog evaluation, encoding negotiation, or rollout decisions. Future-only opt-out tests validate the helper/wire without asking the Node provider to implement that policy.

Activation And Remaining Work

The adapter loads the tracer's vendored root and /rules-based SDK bundles, matching #8604's provider probe. It bypasses the public tracer wrapper. Tracer-owned hook attachment and intake delivery are not part of this slice.

Before enabling the tests:

  1. Integrate containing Node/Core releases for the fetch helper and Allow tailing 0 to be a string in WAF output #469's provider into dd-trace-js, including normal and vendored dependencies and the regenerated vendor bundle.
  2. Add or verify the intended public tracer fetch/codec/provider flow against the actual bundled implementation, following the integration work described in test(ffe): add Node offline-provider harness #8604. These direct bundle probes do not verify public tracer forwarding.
  3. Run the full container-backed parametric tests against the actual packed tracer build, then update the Node manifest for a confirmed containing tracer release. No release version is assumed.

Review of this gated fetch coverage does not require enabling the tests.

Local Validation

  • Stacked on the rebased test(ffe): add Node offline-provider harness #8604 (1404bdce4d515f6f6a1fe74ef94de068d56c7521), which includes main at 943fc3a6b66656bff8fced2d30c84b383c89a05c.
  • 7 test groups / 55 fresh child processes passed on each of Node 18.20.8 and 20.20.2, with OpenFeature server SDK 1.19.0. Coverage includes mismatched opt-out acknowledgment modes and invalid opt-out timestamps that must not send a request.
  • Used locally built/packed Core 3.5.0 and Node 2.8.0 from #469 at d50b38c2. These are unreleased local artifacts, not a claim about npm releases.
  • Built separate root and /rules-based bundles using dd-trace-js's real Rspack runtime configuration, then ran the actual Python methods and Node adapter against the shared HTTP mock in a packed-like layout with no standalone Node SDK package available. The local dd-trace metadata is a resolution anchor, not a full tracer installation. The full container-backed parametric server, public tracer wrapper, and intake delivery were not run.
  • 48 mock and parametric-interface documentation regressions passed, including the existing rules-helper fixture tests. The six provider/codec groups also passed against the extended shared backend.
  • ./format.sh --check passed on a clean source snapshot, including mypy, Ruff, import policy, manifest/YAML validation, ShellCheck and the existing Node linter containers. JavaScript syntax checks passed.

For a custom test build containing the required Node/Core dependency:

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

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/parametric/test_ffe/test_precomputed_configuration.py             @DataDog/feature-flagging-and-experimentation-sdk
tests/test_the_test/test_mock_ffe_precomputed_backend.py                @DataDog/system-tests-reviewers
utils/build/docker/nodejs/parametric/ffe-precomputed-configuration.js   @DataDog/system-tests-reviewers
utils/mocked_backend/_ffe_precomputed.py                                @DataDog/system-tests-core
docs/understand/scenarios/parametric.md                                 @DataDog/system-tests-core
docs/understand/weblogs/parametric_weblog.md                            @DataDog/system-tests-core
manifests/cpp.yml                                                       @DataDog/system-tests-reviewers
manifests/dotnet.yml                                                    @DataDog/system-tests-reviewers
manifests/golang.yml                                                    @DataDog/system-tests-reviewers
manifests/java.yml                                                      @DataDog/system-tests-reviewers
manifests/nodejs.yml                                                    @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
manifests/python.yml                                                    @DataDog/system-tests-reviewers
manifests/ruby.yml                                                      @DataDog/system-tests-reviewers
manifests/rust.yml                                                      @DataDog/system-tests-reviewers
tests/ffe/README.md                                                     @DataDog/feature-flagging-and-experimentation-sdk
tests/test_the_test/test_mock_ffe_rules_backend.py                      @DataDog/system-tests-reviewers
utils/build/docker/nodejs/parametric/server.js                          @DataDog/system-tests-reviewers
utils/docker_fixtures/_test_clients/_test_client_parametric.py          @DataDog/system-tests-core
utils/mocked_backend/_backend_ffe.py                                    @DataDog/feature-flagging-and-experimentation-sdk @DataDog/system-tests-core
utils/mocked_backend/ffe.py                                             @DataDog/system-tests-core

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1c05831 | Docs | View more details | Give us feedback!

@sameerank sameerank added crucible: reviewing A Crucible review has started; this PR has reviewer attention. and removed crucible: reviewing A Crucible review has started; this PR has reviewer attention. labels Nov 20, 2026
Exercise both package entry points over real HTTP, context-bound codec round trips, fingerprint mapping, scripted encoding and selection responses, opt-out acknowledgments, and transport failures. Reuse the shared mock with an isolated precomputed timeline and keep CI activation gated.
Pair the standalone fetch zero-event check with an explicitly tracked SDK evaluation on the same channel, and measure the pre-tracking fetch phase separately.
@sameerank
sameerank force-pushed the sameerank/node-precomputed-fetch-system-tests branch from 13e2af6 to 6df409c Compare November 21, 2026 00:08
Load the tracer's vendored SDK entry points, observe the original request origin, and cover nested context snapshots plus opt-out validation. Exercise raw JSON:API bodies and transport fixtures in mock self-tests, and clarify activation dependencies.
@sameerank
sameerank marked this pull request as ready for review November 21, 2026 02:25
@sameerank
sameerank requested review from a team as code owners November 21, 2026 02:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T02:27:04.430333Z 1c05831 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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