-
Notifications
You must be signed in to change notification settings - Fork 14
remove editing enrollment/exclusion docs on experiment edits #2738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the automatic deletion of enrollment and exclusion documents when experiments are edited with new segment exclusions. Previously, when a segment was updated in an experiment's exclusion list, the system would automatically remove existing enrollments and create exclusion documents. The new behavior preserves existing enrollments, allowing users to remain assigned even when added to exclusion segments.
- Removed the
updateEnrollmentAndExclusionDocumentsmethod from SegmentService that handled automatic unenrollment - Removed indirect exclusion logic from ExperimentAssignmentService that deleted group enrollments
- Updated integration and unit tests to reflect the new behavior where users/groups stay enrolled
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backend/packages/Upgrade/src/api/services/SegmentService.ts | Removed updateEnrollmentAndExclusionDocuments method and related repository dependencies that automatically deleted enrollments when segments were updated |
| backend/packages/Upgrade/src/api/repositories/ExperimentSegmentExclusionRepository.ts | Removed getExperimentSegmentExclusionDocBySegmentId method that was used to fetch experiments affected by segment changes |
| backend/packages/Upgrade/src/api/services/ExperimentAssignmentService.ts | Removed indirect exclusion logic that deleted group enrollments when users were excluded |
| backend/packages/Upgrade/test/unit/services/SegmentService.test.ts | Removed unused repository imports and commented out obsolete mock |
| backend/packages/Upgrade/test/integration/Segment/IndividualExclusionSegmentIndividualConsistency.ts | Updated expectation to reflect that users remain in both exclusion and assignment lists |
| backend/packages/Upgrade/test/integration/Segment/GroupExclusionSegmentGroupConsistency.ts | Updated expectation to reflect that users remain in both exclusion and assignment lists |
| backend/packages/Upgrade/test/integration/ExperimentUser/Scenario3B.ts | Updated stats expectations to show unchanged enrollment counts when exclusions are added |
| backend/packages/Upgrade/test/integration/ExperimentUser/Scenario3A.ts | Updated stats expectations to reflect both exclusions and enrollments coexisting |
| backend/packages/Upgrade/test/integration/ExperimentUser/Scenario2C.ts | Updated stats and assignment expectations for unchanged enrollments |
| backend/packages/Upgrade/test/integration/ExperimentUser/Scenario2B.ts | Updated stats and assignment expectations for unchanged enrollments |
| backend/packages/Upgrade/test/integration/ExperimentUser/Scenario2A.ts | Updated stats expectations for unchanged user enrollments |
| backend/packages/Upgrade/test/integration/ExperimentUser/Scenario1C.ts | Updated stats expectations for unchanged enrollments |
| backend/packages/Upgrade/test/integration/ExperimentUser/Scenario1B.ts | Updated group count expectations for unchanged enrollments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/packages/Upgrade/test/unit/services/SegmentService.test.ts
Outdated
Show resolved
Hide resolved
…t.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
remind me again if there are any implications for doing this? i'm trying to remember what all the discussion was, it won't affect running experiments right? we'll just potentially have more data in the exports showing user enrollments that would have previously been hidden? |
No description provided.