Skip to content

feat: Surface engine evaluation reason and variant on flags - #221

Merged
khvn26 merged 1 commit into
mainfrom
feat/surface-evaluation-reason-and-variant
Aug 7, 2026
Merged

feat: Surface engine evaluation reason and variant on flags#221
khvn26 merged 1 commit into
mainfrom
feat/surface-evaluation-reason-and-variant

Conversation

@khvn26

@khvn26 khvn26 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Replicates Flagsmith/flagsmith-python-client#236 in the Go client.

Flag now carries Reason and Variant, populated from the engine's evaluation result in local evaluation, and from the reason and variant fields of /flags and /identities responses when evaluating remotely.

Flag now carries reason and variant, populated from the engine's evaluation
result in local evaluation and from the reason and variant fields of /flags
and /identities responses when evaluating remotely. Remote evaluation reads
both fields optionally, so they stay empty against an API that predates them.

The engine did not compute a variant at all: FlagResult now reports "control"
when an identity falls in a multivariate feature's leftover allocation, the
selected variant's key when one is bucketed, and nothing for standard
features, unkeyed variants, or evaluation without an identity. Variant keys
come from the multivariate feature options in the environment document.

Bump engine-test-data to v3.10.0, which asserts variant across the corpus;
v3.7.0's expected results have no variant field, so they contradict any
implementation of it.

beep boop
@khvn26
khvn26 requested a review from a team as a code owner August 7, 2026 11:38
@khvn26
khvn26 requested review from emyller and removed request for a team August 7, 2026 11:38

@emyller emyller 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.

🚀

@khvn26
khvn26 merged commit e329054 into main Aug 7, 2026
4 checks passed
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.

2 participants