Skip to content

test: cover null and empty targeting keys in shared fixtures - #41

Draft
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/ffe-empty-targeting-key
Draft

leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/ffe-empty-targeting-key

Conversation

@leoromanovsky

Copy link
Copy Markdown
Collaborator

Motivation

The common fixtures' existing empty-targeting-key case uses a static flag with no shards or rules, so it cannot catch an evaluator treating "" as missing during sharding or implicit id resolution. This gap surfaced while updating DataDog/dd-trace-dotnet#8384.

Changes

  • Add a sharded flag and cases for an empty targeting key (SPLIT) versus null (ERROR / TARGETING_KEY_MISSING).
  • Add an empty-id rule and cases for empty-key fallback (TARGETING_MATCH), null-key fallback (DEFAULT), and explicit id attributes taking precedence.
  • Document the six new cases in the fixture index.

Decisions

  • Use the existing evaluation-cases/*.json format so current canonical-fixture runners discover the cases.
  • Use a full-range shard to require hashing without tying this regression to a particular bucket, and ^$ to match only an empty id.
  • Keep the existing static and null-key fixtures. Consumers must preserve null instead of converting it to an empty string; the .NET runner correction is included in fix(openfeature): accept empty string as valid targeting key dd-trace-dotnet#8384.

Validation

  • python3 ci/validate-fixtures.py: 313 cases across 42 files passed.
  • Loaded the proposed JSON into dd-trace-dotnet at 66c3df873c (fix(openfeature): accept empty string as valid targeting key dd-trace-dotnet#8384): all 571 FeatureFlags tests passed on .NET 10, including the six new cases. Temporary snapshot changes were restored afterward.
  • Other SDK behavior remains subject to downstream validation; this local run does not establish cross-SDK compatibility.

Checklist

  • JSON files are valid.
  • New cases reference flags in ufc-config.json.
  • New flags have corresponding evaluation cases.
  • Expected results validated against the corrected .NET evaluator.

Add sharding and id fallback regressions, including explicit id precedence.

Environment: Datadog workspace
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