Skip to content

[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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

junaed-optimizely
Copy link
Contributor

@junaed-optimizely junaed-optimizely commented Jul 25, 2025

Summary

Added holdout support in decision service and minor project config adjustments

Test plan

Tests have been added to support the new implementation

Issues

@coveralls
Copy link

coveralls commented Jul 25, 2025

Coverage Status

coverage: 79.048%. first build
when pulling 9a77240 on junaed/fssdk-11528-add-holdout-support
into 51438cf on master.

@junaed-optimizely junaed-optimizely marked this pull request as ready for review July 25, 2025 15:46
Copy link

@Copilot Copilot AI left a 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;
Copy link
Preview

Copilot AI Jul 25, 2025

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.

Suggested change
let trafficAllocationConfig = experiment.trafficAllocation;
let trafficAllocationConfig = getTrafficAllocation(configObj, experiment.id);

Copilot uses AI. Check for mistakes.

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy