fix(features): preserve multivariate bucketing salt across feature state recreation#7914
fix(features): preserve multivariate bucketing salt across feature state recreation#7914gagantrivedi wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a nullable Estimated code review effort: 3 (Moderate) | ~25 minutes Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7914 +/- ##
=======================================
Coverage 98.63% 98.63%
=======================================
Files 1496 1497 +1
Lines 59072 59132 +60
=======================================
+ Hits 58266 58326 +60
Misses 806 806 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ate recreation Multivariate variant bucketing is salted on the feature state id, so any flow that recreates a feature state (publishing a new v2 version, editing multivariate weights) changed the salt and re-bucketed already-enrolled identities. Add an mv_hashing_salt field that get_multivariate_feature_state_value seeds on (falling back to the id), preserved across clone() so recreation keeps the original seed. The engine mapper feeds the salt through django_id, so edge and local evaluation stay stable without an engine document schema change. Also add a BEFORE_CREATE guard that raises when a v2 feature state is recreated outside clone() (the previous version already had it but the new row carries no salt), to catch future regressions in tests. Closes #7913
71ba4ee to
0822078
Compare
… guard to segment overrides
0822078 to
a32e197
Compare
Docker builds report
|
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-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Failed testsfirefox › tests/environment-permission-test.pw.ts › Environment Permission Tests › Environment-level permissions control access to features, identities, and segments @enterprise Details
|
Visual Regression19 screenshots compared. See report for details. |
docs/if required so people know about the feature.Changes
Closes #7913
Multivariate bucketing is salted on the feature state id, so any flow that
recreates a feature state (version publish, weight edits under v2 versioning)
re-bucketed already-enrolled identities.
FeatureState.mv_hashing_salt(nullable, internal — not exposed via APIor audit logs). Bucketing seeds on
mv_hashing_salt or id;clone()preserves it, capturing the source id on first clone. No backfill needed.
django_id, so Core, Edge and local-evalSDKs bucket identically with no document schema change.
BEFORE_CREATEguard raises if a v2 segment override is recreated outsideclone(), as a tripwire for future bypasses.How did you test this code?
Unit tests: seed fallback, clone preservation (50 identities keep their
variant), engine mapper output, and the guard's raise/allow cases. Full suite
green in CI on 3.11/3.12/3.13, OSS and private-packages workflows.