Skip to content

[AI-FSSDK] (DO NOT REVIEW) [FSSDK-12275] Skip unsupported experiment type during flag decision#438

Open
raju-opti wants to merge 1 commit intomasterfrom
ai/raju-opti/FSSDK-12275-experiment-type
Open

[AI-FSSDK] (DO NOT REVIEW) [FSSDK-12275] Skip unsupported experiment type during flag decision#438
raju-opti wants to merge 1 commit intomasterfrom
ai/raju-opti/FSSDK-12275-experiment-type

Conversation

@raju-opti
Copy link

@raju-opti raju-opti commented Feb 6, 2026

Summary

Implements experiment type filtering in the feature experiment service to skip unsupported experiment types during flag decision evaluation.

Changes

  • Experiment Struct: Added Type field to the Experiment struct in pkg/entities/experiment.go
  • Supported Types: Defined supportedExperimentTypes map with values: a/b, mab, cmab, feature_rollouts
  • Decision Logic: Updated FeatureExperimentService.GetDecision to:
    • Check experiment type before evaluation
    • Skip to next experiment if Type is non-empty but not in supported list
    • Evaluate normally if Type is empty (backward compatible) or is in supported list
  • Testing: Added comprehensive unit tests covering:
    • Skipping experiments with unsupported types
    • Evaluating experiments with all supported types (a/b, mab)
    • Handling empty Type fields (backward compatibility)
    • Skipping unsupported and evaluating supported in sequence

Implementation Details

The feature experiment service now checks the experiment Type field during flag decision:

  • If Type is empty string: Experiment is evaluated (backward compatible)
  • If Type is in supported map: Experiment is evaluated
  • If Type is non-empty but NOT in supported map: Experiment is skipped with debug log

This ensures the SDK can gracefully handle new experiment types introduced in the datafile without breaking existing functionality.

Test Plan

  • ✅ All existing tests pass (no regression)
  • ✅ New unit tests verify type filtering logic
  • ✅ All new tests pass successfully
  • ✅ Implementation matches JavaScript and Python SDK behavior

Related

  • Jira: FSSDK-12275
  • Related PRs: JavaScript SDK #1137, Python SDK #490

🤖 Generated with Claude Code

… during flag decision

- Add Type field to Experiment struct in entities/experiment.go
- Define supportedExperimentTypes map with values: a/b, mab, cmab, feature_rollouts
- Update FeatureExperimentService.GetDecision to check experiment types
- Skip evaluation only if Type is non-empty but not in supported list
- Evaluate normally if Type is empty or is supported
- Add comprehensive unit tests covering all scenarios

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant