Skip to content

Commit

Permalink
fmt and check during CI (#643)
Browse files Browse the repository at this point in the history
* fmt and check during CI

Signed-off-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>

* fmt

Signed-off-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>

---------

Signed-off-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>
  • Loading branch information
kim0 authored Jun 1, 2023
1 parent 17f2e1d commit 17a9e71
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
10 changes: 7 additions & 3 deletions .github/ci/griffin-study-utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def _create_study(
platform: list[str],
min_version: str,
) -> dict:

study = {
"name": name,
"experiments": [
Expand Down Expand Up @@ -73,8 +72,9 @@ def _upsert_study(
_save_studies(rawstudies)


def upsert_study(greeting, name):
print(greeting, name)
def fmt():
studies = _load_studies()
_save_studies(studies)


if __name__ == "__main__":
Expand Down Expand Up @@ -105,3 +105,7 @@ def upsert_study(greeting, name):
platform=platform.split(","),
min_version=min_version,
)
case "fmt":
fmt()
case _:
raise ValueError("Unrecognized function")
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ jobs:

- name: Serialize seed
run: python seed/serialize.py seed/seed.json

- name: fmt seed
run: |
python3 ./.github/ci/griffin-study-utils.py fmt
git diff --no-ext-diff --exit-code seed/seed.json
26 changes: 13 additions & 13 deletions seed/seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
"BETA",
"NIGHTLY"
],
"max_version": "109.1.48.60",
"max_version": "109.1.48.60",
"platform": [
"WINDOWS",
"MAC",
Expand Down Expand Up @@ -573,14 +573,14 @@
"BETA",
"NIGHTLY"
],
"min_version": "109.1.48.61",
"end_date": 1681793999,
"min_version": "109.1.48.61",
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
],
"end_date" : 1681793999
]
},
"name": "BraveAds.AdServingStudy"
},
Expand Down Expand Up @@ -628,15 +628,15 @@
"BETA",
"NIGHTLY"
],
"min_version": "109.1.48.61",
"end_date": 1681880399,
"min_version": "109.1.48.61",
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
],
"start_date" : 1681794000,
"end_date" : 1681880399
"start_date": 1681794000
},
"name": "BraveAds.AdServingStudy"
},
Expand Down Expand Up @@ -680,14 +680,14 @@
"BETA",
"NIGHTLY"
],
"min_version": "109.1.48.61",
"min_version": "109.1.48.61",
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
],
"start_date" : 1681880400
"start_date": 1681880400
},
"name": "BraveAds.AdServingStudy"
},
Expand Down Expand Up @@ -1747,14 +1747,14 @@
{
"experiments": [
{
"name": "Enabled",
"probability_weight": 100,
"feature_association": {
"enable_feature": [
"BraveVPN",
"BraveVPNLinkSubscriptionAndroidUI"
]
}
},
"name": "Enabled",
"probability_weight": 100
},
{
"name": "Default",
Expand Down Expand Up @@ -1936,4 +1936,4 @@
}
],
"version": "1"
}
}

0 comments on commit 17a9e71

Please sign in to comment.