Skip to content

feat(sdk): add variant key to evaluation schemas#7704

Merged
gagantrivedi merged 1 commit into
mainfrom
feat/evaluation-schema-variant
Jun 5, 2026
Merged

feat(sdk): add variant key to evaluation schemas#7704
gagantrivedi merged 1 commit into
mainfrom
feat/evaluation-schema-variant

Conversation

@gagantrivedi
Copy link
Copy Markdown
Member

@gagantrivedi gagantrivedi commented Jun 4, 2026

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

Changes

Contributes to the multivariate variant key work: #7698, #7699, and Flagsmith/flagsmith-engine#314 (which depends on this PR merging first — its generated type files reference these schemas).

Extends the canonical cross-SDK evaluation contract so engines can report which multivariate variant was selected:

Both fields are omitted when not applicable (no variant selected, or the selected variant has no key), consistent with the existing optional fields (metadata, variants, priority) in these schemas. Purely additive — existing consumers are unaffected.

How did you test this code?

  • Both files validate as JSON.
  • Ran datamodel-code-generator (0.33.0, as used by flagsmith-engine) against the updated schemas to confirm the emitted types are the expected key: NotRequired[str] / variant: NotRequired[str].
  • feat: include selected variant key in flag results flagsmith-engine#314 implements and tests the behaviour end-to-end against these schemas: TDD'd evaluator tests for keyed/unkeyed/no-variant cases, full suite of 378 passing with the shared engine-test-data corpus untouched (backwards compatibility).

Add an optional `key` to FeatureValue in the evaluation context schema,
and an optional `variant` to FlagResult in the evaluation result schema,
so engines can report which multivariate variant was selected. The
`variant` name follows OpenFeature's ResolutionDetails.variant.

Both fields are omitted when not applicable, consistent with the
existing optional fields in these schemas.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

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

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

Request Review

@github-actions github-actions Bot added the feature New feature or request label Jun 4, 2026
@gagantrivedi gagantrivedi marked this pull request as ready for review June 5, 2026 07:51
@gagantrivedi gagantrivedi requested a review from a team as a code owner June 5, 2026 07:51
@gagantrivedi gagantrivedi requested review from khvn26 and removed request for a team June 5, 2026 07:51
@gagantrivedi gagantrivedi requested a review from Zaimwa9 June 5, 2026 07:51
@gagantrivedi gagantrivedi removed the request for review from khvn26 June 5, 2026 07:52
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jun 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Docker builds report

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  32.9 seconds
commit  5387a94
info  🔄 Run: #17278 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  39.7 seconds
commit  5387a94
info  🔄 Run: #17278 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  34.5 seconds
commit  5387a94
info  🔄 Run: #17278 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 7 seconds
commit  5387a94
info  🔄 Run: #17278 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Visual Regression

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

@gagantrivedi gagantrivedi merged commit 2eae0ff into main Jun 5, 2026
38 checks passed
@gagantrivedi gagantrivedi deleted the feat/evaluation-schema-variant branch June 5, 2026 12:06
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.

3 participants