Skip to content

feat(sdk): make evaluation result variant required and nullable#7726

Merged
gagantrivedi merged 1 commit into
mainfrom
feat/evaluation-result-variant-required
Jun 8, 2026
Merged

feat(sdk): make evaluation result variant required and nullable#7726
gagantrivedi merged 1 commit into
mainfrom
feat/evaluation-result-variant-required

Conversation

@gagantrivedi

Copy link
Copy Markdown
Member

Follow-up to #7704 (now merged). Aligns the schema with the always-present-nullable variant implemented in Flagsmith/flagsmith-engine#314 and Flagsmith/engine-test-data#56.

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature. (SDK-facing docs land with the SDK slice.)
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

#7704 added variant to FlagResult as an optional string. Since then we settled on the OpenFeature-faithful shape: variant is always present, nullable — matching ResolutionDetails.variant (str | None), which is always a field on the details object.

This makes the schema match the engine/corpus:

  • FlagResult.variant becomes required.
  • Its type becomes ["string", "null"].

Semantics: the variant's key when a named multivariate variant is selected, "control" when the identity falls in the control bucket, or null when no multivariate split applied (a standard feature, an unkeyed variant, or evaluation without an identity).

FeatureValue.key in the context schema (the input) stays optional — only the output variant is always-present.

How did you test this code?

Follow-up to #7704. The flag engine and SDKs always populate `variant`
(the variant's key, "control" for the control bucket, or null when no
multivariate split applied), mirroring OpenFeature's always-present,
nullable ResolutionDetails.variant. Make the schema match: `variant`
becomes required with type [string, null].
@gagantrivedi gagantrivedi requested a review from a team as a code owner June 8, 2026 10:15
@gagantrivedi gagantrivedi requested review from Zaimwa9 and removed request for a team June 8, 2026 10:15
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Jun 8, 2026 10:15am
flagsmith-frontend-preview Ignored Ignored Jun 8, 2026 10:15am
flagsmith-frontend-staging Ignored Ignored Jun 8, 2026 10:15am

Request Review

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-7726 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-7726 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7726 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7726 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7726 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7726 Finished ✅ Results

@gagantrivedi gagantrivedi merged commit 9036dbf into main Jun 8, 2026
26 checks passed
@gagantrivedi gagantrivedi deleted the feat/evaluation-result-variant-required branch June 8, 2026 10:20
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.6 seconds
commit  eaa98cc
info  🔄 Run: #17326 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.1 seconds
commit  eaa98cc
info  🔄 Run: #17326 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  32.7 seconds
commit  eaa98cc
info  🔄 Run: #17326 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  1 minute, 12 seconds
commit  eaa98cc
info  🔄 Run: #17326 (attempt 1)

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants