fix(experiments): resolve environment-level variant allocations#7805
Conversation
…rder by newest ExperimentFeatureSerializer now looks up the environment's feature state to return the actual percentage allocations instead of the feature-level defaults. Prefetch the related state values to avoid N+1 queries. Order experiments list by newest first.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
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
Failed testsfirefox › tests/project-permission-test.pw.ts › Project Permission Tests › Project-level permissions control access to features, environments, audit logs, and segments @enterprise Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Failed testsfirefox › tests/project-permission-test.pw.ts › Project Permission Tests › Project-level permissions control access to features, environments, audit logs, and segments @enterprise Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Failed testsfirefox › tests/project-permission-test.pw.ts › Project Permission Tests › Project-level permissions control access to features, environments, audit logs, and segments @enterprise 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7805 +/- ##
=======================================
Coverage 98.58% 98.58%
=======================================
Files 1465 1465
Lines 56889 56925 +36
=======================================
+ Hits 56082 56118 +36
Misses 807 807 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Fix experiment list serialiser to return environment-level variant allocations instead of feature-level defaults. Order experiments by newest first.
ExperimentFeatureSerializer.get_multivariate_optionslooks up the environment's feature state and overlays the actualpercentage_allocationper multivariate optionorder_by("-created_at")on the experiments querysetHow did you test this code?
Manually — created an experiment whose environment-level allocation differs from the feature default and confirmed the serialiser returns the correct percentages. Verified the list endpoint returns newest experiments first.