Skip to content

Conversation

@bcb37
Copy link
Collaborator

@bcb37 bcb37 commented Nov 12, 2025

No description provided.

Copy link
Contributor

Copilot AI left a 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 updateEnrollmentAndExclusionDocuments method 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.

…t.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@danoswaltCL
Copy link
Collaborator

danoswaltCL commented Nov 13, 2025

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?

@bcb37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove alterations exclusion and enrollment tables on experiment exclusion changes

3 participants