Skip to content

Conversation

nmayorsplit
Copy link
Contributor

GO SPLIT COMMONS

What did you accomplish?

  • Added new config for accepted rules
  • Added new RulesBuilder and method to build rules.

How do we test the changes introduced in this PR?

Extra Notes

@nmayorsplit nmayorsplit marked this pull request as ready for review September 4, 2025 19:21
@nmayorsplit nmayorsplit requested a review from a team as a code owner September 4, 2025 19:21
@@ -74,7 +80,7 @@ func (e *Evaluator) evaluateTreatment(key string, bucketingKey string, featureFl
ctx.AddDependency("evaluator", e)
ctx.AddDependency("ruleBasedSegmentStorage", e.ruleBasedSegmentStorage)

split := grammar.NewSplit(splitDto, ctx, e.logger)
split := grammar.NewSplit(splitDto, ctx, e.logger, grammar.NewRuleBuilder(ctx, e.segmentStorage, e.ruleBasedSegmentStorage, e.featureFlagRules, e.ruleBasedSegmentRules, e.logger))
Copy link
Contributor

Choose a reason for hiding this comment

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

what about evaluator receiving the entire ruleBuilder instead of passing the config parameters and creating the ruleBuilder here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this, we need to remove the context.

@@ -14,8 +14,9 @@ func TestAllKeysMatcher(t *testing.T) {
dto := &dtos.MatcherDTO{
MatcherType: "ALL_KEYS",
}
ruleBuilder := NewRuleBuilder(nil, nil, nil, SyncProxyFeatureFlagsRules, SyncProxyRuleBasedSegmentRules, logger)
Copy link
Contributor

Choose a reason for hiding this comment

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

what about matcher receive the rule builder so then you only call the BuildMatcher>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a test. For rule-based segments, it's receiving a ruleBuilder and calling the method.

Copy link

@nmayorsplit nmayorsplit merged commit 8f5f5ac into rule-based-segment Sep 9, 2025
3 checks passed
@nmayorsplit nmayorsplit deleted the FME-9835 branch September 9, 2025 15:16
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