Skip to content

refactor resolving segments for inclusion/exclusion#2466

Merged
bcb37 merged 7 commits intodevfrom
fix/refactor-resolve-segments
Jun 4, 2025
Merged

refactor resolving segments for inclusion/exclusion#2466
bcb37 merged 7 commits intodevfrom
fix/refactor-resolve-segments

Conversation

@bcb37
Copy link
Copy Markdown
Collaborator

@bcb37 bcb37 commented May 2, 2025

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.

@bcb37 bcb37 requested a review from danoswaltCL May 2, 2025 16:10
@danoswaltCL danoswaltCL changed the base branch from release/6.1 to dev May 6, 2025 13:56
@@ -1936,12 +1904,15 @@ export class ExperimentAssignmentService {
experimentUser: ExperimentUser,
modalIds: { id: string; filterMode: FILTER_MODE; group?: string }[] // can be experimentIds or FeatureFlagsIds
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does modalIds mean? Like, model ids?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call it entityIds?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bcb37 bcb37 requested review from danoswaltCL and zackcl May 20, 2025 18:03
zackcl
zackcl previously approved these changes May 21, 2025
@danoswaltCL
Copy link
Copy Markdown
Collaborator

just the renaming comment from me, I'm good with this otherwise

danoswaltCL
danoswaltCL previously approved these changes May 29, 2025
@bcb37 bcb37 merged commit cdaf5c2 into dev Jun 4, 2025
8 checks passed
@bcb37 bcb37 deleted the fix/refactor-resolve-segments branch June 4, 2025 15:56
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.

3 participants