Skip to content

feat: include selected variant key in flag results#314

Merged
gagantrivedi merged 1 commit into
mainfrom
feat/multivariate-variant-key
Jun 9, 2026
Merged

feat: include selected variant key in flag results#314
gagantrivedi merged 1 commit into
mainfrom
feat/multivariate-variant-key

Conversation

@gagantrivedi

@gagantrivedi gagantrivedi commented Jun 4, 2026

Copy link
Copy Markdown
Member

Every flag result now carries a variant, mirroring OpenFeature's ResolutionDetails.variant (always present, nullable):

  • the variant's key when a named multivariate variant is selected,
  • "control" for the control bucket (the leftover allocation resolving to the default value; synthesised, as control is not a multivariate option),
  • null otherwise — standard feature, unkeyed variant, or no identity.

Selection logic, hashing and ordering are unchanged. Behaviour is covered by the engine-test-data corpus (submodule bumped to v3.9.0), so the variant-specific unit test was dropped as redundant.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

File Coverage Missing
All files 100%

Minimum allowed coverage is 100%

Generated by 🐒 cobertura-action against 871d63c

@codspeed-hq

codspeed-hq Bot commented Jun 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 1 untouched benchmark


Comparing feat/multivariate-variant-key (871d63c) with main (ef90a90)

Open in CodSpeed

@gagantrivedi gagantrivedi force-pushed the feat/multivariate-variant-key branch 2 times, most recently from a293154 to 1f12564 Compare June 8, 2026 10:12
@gagantrivedi gagantrivedi force-pushed the feat/multivariate-variant-key branch from 1f12564 to 8694ce4 Compare June 8, 2026 10:47
@gagantrivedi gagantrivedi marked this pull request as ready for review June 8, 2026 10:47
@gagantrivedi gagantrivedi requested a review from a team as a code owner June 8, 2026 10:47
@gagantrivedi gagantrivedi requested review from khvn26 and removed request for a team June 8, 2026 10:47
@gagantrivedi gagantrivedi requested review from Zaimwa9 and removed request for khvn26 June 8, 2026 10:48
@gagantrivedi gagantrivedi force-pushed the feat/multivariate-variant-key branch 2 times, most recently from a34303f to 8bd1ce1 Compare June 8, 2026 11:00
@gagantrivedi gagantrivedi force-pushed the feat/multivariate-variant-key branch from 8bd1ce1 to 9f61777 Compare June 8, 2026 11:23
Every flag result now carries a `variant` field, mirroring OpenFeature's
`ResolutionDetails.variant` (always present, nullable):

- the variant's key when a named multivariate variant is selected,
- `"control"` when an identity falls in the control bucket (the leftover
  allocation that resolves to the feature's default value); the control is
  not a multivariate option, so the engine synthesises this key,
- `null` otherwise (standard features, unkeyed variants, or evaluation
  without an identity, where nothing is bucketed).

Selection logic, hashing and ordering are unchanged. The behaviour is
covered by the shared engine-test-data corpus, bumped to v3.9.0.
@gagantrivedi gagantrivedi force-pushed the feat/multivariate-variant-key branch from 9f61777 to 871d63c Compare June 8, 2026 11:54
@gagantrivedi

Copy link
Copy Markdown
Member Author

/gemini review

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@gagantrivedi gagantrivedi enabled auto-merge (squash) June 9, 2026 06:55
@gagantrivedi gagantrivedi merged commit 74fb147 into main Jun 9, 2026
9 checks passed
@gagantrivedi gagantrivedi deleted the feat/multivariate-variant-key branch June 9, 2026 07:03
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