Commit a714f9b
authored
feat(nimbus): add user_disabled_ai targeting for Fenix and iOS (#15162)
Because
* The risk_ai flag on experiments currently only generates targeting
for Desktop using the `browser.ai.control.default` preference
* Fenix ([Bug
2028993](https://bugzilla.mozilla.org/show_bug.cgi?id=2028993) /
[D291861](https://phabricator.services.mozilla.com/D291861)) and iOS
(mozilla-mobile/firefox-ios#32929) have added
`user_disabled_ai` to their RecordedNimbusContext, shipping in v151
* Experiments using AI features need to exclude mobile users who have
opted out of AI functionality
This commit
* Adds `user_disabled_ai == false` targeting expression when `risk_ai`
is
true and the application is Fenix or iOS
* Adds version validation requiring >= v151 for mobile apps with
`risk_ai` enabled
* Adds model and serializer tests for both Fenix and iOS
Fixes #151601 parent 19b1f56 commit a714f9b
File tree
5 files changed
+101
-4
lines changed- experimenter/experimenter/experiments
- api/v5
- tests
- api/v5/test_serializers
5 files changed
+101
-4
lines changedLines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1357 | 1357 | | |
1358 | 1358 | | |
1359 | 1359 | | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1360 | 1375 | | |
1361 | 1376 | | |
1362 | 1377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
975 | 978 | | |
976 | 979 | | |
977 | 980 | | |
| |||
1049 | 1052 | | |
1050 | 1053 | | |
1051 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
1052 | 1057 | | |
1053 | 1058 | | |
1054 | 1059 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
783 | 786 | | |
784 | 787 | | |
785 | 788 | | |
| |||
Lines changed: 44 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5379 | 5379 | | |
5380 | 5380 | | |
5381 | 5381 | | |
5382 | | - | |
| 5382 | + | |
5383 | 5383 | | |
5384 | 5384 | | |
5385 | 5385 | | |
5386 | | - | |
| 5386 | + | |
| 5387 | + | |
| 5388 | + | |
| 5389 | + | |
| 5390 | + | |
| 5391 | + | |
| 5392 | + | |
| 5393 | + | |
| 5394 | + | |
| 5395 | + | |
| 5396 | + | |
| 5397 | + | |
| 5398 | + | |
| 5399 | + | |
| 5400 | + | |
| 5401 | + | |
| 5402 | + | |
| 5403 | + | |
| 5404 | + | |
| 5405 | + | |
| 5406 | + | |
| 5407 | + | |
| 5408 | + | |
| 5409 | + | |
| 5410 | + | |
| 5411 | + | |
| 5412 | + | |
| 5413 | + | |
| 5414 | + | |
| 5415 | + | |
| 5416 | + | |
| 5417 | + | |
| 5418 | + | |
| 5419 | + | |
| 5420 | + | |
| 5421 | + | |
| 5422 | + | |
| 5423 | + | |
| 5424 | + | |
| 5425 | + | |
| 5426 | + | |
| 5427 | + | |
| 5428 | + | |
5387 | 5429 | | |
5388 | 5430 | | |
5389 | 5431 | | |
| |||
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1405 | 1405 | | |
1406 | 1406 | | |
1407 | 1407 | | |
1408 | | - | |
1409 | 1408 | | |
1410 | 1409 | | |
1411 | | - | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1412 | 1413 | | |
1413 | 1414 | | |
1414 | 1415 | | |
| |||
1425 | 1426 | | |
1426 | 1427 | | |
1427 | 1428 | | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
1428 | 1460 | | |
1429 | 1461 | | |
1430 | 1462 | | |
| |||
0 commit comments