[AI-FSSDK] [FSSDK-12369] Add local holdouts support with includedRules field#625
Closed
Mat001 wants to merge 1 commit into
Closed
[AI-FSSDK] [FSSDK-12369] Add local holdouts support with includedRules field#625Mat001 wants to merge 1 commit into
Mat001 wants to merge 1 commit into
Conversation
…s field - Add includedRules field to Holdout (null = global, non-null = local) - Add isGlobal() method: returns true when includedRules is null - Update HoldoutConfig to separate global vs local holdouts with ruleHoldoutsMap - Add getGlobalHoldouts() and getHoldoutsForRule() to HoldoutConfig, ProjectConfig, DatafileProjectConfig - Update DecisionService to check global holdouts at flag level and local holdouts per rule - Update all 4 JSON parsers (Gson, Jackson, org.json, json-simple) to parse optional includedRules - Expand HoldoutConfigTest with comprehensive local holdout coverage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing as part of cleanup for FSSDK-12369. |
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.
Summary
This PR adds local holdouts support to the Java SDK, allowing holdouts to target specific rules within a flag via an
includedRulesfield.Jira Ticket: FSSDK-12369
Changes
Core Model
Holdout.java: AddedincludedRulesfield (List<String>, nullable). Null = global holdout (applies to all rules); non-null = local holdout (applies to specific rule IDs). AddedgetIncludedRules()andisGlobal()methods.Configuration
HoldoutConfig.java: AddedglobalHoldoutslist andruleHoldoutsMap(Map<String, List<Holdout>>).updateHoldoutMapping()now separates global vs local holdouts during initialization. AddedgetGlobalHoldouts()andgetHoldoutsForRule(ruleId). DeprecatedgetHoldoutForFlag()(now delegates togetGlobalHoldouts()).ProjectConfig.java(interface): AddedgetGlobalHoldouts()andgetHoldoutsForRule(String ruleId).DatafileProjectConfig.java: Added delegating implementations of both new interface methods.Decision Logic
DecisionService.java: UpdatedgetVariationFromFlag()to usegetGlobalHoldouts()instead ofgetHoldoutForFlag(). Added local holdout checks ingetVariationFromExperimentRule()and delivery rule evaluation — checked after forced decisions, before regular bucketing.JSON Parsers (all 4 updated)
GsonHelpers.java: Parses optionalincludedRulesJSON array intoList<String>, null when absent.JsonConfigParser.java(Jackson):@JsonProperty("includedRules")already handled by@JsonCreatorconstructor.JsonSimpleConfigParser.java: Parses optionalincludedRulesJSON array intoList<String>, null when absent.Tests
HoldoutConfigTest.java: Expanded with 15+ tests covering global holdouts, local holdouts, mixed scenarios, backward compatibility (old datafiles with noincludedRulesdefault to global behavior), andisGlobal()semantics.Decision Flow
Backward Compatibility
Old datafiles without
includedRulesdefault tonull→isGlobal() == true→ behave exactly as before.🤖 Generated with Claude Code