Skip to content

Target rule module#622

Merged
gthea merged 11 commits intomod_baselinefrom
target-rule-module
Apr 17, 2026
Merged

Target rule module#622
gthea merged 11 commits intomod_baselinefrom
target-rule-module

Conversation

@gthea
Copy link
Copy Markdown
Contributor

@gthea gthea commented Apr 17, 2026

Extracted evaluation module.

gthea added 11 commits April 1, 2026 15:28
AI-Session-Id: 095253e8-7e1c-4578-9779-bf96395021cf
AI-Tool: claude-code
AI-Model: unknown
AI-Session-Id: 095253e8-7e1c-4578-9779-bf96395021cf
AI-Tool: claude-code
AI-Model: unknown
AI-Session-Id: 7d0b171a-a576-4317-965f-99fb98c11ba8
AI-Tool: claude-code
AI-Model: unknown
AI-Session-Id: 7d0b171a-a576-4317-965f-99fb98c11ba8
AI-Tool: claude-code
AI-Model: unknown
- Create TargetingRuleFactory with static buildTargetingRule() method
- Eliminate FQNs for io.split.rules.model types
- Add comprehensive tests for factory methods
- Update ParsedSplit to delegate to factory

This improves testability and separation of concerns by isolating
the mapping logic from SDK domain objects to targeting-engine objects.

AI-Session-Id: 7d0b171a-a576-4317-965f-99fb98c11ba8
AI-Tool: claude-code
AI-Model: unknown
AI-Session-Id: 490d81f4-6832-4178-9c38-e45460ab97de
AI-Tool: claude-code
AI-Model: unknown
Guards for userDefinedSegmentMatcherData, whitelistMatcherData,
unaryNumericMatcherData, and betweenMatcherData were dropped as an
unintended side effect of the DataType import refactor in ed86b23.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

AI-Session-Id: 588a98fd-ba49-4318-8286-5fb79f9efaca
AI-Tool: claude-code
AI-Model: unknown
Restores original behavior: reads matcherGroup.combiner and maps it
to CombiningMatcher.Combiner via valueOf, consistent with how
DataType is already mapped across the DTO/domain boundary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

AI-Session-Id: 588a98fd-ba49-4318-8286-5fb79f9efaca
AI-Tool: claude-code
AI-Model: unknown
Guards for STARTS_WITH, ENDS_WITH, CONTAINS_STRING, MATCHES_STRING,
EQUAL_TO_SEMVER, GREATER_THAN_OR_EQUAL_TO_SEMVER, LESS_THAN_OR_EQUAL_TO_SEMVER,
IN_LIST_SEMVER, BETWEEN_SEMVER, IN_RULE_BASED_SEGMENT, and the final
delegate null check were lost when matchers were migrated from
io.split.engine.matchers to io.split.rules.matchers. Also restores
checkNotNull with message for IN_SPLIT_TREATMENT and EQUAL_TO_BOOLEAN
(previously replaced with manual NPE throws).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

AI-Session-Id: 588a98fd-ba49-4318-8286-5fb79f9efaca
AI-Tool: claude-code
AI-Model: unknown
TargetingRule now holds only evaluation fields (seed, killed, defaultTreatment,
conditions, trafficAllocation, trafficAllocationSeed, algo, prerequisites).
Metadata (name, changeNumber, trafficTypeName, configurations, flagSets,
impressionsDisabled) lives exclusively in ParsedSplit.

EvaluationResult carries only (treatment, label). EvaluatorImp.getTreatment()
enriches changeNumber, config, and impressionsDisabled from ParsedSplit after
the engine returns.

VersionedExceptionWrapper no longer carries a version field; the caller uses
parsedSplit.changeNumber() in the catch block instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

AI-Session-Id: 724b08af-bcdd-4f98-b354-b4a62fbb2489
AI-Tool: claude-code
AI-Model: unknown
@gthea gthea self-assigned this Apr 17, 2026
@gthea gthea requested a review from a team as a code owner April 17, 2026 15:29
@gthea gthea merged commit 0fdb768 into mod_baseline Apr 17, 2026
3 checks passed
@gthea gthea deleted the target-rule-module branch April 17, 2026 15:59
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.

2 participants