Skip to content

fix(openfeature): ignore inactive experimentation opt-out attribute - #21172

Draft
leoromanovsky wants to merge 1 commit into
mainfrom
leo/ffe-context-20261021
Draft

leoromanovsky wants to merge 1 commit into
mainfrom
leo/ffe-context-20261021

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Flag evaluation returns INVALID_CONTEXT when dd_experimentation_opt_out_at contains an object or array. Default evaluation must ignore this reserved attribute.

Exclude the attribute before native context conversion. Preserve the caller context and validation of other attributes.

Testing

  • Six regression cases pass on Python 3.13; four fail with the original converter. They cover object and array values, dictionary context formats, unchanged caller data, targeting, and errors in other attributes.
  • Repository lint checks pass.
  • Full OpenFeature suite: 1,103 passed on Python 3.11 and 1,103 passed on Python 3.13.
  • system-tests FFE suite against this local source commit: 80 passed, 17 expected failures. All 44 canonical fixture groups (345 cases) passed. The runner reports the image package version, 4.16.0; the provider imports the mounted source at 40b3304e.

Risks

Immediate experimentation opt-out remains unsupported. Enabling it requires replacing this default-mode filtering with capability-aware validation.

Additional Notes

Addresses the Python context failures in system-tests#8139. The canonical baseline expectations remain unchanged.

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against main using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

ddtrace/internal/openfeature/_native.py                                 @DataDog/feature-flagging-and-experimentation-sdk
releasenotes/notes/fix-openfeature-ignored-opt-out-730d09ca3b31c06e.yaml  @DataDog/apm-python
tests/openfeature/test_provider.py                                      @DataDog/feature-flagging-and-experimentation-sdk

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 133 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 133 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=119)
ddtrace.internal.test_visibility.api -×-> ddtrace.trace  (product:ci_visibility -> product:tracing, score=117)
ddtrace.llmobs._integrations.openai_agents -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=117)
ddtrace.llmobs._telemetry -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=117)
ddtrace.llmobs._integrations.anthropic -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=117)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

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