Skip to content

Add FFE exposure test EXP.5: treat missing targeting key as empty string#6040

Merged
leoromanovsky merged 5 commits into
mainfrom
leo/ffe-exp-5-missing-targeting-key
Jan 16, 2026
Merged

Add FFE exposure test EXP.5: treat missing targeting key as empty string#6040
leoromanovsky merged 5 commits into
mainfrom
leo/ffe-exp-5-missing-targeting-key

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

When targeting key is missing but evaluation produced result with doLog=true, the exposure events must be reported with subject.id = "".

This test catches a bug in Go tracer where empty targeting keys incorrectly skip exposure events instead of reporting them with an empty subject ID.

SDK Specification | EXP.5

Changes

  • Added Test_FFE_EXP_5_Missing_Targeting_Key test class in tests/ffe/test_exposures.py
    • Evaluates a flag with an empty targeting key ("")
    • Verifies the exposure event is generated with subject.id = ""
  • Marked test as known bug for Java and Node.js in manifest files:
    • manifests/java.yml: bug (FFL-1729) - OpenFeature Java SDK rejects empty targeting keys
    • manifests/nodejs.yml: bug (FFL-1730) - OpenFeature JS SDK rejects empty targeting keys
  • Go passes on v2.6.0-dev (fix merged: fix: [openfeature] allow empty targeting key in exposure events dd-trace-go#4361)

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

When targeting key is missing but evaluation produced result with doLog=true,
the exposure events must be reported with subject.id = "".

This test catches a bug in Go tracer where empty targeting keys incorrectly
skip exposure events instead of reporting them with an empty subject ID.
@github-actions

github-actions Bot commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/java.yml                                                      @DataDog/asm-java @DataDog/apm-java
manifests/nodejs.yml                                                    @DataDog/dd-trace-js
tests/ffe/test_exposures.py                                             @DataDog/feature-flagging-and-experimentation-sdk @DataDog/system-tests-core

The OpenFeature Java SDK rejects empty targeting keys due to an
isEmpty check in MutableContext.setTargetingKey(). A fix is pending:
open-feature/java-sdk#1291

The OpenFeature JS SDK similarly rejects empty targeting keys with
a falsy check (!subjectKey).

Until these upstream SDKs are fixed, the evaluation fails before
the tracer can even generate exposure events.
Use manifest-based bug declarations instead of @bug decorators
since the test framework requires manifest files for library-specific
skip reasons.

Java: OpenFeature SDK rejects empty targeting keys - fix pending
open-feature/java-sdk#1807

Node.js: OpenFeature SDK rejects empty targeting keys with falsy check
@leoromanovsky leoromanovsky force-pushed the leo/ffe-exp-5-missing-targeting-key branch from 0956e9b to 8b70bd8 Compare January 16, 2026 16:35
@leoromanovsky leoromanovsky marked this pull request as ready for review January 16, 2026 20:02
@leoromanovsky leoromanovsky requested review from a team as code owners January 16, 2026 20:02
@leoromanovsky leoromanovsky merged commit ae3a0d3 into main Jan 16, 2026
527 checks passed
@leoromanovsky leoromanovsky deleted the leo/ffe-exp-5-missing-targeting-key branch January 16, 2026 21:16
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.

3 participants