refactor resolving segments for inclusion/exclusion#2466
Merged
Conversation
zackcl
reviewed
May 20, 2025
danoswaltCL
reviewed
May 20, 2025
| @@ -1936,12 +1904,15 @@ export class ExperimentAssignmentService { | |||
| experimentUser: ExperimentUser, | |||
| modalIds: { id: string; filterMode: FILTER_MODE; group?: string }[] // can be experimentIds or FeatureFlagsIds | |||
Collaborator
There was a problem hiding this comment.
what does modalIds mean? Like, model ids?
Collaborator
Author
There was a problem hiding this comment.
I thought about changing that variable naming. It had been experimentIds until that method started being used for feature flags as well. I wasn't sure how 'modal' here came to refer to "either an experiment or a feature flag" but figured there was some history to it.
Collaborator
There was a problem hiding this comment.
can we call it entityIds?
Collaborator
Author
There was a problem hiding this comment.
Sure I can make that change on this pr. That naming was used throughout that file; I'll see if it's used that way elsewhere too.
zackcl
previously approved these changes
May 21, 2025
Collaborator
|
just the renaming comment from me, I'm good with this otherwise |
danoswaltCL
previously approved these changes
May 29, 2025
zackcl
approved these changes
Jun 4, 2025
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.
This replaces the "depth"-based restriction on resolving segments with a method that remembers already-resolved segments to avoid infinite-traversal cycles. It can go arbitrarily deep without fear of infinity, which is important now that standard segments are twice as deep.
It also separates 'resolveSegment()' from concerns about inclusion/exclusion, so now it just returns lists of groups and users for a given segment and all its subsegments.