-
Notifications
You must be signed in to change notification settings - Fork 83
[FSSDK-11528] Holdout support in decision service #1075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds holdout support to the decision service, allowing users to be bucketed into holdout variations as part of the feature flag decision process. The implementation includes holdout evaluation logic, proper fallback mechanisms, and comprehensive test coverage.
- Added holdout evaluation logic in the decision service with proper audience and traffic allocation checking
- Enhanced project configuration to properly handle holdout variations in the variation ID map
- Updated type definitions to use more generic experiment core types for better holdout compatibility
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
lib/utils/enums/index.ts | Added HOLDOUT decision source constant |
lib/shared_types.ts | Updated ActivateListenerPayload to use ExperimentCore type |
lib/project_config/project_config.ts | Enhanced holdout parsing to include variations in variationIdMap |
lib/notification_center/type.ts | Updated type definitions to use ExperimentCore |
lib/core/decision_service/index.ts | Implemented holdout evaluation logic with proper fallback handling |
lib/core/decision_service/index.spec.ts | Added comprehensive test coverage for holdout functionality |
lib/core/bucketer/index.ts | Added null safety check for experiment lookup |
Comments suppressed due to low confidence (2)
lib/core/decision_service/index.ts:81
- The import name 'holdout' is ambiguous as it conflicts with the Holdout type. Consider renaming to 'isHoldoutEnabled' or 'holdoutFeatureToggle' for clarity.
import { holdout } from '../../feature_toggle';
lib/core/decision_service/index.ts:944
- The function call 'holdout()' is ambiguous due to the naming conflict with the Holdout type. This should be renamed to match the import suggestion above.
if (holdout()) {
bucketingId: string, | ||
userId: string | ||
): BucketerParams { | ||
let validateEntity = true; | ||
|
||
let trafficAllocationConfig: TrafficAllocation[] = getTrafficAllocation(configObj, experiment.id); | ||
if (experiment.cmab) { | ||
let trafficAllocationConfig = experiment.trafficAllocation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct access to 'experiment.trafficAllocation' may not exist for all experiment types. The original code used 'getTrafficAllocation(configObj, experiment.id)' which should be maintained for proper fallback handling.
let trafficAllocationConfig = experiment.trafficAllocation; | |
let trafficAllocationConfig = getTrafficAllocation(configObj, experiment.id); |
Copilot uses AI. Check for mistakes.
Summary
Added holdout support in decision service and minor project config adjustments
Test plan
Tests have been added to support the new implementation
Issues