Skip to content

[AI-FSSDK] [FSSDK-12337] Add Feature Rollout support#626

Merged
muzahidul-opti merged 5 commits intomasterfrom
ai/farhananjum-opti/FSSDK-12337-feature-rollouts
Apr 6, 2026
Merged

[AI-FSSDK] [FSSDK-12337] Add Feature Rollout support#626
muzahidul-opti merged 5 commits intomasterfrom
ai/farhananjum-opti/FSSDK-12337-feature-rollouts

Conversation

@FarhanAnjum-opti
Copy link
Copy Markdown
Contributor

@FarhanAnjum-opti FarhanAnjum-opti commented Mar 17, 2026

Summary

Adds Feature Rollout support to the Swift SDK. Feature Rollouts are a new experiment rule type that combines Targeted Delivery simplicity with A/B test measurement capabilities. During project config parsing, the "everyone else" variation from the flag's rollout is injected into any experiment with type "fr", enabling correct evaluation without changes to decision logic.

Changes

  • Added optional type field (ExperimentType enum) to the Experiment model with valid values: ab, mab, cmab, td, fr
  • Added config parsing logic to inject the "everyone else" rollout variation into feature rollout experiments
  • Added traffic allocation entry (endOfRange=10000) for the injected variation
  • Added getEveryoneElseVariation helper method to extract the last rollout rule's first variation
  • Updated experiment lookup maps (experimentKeyMap, experimentIdMap) after injection so decisions use updated data
  • Added 10 unit tests covering feature rollout injection, edge cases, and backward compatibility

Jira Ticket

FSSDK-12337

Add Feature Rollout support to the Swift SDK. Feature Rollouts are a new
experiment rule type that combines Targeted Delivery simplicity with A/B
test measurement capabilities.

- Add optional `type` field (ExperimentType enum) to the Experiment model
  with valid values: ab, mab, cmab, td, fr
- Add config parsing logic to inject the "everyone else" rollout variation
  into feature rollout experiments (type == .featureRollout)
- Add traffic allocation entry (endOfRange=10000) for the injected variation
- Add `getEveryoneElseVariation` helper to extract the last rollout rule's
  first variation
- Rebuild experiment lookup maps after injection so decisions use updated data
- Add 10 unit tests covering injection, edge cases, and backward compatibility
Copy link
Copy Markdown
Contributor

@muzahidul-opti muzahidul-opti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. A couple of comments added.

Comment thread Sources/Data Model/Experiment.swift
Comment thread Sources/Data Model/ProjectConfig.swift Outdated
@muzahidul-opti muzahidul-opti self-assigned this Mar 30, 2026
muzahidul-opti and others added 3 commits March 30, 2026 21:49
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…parsing

Unknown experiment type values (e.g., "new_unknown_type") no longer crash
datafile parsing. They are silently dropped to nil, aligning with other SDKs
for forward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@muzahidul-opti muzahidul-opti merged commit 26759a5 into master Apr 6, 2026
15 of 20 checks passed
@muzahidul-opti muzahidul-opti deleted the ai/farhananjum-opti/FSSDK-12337-feature-rollouts branch April 6, 2026 15:59
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