Skip to content

Commit

Permalink
Introduce studies per file flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
goodov committed Oct 24, 2024
1 parent 95d72c3 commit af46174
Show file tree
Hide file tree
Showing 80 changed files with 3,121 additions and 13 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/generate-test-seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
paths:
- '.github/workflows/generate-test-seed.yml'
- 'seed/seed.json'
- 'studies/**'

jobs:
Expand All @@ -23,14 +22,6 @@ jobs:
- name: Fetch base commit
run: git fetch --depth=1 origin "$BASE_SHA"

- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: '3.11'

- name: Install python requirements
run: pip install -r seed/requirements.txt

- name: Comment "Generation In Progress"
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
Expand Down Expand Up @@ -64,10 +55,7 @@ jobs:

- name: Generate seed
run: |
# Use only python implementation for now.
python seed/serialize.py seed/seed.json --version "$SEED_VERSION"
# TODO: enable this when per-file studies will be synced with seed.json.
# npm run seed_tools -- create_seed studies seed.bin --version "$SEED_VERSION"
npm run seed_tools create -- --version "$SEED_VERSION"
- name: Upload seed
env:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ jobs:

- name: build
run: npm run build

- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: '3.11'

- name: Install python seed generator requirements
run: pip install -r seed/requirements.txt

- name: Compare python and typescript seed generator
run: npm run seed_tools compare_python_gen
34 changes: 34 additions & 0 deletions studies/AllowCertainClientHintsStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
name: 'AllowCertainClientHintsStudy',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'AllowCertainClientHints',
],
},
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
min_version: '104.1.44.59',
channel: [
'RELEASE',
'BETA',
'NIGHTLY',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
],
},
},
]
31 changes: 31 additions & 0 deletions studies/BraveAIChatEnabledStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
name: 'BraveAIChatEnabledStudy',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'AIChat',
],
},
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
min_version: '119.1.60.0',
channel: [
'RELEASE',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
],
},
},
]
33 changes: 33 additions & 0 deletions studies/BraveAdblockExperimentalListDefaultStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
name: 'BraveAdblockExperimentalListDefaultStudy',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'BraveAdblockExperimentalListDefault',
],
},
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
min_version: '123.1.66.53',
channel: [
'BETA',
'NIGHTLY',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
],
},
},
]
33 changes: 33 additions & 0 deletions studies/BraveAdblockMobileNotificationsListDefault.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
name: 'BraveAdblockMobileNotificationsListDefault',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'BraveAdblockMobileNotificationsListDefault',
],
},
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
channel: [
'RELEASE',
'BETA',
'NIGHTLY',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
],
},
},
]
43 changes: 43 additions & 0 deletions studies/BraveAds.CreativeAdModelBasedPredictorRecencyStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[
{
name: 'BraveAds.CreativeAdModelBasedPredictorRecencyStudy',
experiment: [
{
name: 'NoRecency',
probability_weight: 100,
feature_association: {
enable_feature: [
'CreativeNotificationAdModelBasedPredictor',
'CreativeNewTabPageAdModelBasedPredictor',
'CreativeInlineContentAdModelBasedPredictor',
],
},
param: [
{
name: 'last_seen_ad_predictor_weight',
value: '0.0',
},
{
name: 'last_seen_advertiser_predictor_weight',
value: '0.0',
},
],
},
],
filter: {
max_version: '128.1.69.51',
channel: [
'NIGHTLY',
'BETA',
'RELEASE',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
'IOS',
],
},
},
]
44 changes: 44 additions & 0 deletions studies/BraveAdsAdEventStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
name: 'BraveAdsAdEventStudy',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'AdEvent',
],
},
param: [
{
name: 'debounce_clicked_ad_event_for',
value: '1s',
},
{
name: 'deduplicate_clicked_ad_event_for',
value: '1s',
},
],
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
channel: [
'NIGHTLY',
'BETA',
'RELEASE',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
'IOS',
],
},
},
]
40 changes: 40 additions & 0 deletions studies/BraveAdsConversionsStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
name: 'BraveAdsConversionsStudy',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'Conversions',
],
},
param: [
{
name: 'creative_set_conversion_cap',
value: '0',
},
],
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
channel: [
'NIGHTLY',
'BETA',
'RELEASE',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
'IOS',
],
},
},
]
40 changes: 40 additions & 0 deletions studies/BraveAdsExclusionRulesStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
name: 'BraveAdsExclusionRulesStudy',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'ExclusionRules',
],
},
param: [
{
name: 'should_exclude_ad_if_creative_set_exceeds_conversion_cap',
value: '0',
},
],
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
channel: [
'NIGHTLY',
'BETA',
'RELEASE',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
'IOS',
],
},
},
]
40 changes: 40 additions & 0 deletions studies/BraveAdsNewTabPageAdsStudy.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
name: 'BraveAdsNewTabPageAdsStudy',
experiment: [
{
name: 'Enabled',
probability_weight: 100,
feature_association: {
enable_feature: [
'NewTabPageAds',
],
},
param: [
{
name: 'minimum_wait_time',
value: '1m',
},
],
},
{
name: 'Default',
probability_weight: 0,
},
],
filter: {
channel: [
'NIGHTLY',
'BETA',
'RELEASE',
],
platform: [
'WINDOWS',
'MAC',
'LINUX',
'ANDROID',
'IOS',
],
},
},
]
Loading

0 comments on commit af46174

Please sign in to comment.