Commit 91fb9a5
authored
[AI-FSSDK] [FSSDK-12337] Add Feature Rollout support (#392)
* [AI-FSSDK] [FSSDK-12337] Add Feature Rollout support
Add Feature Rollout support to the Ruby SDK. During project config
parsing, inject the "everyone else" variation from the flag's rollout
into any experiment with type "feature_rollout", enabling correct
evaluation without changes to decision logic.
- Added config parsing logic to inject the everyone else rollout
variation into feature_rollout experiments
- Added traffic allocation entry (endOfRange=10000) for injected variation
- Added get_everyone_else_variation helper to extract the last rollout
rule's first variation
- Added 6 unit tests covering injection, variation maps, edge cases,
and backward compatibility
* [AI-FSSDK] [FSSDK-12337] Add type field to experiment JSON schema
Add optional 'type' string field to the experiment properties in the
datafile JSON schema validation constants.
* [AI-FSSDK] [FSSDK-12337] Add test for experiment type field parsing
Verify that the type field from the datafile is correctly preserved
on experiment hashes after config parsing.
* [AI-FSSDK] [FSSDK-12337] Move flag_variation_map after rollout injection
Move @flag_variation_map generation to after the feature rollout
injection block so the everyone-else variation is included in
get_variation_from_flag lookups used by forced decisions.
* [AI-FSSDK] [FSSDK-12337] Add tests for featureEnabled and variables propagation
Add tests verifying:
- Injected everyone-else variation preserves featureEnabled=false
- Variables from the rollout variation carry through to the injected
variation and populate variation_id_to_variable_usage_map
* [AI-FSSDK] [FSSDK-12337] Fix pre-existing rubocop Lint/Void offense in spec_params
Remove redundant else clause in deep_clone that referenced a variable
in void context (Lint/Void: Variable new_obj used in void context).
* [AI-FSSDK] [FSSDK-12337] Add EXPERIMENT_TYPES constant with enum validation
- Define EXPERIMENT_TYPES constant with valid experiment type values
(ab, mab, cmab, td, fr) in Constants module
- Use enum constraint in JSON schema to validate the type field
- Reference constant in injection check instead of raw string literal
- Add flag_variation_map assertion to variation maps test
* [AI-FSSDK] [FSSDK-12337] Remove tests not in ticket spec
Remove 3 tests not in updated Jira ticket test requirements:
- LAST rollout rule selection
- featureEnabled preservation
- Variables propagation
* [AI-FSSDK] [FSSDK-12337] Fix rubocop EmptyLinesAroundBlockBody offense
* [FSSDK-12337] Fix experiment type values to match backend
Update EXPERIMENT_TYPES to use actual backend values:
'multi_armed_bandit' and 'contextual_multi_armed_bandit'
instead of shorthand 'mab' and 'cmab'. Restore accidentally
removed else branch in spec_params deep_clone.
* [AI-FSSDK] [FSSDK-12337] Fix rubocop Lint/Void offense in spec_params
Remove redundant else clause in deep_clone that was accidentally
restored in a previous commit.
* [AI-FSSDK] [FSSDK-12337] Update experiment type values to short-form abbreviations1 parent 0c74513 commit 91fb9a5
File tree
4 files changed
+372
-3
lines changed- lib/optimizely
- config
- helpers
- spec
- config
4 files changed
+372
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
| |||
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
208 | 229 | | |
209 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
210 | 234 | | |
211 | 235 | | |
212 | 236 | | |
| |||
690 | 714 | | |
691 | 715 | | |
692 | 716 | | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
693 | 749 | | |
694 | 750 | | |
695 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
| |||
205 | 213 | | |
206 | 214 | | |
207 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
208 | 220 | | |
209 | 221 | | |
210 | 222 | | |
| |||
0 commit comments