-
Notifications
You must be signed in to change notification settings - Fork 455
chore: Include Features, Segments in evaluation context schema #5867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid overall. One piece feels missing to make the evaluation fully representative imo - but let me know if it's really useful.
Right now we have:
- the flag being evaluated
- the identity under evaluation
- the segments that can override
- the final evaluation result
What could be missing in the result is the why do I have those values. We know which segment overid but we don't have necessarily its values (especially thinking with multi-variate where the possibilities are wider).
Do you think it would make sense to surface the override override configuration (blue 40%/red60% instead of blue80%/Green20%) ?
c67d7b8
I had to add some stuff while finalising https://github.com/Flagsmith/flagsmith-engine/pull/239/files:
|
6ec4624
to
015c11d
Compare
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Closes #5808.
This PR adds:
EvaluationResult
schema that includes flag and used segment information.segments
andfeatures
keys to theEvaluationContext
schema to have all data required for evaluation in a single DTO.The design goal was to have a structure that is extensible, simple enough to parse and read through, and that provides all required engine data, excluding any data unrelated to engine.
Some new vocabulary is added here that, IMO, make sense for evaluation:
"key"
fields are preferred to numericid
fields to more clearly state their purpose."variants"
key is used to represent multivariate feature states, where each variant includes a"weight"
indicating its distribution percentage. I considered using a unified"values"
array for all feature states — including non-multivariate ones (with a single{ "weight": 100 }
entry) — but opted against it to avoid ambiguous semantics around control values and the need to validate against empty arrays.Both objects will be used by the new engine interface to be introduced in Flagsmith/flagsmith-engine#234.
An example
EvaluationContext
object:An example
EvaluationResult
object:How did you test this code?
N/A