[AI-FSSDK] [FSSDK-12369] Add local holdouts support to Go SDK#451
Open
Mat001 wants to merge 4 commits into
Open
[AI-FSSDK] [FSSDK-12369] Add local holdouts support to Go SDK#451Mat001 wants to merge 4 commits into
Mat001 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds local holdout support so holdouts can target specific experiment or rollout rules while preserving existing global holdout behavior for datafiles without includedRules.
Changes:
- Adds
IncludedRulesand global/local holdout classification. - Indexes local holdouts by rule ID in project config mapping.
- Evaluates local holdouts in feature experiment and rollout decision flows after forced decisions and before normal rule evaluation.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/entities/experiment.go | Adds local/global holdout metadata helper. |
| pkg/config/interface.go | Extends project config holdout access APIs. |
| pkg/config/datafileprojectconfig/entities/entities.go | Adds datafile includedRules parsing field. |
| pkg/config/datafileprojectconfig/config.go | Stores local and global holdout indexes. |
| pkg/config/datafileprojectconfig/mappers/holdout.go | Maps global holdouts by flag and local holdouts by rule. |
| pkg/config/datafileprojectconfig/mappers/holdout_test.go | Adds mapper coverage for global/local holdout behavior. |
| pkg/decision/holdout_service.go | Adds rule-level local holdout evaluation. |
| pkg/decision/holdout_service_test.go | Adds local holdout decision service tests. |
| pkg/decision/feature_experiment_service.go | Integrates local holdout checks into feature experiment evaluation. |
| pkg/decision/feature_experiment_service_test.go | Updates constructor tests and forced-decision precedence coverage. |
| pkg/decision/rollout_service.go | Integrates local holdout checks into rollout rule evaluation. |
| pkg/decision/composite_feature_service.go | Shares holdout service with feature experiment service. |
| pkg/decision/helpers_test.go | Updates decision test mock config interface. |
| pkg/decision/evaluator/audience_evaluator_test.go | Updates evaluator test mock config interface. |
| pkg/cmab/service_test.go | Updates CMAB test mock config interface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a4fed68 to
9e39ee2
Compare
- Add rollout service tests for local holdout in regular and fallback rules, and FD-beats-local-holdout ordering enforcement - Add feature experiment service FD-beats-100%-local-holdout enforcement test - Add GetHoldoutsForRule config tests (previously untested) - Extract checkForLocalHoldout closure to getLocalHoldoutDecision method to bring GetDecision cyclomatic complexity from 18 to 16 (lint fix) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
muzahidul-opti
requested changes
May 23, 2026
muzahidul-opti
left a comment
There was a problem hiding this comment.
Looks good to me. Added some comments.
…me HoldoutService methods - Remove flagHoldoutsMap from mapper, config struct, and config.go - Remove GetHoldoutsForFlag from ProjectConfig interface and DatafileProjectConfig - MapHoldouts now returns globalHoldouts []entities.Holdout (not per-flag map) - Rename HoldoutService.GetDecision → GetGlobalDecision - Rename HoldoutService.GetDecisionForRule → GetLocalDecisionForRule - Update CompositeFeatureService to call GetGlobalDecision explicitly - Update all call sites and tests to match new API Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Adds local holdouts support to the Go SDK. Local holdouts allow targeting specific experiment and delivery rules within a flag, while global holdouts continue to apply across all rules in all flags. This introduces a rule-level targeting system using an optional
includedRulesfield on the holdout data model.Changes
IncludedRules *[]stringfield to theHoldoutentity withIsGlobal()helper methodHoldoutConfigwithGetGlobalHoldouts()andGetHoldoutsForRule(ruleID)APIs and updated the holdout mapper to build the rule-to-holdout indexFeatureExperimentServiceandRolloutService, evaluated after forced decisions and before audience/traffic checksGetDecisionForRulemethod toHoldoutServicefor local holdout bucketing logicincludedRulesdefault to global holdout behaviorJira Ticket
FSSDK-12369