feat(experimentation): experiment rollout with multivariate segment override#7851
feat(experimentation): experiment rollout with multivariate segment override#7851gagantrivedi wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7851 +/- ##
==========================================
+ Coverage 98.44% 98.60% +0.15%
==========================================
Files 1467 1473 +6
Lines 57327 57669 +342
==========================================
+ Hits 56436 56863 +427
+ Misses 891 806 -85 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/gemini review |
1b7192a to
b342fae
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces support for experiment rollouts by adding a rollout_segment to the Experiment model, implementing rollout creation and update services, and extending the versioning service to handle multivariate value updates. The review feedback highlights several critical issues: a truthiness check in the serializer prevents clearing multivariate values with an empty list; the rollout update service lacks a database transaction, risking data inconsistency; and the multivariate update loop is susceptible to duplicate creation or integrity errors if duplicate option IDs are provided.
461a758 to
f90171e
Compare
f90171e to
851a93b
Compare
851a93b to
b72bb67
Compare
…nt override Add an experiment_rollout block to experiment creation that provisions a percentage-split system segment plus a segment override (with multivariate allocations) on the experiment's feature, and a PATCH rollout action to update it. Extends the versioning service so single and bulk flag updates can carry multivariate values for v1 and v2 environments.
0202454 to
7c3d4fa
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-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Adds an experiment rollout to experiment creation. Posting an
experiment_rolloutblock alongside a new experiment provisions, in one atomic create:PERCENTAGE_SPLITsystem segment (is_system_segment=True, so it's hidden from the segments API/UI and audit log) gating the experiment cohort byrollout_percentage;multivariate_feature_state_valuessplit.Supporting change in the versioning layer:
FlagChangeSet/SegmentOverrideChangeSetandupdate_flag/update_flag_v2now carry optional multivariate allocations (upsert-style), so segment-override writes set the variant split correctly for both v1 and v2 feature-versioning environments. This also benefits the existingupdate-flag-v2endpoint.Not yet included (intentional)
experiment_rolloutis write-only — no read representation for the UI yet.How did you test this code?
Unit tests (all green locally), plus
mypy,ruff, and the test linter:update_flag/update_flag_v2set/upsert/remove multivariate allocations on segment overrides, for v1 and v2 environments.create_experiment_rolloutbuilds the system %-split segment + override;update_experiment_rolloutupdates it and is blocked while running/completed and when no rollout exists.experiment_rollout(incl. invalid MV option → 400), therolloutPATCH action (happy path, running → 400, invalid MV → 400), and rejecting a rollout sent to the experiment update endpoint.