Repository navigation
[FFL-3364] Support flag selection in Node rules fetches - #445
Conversation
Add optional tag and key-pattern selection to both rules distribution channels, reuse core canonicalization, and fall back to unfiltered requests for invalid or oversized selections. Add regression and consumer type coverage plus SSR documentation. Refs: FFL-3364
OpenFeature Browser Provider Bundle SizesMeasured from the Vite production output after installing packed 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.
Dependency checks passed: no Protobuf markers in default/precomputed scenarios; markers present in rules-based scenarios. OpenFeature Browser Tracking Hook Bundle SizesSynthetic entrypoints import and call tracking hook factories from the packed
OpenFeature Node Server Bundle SizesIndependent Webpack production builds of the installed core and Node SDK tarballs, targeting Node 18 with ESM (
Adding SSR helpers to the provider adds 82.2 KiB raw / 23.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. |
Report malformed and over-limit selections as invalid_options, sanitize selection-read and encoding failures, and preserve the oversized-URL fallback. Add regression coverage and clarify selection behavior in the docs. Refs: FFL-3364
FFE reviewer selectionReviewers: @leoromanovsky, @vjfridge Why: Configuration scoping via tags — The PR adds an optional flagSelection option (tags and keyPatterns) to the Node fetchRulesConfiguration helper. Reviewers come from the matched pod. 🤖 Automated selection. Selection detailsInitiative: project / flag-tag-filtering Why this match: The PR adds an optional flagSelection option (tags and keyPatterns) to the Node fetchRulesConfiguration helper. It canonicalizes the selection with the core helper, sends it as repeated selected_flag_tags and selected_flag_key_patterns query parameters, and rejects invalid selections. A selection that would push the URL past 8192 bytes is not sent. This is tag- and name-based configuration filtering in the request path, matching the browser helper. The FlagSelection type export, README and typecheck updates support the same purpose. No openfeature-architecture supplemental area applies: provider lifecycle and evaluation metadata contracts are unchanged, and the Split/Feature additions in the regenerated rules-based.d.ts are generated declarations of fields already in core, with no runtime change.
The PR author was excluded. Existing reviewers and teams were preserved. Debug or fix a problemWorkflow run · Bits Code session
Evidence and run details✅ Complete — reviewer coverage verified. The workflow checked pending requests or submitted reviews on the evaluated head. Generated asynchronously by the FFE reviewer-routing workflow. Changed paths: Evaluated head: Registry revision: Pinned skill source: Instructions: workflow-injected snapshot (no plugin loaded) Instruction snapshot SHA-256: |
|
🤖 Comment from Claude Code working with @mark-caii Two things worth resolving before merge. The description is accurate to the code; these are about behaviour relative to the flag-selection RFC. 1. Invalid selections are rejected, which differs from the RFC and the browser SDK The RFC Requirements say that over a limit, the SDK drops the selection, requests the full UFC, and logs an error, and that the SDK MUST log an error when
The first commit (e67f128) dropped and fell back; the second switched to rejecting. The description attributes rejection to the ticket, but the FFL-3364 comment only asked to drop selections that would make the URL too long. Either align with the RFC (drop and fall back to the full configuration, as the browser does) or record the reject decision in the RFC and FFL-3364 so the two SDKs' documented contracts match. 2. Both fallbacks are silent When the URL would exceed 8192 bytes, and when the server ignores the selection, the caller gets no log, no telemetry, and no return signal. For SSR this means a page can embed the full client configuration (823 flags on staging vs a handful with the selection) without anyone noticing. The browser reports both cases with |
Drop invalid and oversized selections consistently with the browser contract. Report dropped and server-ignored selections through a configurable logger, with regression coverage and updated declarations. Ref: FFL-3364
Preserve both the standalone flag-selection documentation and the experimentation opt-out documentation from main.
mark-caii
left a comment
There was a problem hiding this comment.
🤖 Comment from Claude Code working with @mark-caii
Verified at 97a580b: invalid, malformed and over-long (8192-byte URL) selections are now dropped, the full configuration is fetched, and one error is logged through the new logger option. DD-Flag-Selection-Ignored is read only when a selection was sent and the response is 200, and its reason is logged verbatim. This matches the RFC and the browser SDK, so both points from my earlier comment are resolved.
Motivation
Addresses the flag-selection follow-up in FFL-3364. Node callers preparing rules configurations for SSR should be able to request a smaller payload using the same tag and key-pattern selection supported by the browser helper in #426.
Changes
flagSelection: { tags, keyPatterns }tofetchRulesConfigurationfor bothserverandclientdistribution channels.ConfigurationFetchErrorand codeinvalid_optionsbefore fetching. Selection-read and encoding failures are sanitized as well.FlagSelection, document SSR usage, fallback behavior, andFLAG_NOT_FOUNDfor unselected flags, and add 76 regression cases plus consumer type coverage.Test instructions
From a checkout with the pinned test-fixture submodules initialized:
Local validation on the latest changes passed:
Also validated during the initial implementation, before the validation/error-handling follow-up:
Fetch tests use fixture responses. No live staging requests or new end-to-end scenarios were run.
Checklist