Skip to content

test: refresh shared FFE fixtures and metadata assertions - #429

Draft
leoromanovsky wants to merge 1 commit into
mainfrom
leoromanovsky/refresh-ffe-opt-out-fixtures-52
Draft

leoromanovsky wants to merge 1 commit into
mainfrom
leoromanovsky/refresh-ffe-opt-out-fixtures-52

Conversation

@leoromanovsky

Copy link
Copy Markdown
Collaborator

Motivation

The shared JS fixture runners do not check selected split IDs or logging decisions, leaving exposure and span-enrichment metadata outside their coverage. #423 also landed with an older revision of the shared opt-out fixtures.

Changes

Advance packages/core/test/ffe-system-test-data from 1c831fed02a428a1b0a4ac412da9b773e22df257 to b28876200152f00c7d5eb04616f721afa5955c1d, the current head of fixture PR #52. This includes merged fixture PR #53, with nine flag definitions and twelve serial-ID/logging cases.

Core and Node fixture runners now assert optional result.serialId and result.doLog expectations. Zero remains a valid ID, explicit null requires no ID, and omitted expectations impose no assertion. Repeated cases run in fixture order against the same configuration/provider.

Temporary pin: #52 is still open. Keep this PR as a draft until #52 merges, then replace the candidate pin with its merged commit and rerun the fixture suites before landing.

The backend deployment and coordinated package-release dependencies are tracked in #423. This follow-up changes test coverage only. Implementation and tests were prepared with AI assistance.

Test instructions

Run yarn workspace @datadog/flagging-core test --runInBand and yarn workspace @datadog/openfeature-node-server test --runInBand after initializing the fixture submodule and building core. The canonical fixture validator covers 361 baseline cases; core also runs 26 immediate and 42 future opt-out expectations. The twelve metadata cases run in both suites.

Core: 1,043 tests passed. Node: 544 tests passed. Core build, package and test type checks, lint, and formatting passed.

These checks exercise local evaluation metadata. They do not verify emitted trace tags or backend deployment.

Checklist

  • Updated Documentation
  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

Consume the latest candidate fixture revision and check serial IDs and logging decisions in core and Node, preserving repeated evaluations on the same configuration/provider.

Environment: Datadog workspace
@github-actions

Copy link
Copy Markdown

OpenFeature Browser Provider Bundle Sizes

Measured from the Vite production output after installing packed @datadog/flagging-core and @datadog/openfeature-browser tarballs.

Both scenarios initialize an OpenFeature provider, evaluate a boolean flag, change context, and evaluate again. Telemetry is disabled for DatadogProvider; no tracking hooks are registered for DatadogCoreProvider. DatadogProvider fetches precomputed assignments for each context; DatadogCoreProvider receives rules from fetchRulesConfiguration once and evaluates locally.

Sizes include OpenFeature and the same small scenario harness. Configuration responses are supplied by Playwright and are not bundled. These are complete scenario JS sizes, not configuration payload sizes or isolated provider/Protobuf costs; the difference between rows is not a decoder-only delta.

Scenario HTML JS Assets Raw JS Gzip JS Protobuf Markers
DatadogProvider (precomputed fetching) provider.html 19 97.7 KiB 35.8 KiB no
DatadogCoreProvider + fetchRulesConfiguration core-provider.html 15 165.1 KiB 51.7 KiB yes

Dependency checks passed: no Protobuf markers in default/precomputed scenarios; markers present in rules-based scenarios.

OpenFeature Browser Tracking Hook Bundle Sizes

Synthetic entrypoints import and call tracking hook factories from the packed @datadog/openfeature-browser/rules-based ESM package. Deltas are measured against the no-hook baseline from the same Vite production build.

Scenario HTML JS Assets Raw JS Raw Δ Gzip JS Gzip Δ
tracking hook baseline tracking-baseline.html 6 2.7 KiB 0 B 1.6 KiB 0 B
exposure logging hook tracking-exposure.html 14 65.3 KiB +62.6 KiB 24.8 KiB +23.2 KiB
evaluation logging hook tracking-evaluation.html 14 61.6 KiB +58.9 KiB 23.4 KiB +21.8 KiB
RUM tracking hook tracking-rum.html 10 6.8 KiB +4.1 KiB 3.7 KiB +2.1 KiB
all tracking hooks tracking-all.html 17 69.6 KiB +66.9 KiB 26.8 KiB +25.2 KiB

OpenFeature Node Server Bundle Sizes

Independent Webpack production builds of the installed core and Node SDK tarballs, targeting Node 18 with ESM (module export condition). Node built-ins remain external. OpenFeature, dd-trace, and configuration fixtures are not bundled.

Scenario Raw JS Gzip JS Protobuf Modules
Node provider only 39.1 KiB 12.5 KiB no
SSR helpers only (fetch client rules + serialize) 80.8 KiB 23.4 KiB yes
Node provider + SSR helpers 118.8 KiB 34.7 KiB yes

Adding SSR helpers to the provider adds 79.7 KiB raw / 22.2 KiB gzip in this build. This includes fetching, parsing, and serialization, not just the decoder. SSR helpers fetch rules for the browser, not for configuring that provider (which uses its existing JSON API).

These are bundler sizes, not npm install sizes, unbundled Node require/import costs, payload sizes, or latency. Gzip compares compressed artifacts. The browser scenarios include OpenFeature and a different harness, so their sizes are not directly comparable.

Dependency checks passed: no Protobuf runtime or generated schema modules in the provider-only bundle; present in both SSR bundles (checked using Webpack module statistics).

This report shows current PR artifact sizes only; it does not compare against the base branch.

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