Repository navigation
fix(experimentation): keep draft experiment rollout at 0% until started - #9222
saudademjj wants to merge 5 commits into
Conversation
|
@saudademjj is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval skipped because this PR is from an external contributor.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9222 +/- ##
==========================================
- Coverage 98.96% 98.11% -0.86%
==========================================
Files 1724 1725 +1
Lines 73879 73971 +92
==========================================
- Hits 73113 72574 -539
- Misses 766 1397 +631 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
…est mixed-status rollback
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval skipped because this PR is from an external contributor.
Re-trigger cubic
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #9177
Draft experiments (
ExperimentStatus.CREATED) previously wrote their configuredPERCENTAGE_SPLITdirectly to live segmentConditionrows, causingflag_engineto match identities and serve experiment variants before the experiment was started.segment.rules_datastoring the configured rollout percentage, while writing0.0to the live ORMConditionrules wheneverapply_experiment_rolloutruns on aCREATEDexperiment.Segment.rules_datainget_experiment_rollout(viaSegment.objects.all_with_deleted()) so draft rollout reads and no-op checks continue to reflect the configured percentage.CREATED -> RUNNING) intransition_experiment_statusby callingwrite_segment_rules(segment, segment.rules_data)(relying onExperiment.rebuild_environment_documentfor the environment document rebuild).0021_zero_draft_rollout_splits(RunPython) to zero livePERCENTAGE_SPLITconditions on existingCREATEDdraft experiments while leavingRUNNINGexperiments untouched.How did you test this code?
enabled=Trueandenabled=False), environment document activation on first start (CREATED -> RUNNING), and the0021_zero_draft_rollout_splitsdata migration; updated existing draft rollout unit tests to assert live0.0vs configuredrules_data.uv run ruff format --check,uv run ruff check,uv run mypy,uv run python manage.py makemigrations --dry-run --check, anduv run pytest tests/unit/experimentation/ --create-db(1009 passed).