feat(experimentation): expose experiment rollout in API responses#7858
Draft
gagantrivedi wants to merge 3 commits into
Draft
feat(experimentation): expose experiment rollout in API responses#7858gagantrivedi wants to merge 3 commits into
gagantrivedi wants to merge 3 commits into
Conversation
…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.
Add a read representation of the experiment rollout, reassembled from the rollout segment's percentage-split condition and the live segment-override feature state (v1 and v2), exposed on the experiment list/detail/rollout responses via ExperimentListSerializer. The write-only input field is kept on the base serializer.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/experiment-rollout #7858 +/- ##
===========================================================
- Coverage 98.60% 98.59% -0.01%
===========================================================
Files 1473 1468 -5
Lines 57669 57687 +18
===========================================================
+ Hits 56863 56879 +16
- Misses 806 808 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Note
Stacked on #7851 (base branch
feat/experiment-rollout). Review/merge that first; this PR's diff is just the read-representation on top. I'll retarget tomainonce #7851 merges.Changes
Contributes to
Follow-up to #7851, which left
experiment_rolloutwrite-only. This exposes it on read so the UI can display the configured rollout.The rollout isn't stored as a single field — on read it's reassembled from its two sources of truth:
rollout_percentage← the rollout segment'sPERCENTAGE_SPLITcondition valueenabled/feature_state_value/multivariate_feature_state_values← the live segment-override feature state (resolved the same v1/v2-aware way asExperimentFeatureSerializerdoes for env-level allocations)A
get_experiment_rollout(experiment)service returns this shape (mirroring the write input), andExperimentListSerializerexposes it via a read-onlyexperiment_rolloutfield — so it appears on list, retrieve, and therolloutaction responses. The write-only input field stays on the base serializer (mirrors themetricspattern); returnsnullwhen no rollout is configured.How did you test this code?
Unit tests (all green locally) +
mypy,ruff, the test linter, and docgen:get_experiment_rolloutreassembles the representation for v1 and v2 environments, and returnsNonewhen no rollout exists.GETexperiment detail returns the populatedexperiment_rollout, andnullwhen absent.