test(ffe): cover billed source precedence#7332
Conversation
|
|
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 2499246 | Docs | Datadog PR Page | Give us feedback! |
993b2b1 to
ca12c9a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 965e96e071
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
typotter
left a comment
There was a problem hiding this comment.
overall. lgtm.
+1 to the bot's comments around coverage gaps.
sameerank
left a comment
There was a problem hiding this comment.
Agreeing with the codex comments, but looks good to me otherwise!
|
PR Shepherd is now watching this PR: fixing basic CI failures, rebasing when it falls behind, and re-queueing after transient merge-queue failures. To disable it, add the If you have any questions, reach the team in #ai-devx-flow. |
|
/remove |
|
View all feedbacks in Devflow UI.
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
Motivation
Historically, a server-side tracer customer activated the Datadog OpenFeature provider with
DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true. That input implicitly placed the customer on the Agent'sFFE_FLAGSRemote Configuration path; there was no independent source-selection decision. Those users are an existing Remote Configuration cohort, not unconfigured new customers.The new model introduces CDN-backed agentless delivery as the default for customers with no legacy setting, while preserving the existing cohort during a migration window. The distinction is subtle but essential: legacy
truemust still select Remote Configuration, legacyfalsemust still disable Feature Flags, and an absent legacy value may select agentless. An explicitDD_FEATURE_FLAGS_CONFIGURATION_SOURCEoverrides the legacy value, whileDD_FEATURE_FLAGS_ENABLED=falseoverrides every source as the global kill switch.Both Remote Configuration and CDN requests are billing surfaces. The test contract must therefore prove not only which source wins, but when traffic begins: explicit or grandfathered RC can subscribe eagerly, whereas default agentless must remain silent until application code crosses the provider-access boundary. Without cross-SDK tests for both counters, a precedence change could silently move existing customers to CDN or generate phantom billed traffic for tracer users who never use Feature Flags.
flowchart TD Start["Tracer or agent starts"] --> Enabled{"DD_FEATURE_FLAGS_ENABLED"} Enabled -->|"false"| Silent["No provider<br/>No RC<br/>No CDN"] Enabled -->|"true or unset"| Source{"Resolve explicit source, then legacy state"} Source -->|"explicit or grandfathered RC"| RC["Observe FFE_FLAGS capability and product"] Source -->|"agentless or new default"| Boundary["Assert zero startup requests"] Source -->|"legacy false, reserved offline, or invalid"| Silent Boundary --> StartFFE["POST /ffe/start"] StartFFE --> CDN["Observe mock CDN request"] RC --> Assert["Assert exactly one billed delivery path"] CDN --> Assert Silent --> AssertChanges
DD_FEATURE_FLAGS_ENABLEDkill switch, default agentless activation, explicit billed-source opt-ins, the legacy migration window, and absent/empty/whitespace source equivalence.offlinevalue.remote_configwhen it validates theFFE_FLAGSRemote Configuration capability.Decisions
DD_FEATURE_FLAGS_ENABLED=falseis the first precedence rule and must suppress both CDN polling and the Feature Flags Remote Configuration subscription.DD_FEATURE_FLAGS_ENABLED=true, or leaving it unset, does not itself generate traffic; it permits source resolution.DD_FEATURE_FLAGS_CONFIGURATION_SOURCEwins over the legacy variable.trueselects Remote Configuration, legacyfalsedisables Feature Flags, and an absent legacy variable selects default agentless delivery./ffe/startcrosses the application provider-access boundary.agentlessandremote_configare the only supported sources today.offlineis reserved for future startup-provided UFC bytes. Until implemented, selecting it must fail closed with no CDN or RC traffic.Validation
System-tests head:
2499246536723f242911097124aa251e078ddc5a.The same 19 source-selection cases and one slow-poller concurrency case were executed against the exact stacked Node.js and Java implementation heads.
Node.js implementation
Validated local tracer head:
f62b5ec43d35284b2d0508a00209437ee911a01e(committed locally; its separate Node.js PR push is pending).binaries/nodejs-load-from-localmounted../dd-trace-js-node-configuration-contract, whose checked-out head was the commit above.Result: 20 passed in 25.81s.
The new reserved-
offlinecase was also run independently: 1 passed in 11.87s.Java implementation
Validated tracer head:
7647879607f741c5961a450932c6a323689580a8.The Java parametric image reported
java@1.65.0-SNAPSHOT+7647879607, proving that it loaded the agent built from the commit above.Result: 20 passed in 35.23s.
The new reserved-
offlinecase was also run independently: 1 passed in 13.08s.Behavior proven by both SDK matrices
remote_configFFE_FLAGScapability/product, and sends zero CDN requests.falsewith explicit RC/ffe/start, evaluates the expected value and sends the authenticated request to the expected CDN path.truewith no sourcetruefalsewith legacytruefalsetruefalsefalsewith default agentlessofflinesourcemax_in_flight == 1, proving requests do not overlap.