feat(multivariate): thread variant key into the environment document#7699
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
21137cc to
3fb6448
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7699 +/- ##
=======================================
Coverage 98.52% 98.52%
=======================================
Files 1445 1445
Lines 55061 55083 +22
=======================================
+ Hits 54251 54273 +22
Misses 810 810 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3fb6448 to
768a723
Compare
768a723 to
eecc05c
Compare
Add `key` to the engine `MultivariateFeatureOptionModel` and map it through in `map_mv_option_to_engine`, so the per-variant key flows into both the SDK local-evaluation document and the DynamoDB/edge document. The field is optional (defaults to None), mirroring the existing `id` field on the same model. Adding it is backward- and forward-compatible: consumers parse these documents with pydantic's default `extra='ignore'`, so a lagging Edge API reading a newer document silently ignores the unknown field, and new code reading an older document defaults `key` to None. Two regression tests lock in this round-trip guarantee.
eecc05c to
b0efb54
Compare
Docker builds report
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds a key field to the MultivariateFeatureOptionModel and updates the engine mapping logic to map this field. Additionally, it updates integration and unit tests to ensure the key field is handled correctly and defaults to None when missing. There are no review comments, so no feedback is provided.
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
docs/if required so people know about the feature. (deferred — the key isn't consumed by SDKs yet.)Changes
Builds on #7698. Adds
keyto the engineMultivariateFeatureOptionModeland passes it through inmap_mv_option_to_engine, so each variant's key is included in the environment document — both the SDK local-eval document and the DynamoDB/edge documentmodel_dump()the sameEnvironmentModel.Variant selection is unchanged. Returning the key in SDK/identify responses is a later slice.
Compatibility
key) → parses,keydefaults toNone.extra='ignore', andflagsmith-flag-enginetypes areTypedDicts with no runtime validation.How did you test this code?
New unit tests cover the mapper (
keyreaches the engine model), the serialised document (keypresent inmodel_dump()output), and parsing an older document withoutkey. Edge API integration test snapshots of the DynamoDB identity document were updated to include the field.Ran the mapper suite and the document consumers (
edge_api,environments,util, feature serializers, import/export) locally — all green;ruff/mypyclean.