Skip to content

Commit 4a960dd

Browse files
committed
chore(nimbus): bump minimum version to 105
Becuase * Remote Settings Certs were rotated and collectsion are now only readable by clients >=105 * We can bump the minimum supported version to 105 * We can remove any logic which verified versions <=105 This commit * Bumps the minimum supported version to 105 * Removes any review logic that checked for versions <=105 * Updates tests fixes #13267
1 parent 9743a1d commit 4a960dd

File tree

5 files changed

+25
-481
lines changed

5 files changed

+25
-481
lines changed

experimenter/experimenter/experiments/api/v5/serializers.py

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,7 @@ def _validate_versions(self, data):
18771877
raise serializers.ValidationError(
18781878
{
18791879
"firefox_min_version": [
1880-
NimbusExperiment.ERROR_FIREFOX_VERSION_MIN_96
1880+
NimbusExperiment.ERROR_FIREFOX_VERSION_MIN_SUPPORTED
18811881
],
18821882
}
18831883
)
@@ -1890,7 +1890,7 @@ def _validate_versions(self, data):
18901890
raise serializers.ValidationError(
18911891
{
18921892
"firefox_min_version": [
1893-
NimbusExperiment.ERROR_FIREFOX_VERSION_MIN_96
1893+
NimbusExperiment.ERROR_FIREFOX_VERSION_MIN_SUPPORTED
18941894
],
18951895
}
18961896
)
@@ -1938,46 +1938,6 @@ def _validate_versions(self, data):
19381938
)
19391939
return data
19401940

1941-
def _validate_languages_versions(self, data):
1942-
application = data.get("application")
1943-
min_version = data.get("firefox_min_version", "")
1944-
1945-
if data.get("languages", []):
1946-
min_supported_version = (
1947-
NimbusConstants.LANGUAGES_APPLICATION_SUPPORTED_VERSION[application]
1948-
)
1949-
if NimbusExperiment.Version.parse(
1950-
min_version
1951-
) < NimbusExperiment.Version.parse(min_supported_version):
1952-
raise serializers.ValidationError(
1953-
{
1954-
"languages": f"Language targeting is not \
1955-
supported for this application below \
1956-
version {min_supported_version}"
1957-
}
1958-
)
1959-
return data
1960-
1961-
def _validate_countries_versions(self, data):
1962-
application = data.get("application")
1963-
min_version = data.get("firefox_min_version", "")
1964-
1965-
if data.get("countries", []):
1966-
min_supported_version = (
1967-
NimbusConstants.COUNTRIES_APPLICATION_SUPPORTED_VERSION[application]
1968-
)
1969-
if NimbusExperiment.Version.parse(
1970-
min_version
1971-
) < NimbusExperiment.Version.parse(min_supported_version):
1972-
raise serializers.ValidationError(
1973-
{
1974-
"countries": f"Country targeting is \
1975-
not supported for this application \
1976-
below version {min_supported_version}"
1977-
}
1978-
)
1979-
return data
1980-
19811941
def _validate_enrollment_targeting(self, data):
19821942
excluded_experiments = set(data.get("excluded_experiments", []))
19831943
required_experiments = set(data.get("required_experiments", []))
@@ -2011,27 +1971,6 @@ def _validate_sticky_enrollment(self, data):
20111971

20121972
return data
20131973

2014-
def _validate_rollout_version_support(self, data):
2015-
if not self.instance or not self.instance.is_rollout:
2016-
return data
2017-
2018-
min_version = NimbusExperiment.Version.parse(self.instance.firefox_min_version)
2019-
rollout_version_supported = NimbusExperiment.ROLLOUT_SUPPORT_VERSION.get(
2020-
self.instance.application
2021-
)
2022-
if (
2023-
rollout_version_supported is not None
2024-
and min_version < NimbusExperiment.Version.parse(rollout_version_supported)
2025-
):
2026-
raise serializers.ValidationError(
2027-
{
2028-
"is_rollout": f"Rollouts are not supported for this application \
2029-
below version {rollout_version_supported}"
2030-
}
2031-
)
2032-
2033-
return data
2034-
20351974
def _validate_bucket_duplicates(self, data):
20361975
is_rollout = self.instance.is_rollout
20371976
if not self.instance or not is_rollout:
@@ -2442,7 +2381,6 @@ def validate(self, data):
24422381
data = self._validate_feature_configs(data)
24432382
data = self._validate_enrollment_targeting(data)
24442383
data = self._validate_sticky_enrollment(data)
2445-
data = self._validate_rollout_version_support(data)
24462384
data = self._validate_bucket_duplicates(data)
24472385
data = self._validate_proposed_release_date(data)
24482386
data = self._validate_feature_value_variables(data)
@@ -2451,9 +2389,6 @@ def validate(self, data):
24512389
if application == NimbusExperiment.Application.DESKTOP:
24522390
data = self._validate_desktop_pref_rollouts(data)
24532391
data = self._validate_desktop_pref_flips(data)
2454-
else:
2455-
data = self._validate_languages_versions(data)
2456-
data = self._validate_countries_versions(data)
24572392
return data
24582393

24592394

experimenter/experimenter/experiments/constants.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -951,14 +951,6 @@ class FirefoxLabsGroups(models.TextChoices):
951951
Application.FOCUS_IOS: Version.FIREFOX_116,
952952
}
953953

954-
ROLLOUT_SUPPORT_VERSION = {
955-
Application.DESKTOP: Version.FIREFOX_105,
956-
Application.FENIX: Version.FIREFOX_105,
957-
Application.FOCUS_ANDROID: Version.FIREFOX_105,
958-
Application.IOS: Version.FIREFOX_105,
959-
Application.FOCUS_IOS: Version.FIREFOX_105,
960-
}
961-
962954
LOCALIZATION_SUPPORTED_VERSION = {
963955
Application.DESKTOP: Version.FIREFOX_113,
964956
}
@@ -1053,7 +1045,7 @@ class FirefoxLabsGroups(models.TextChoices):
10531045
ERROR_FIREFOX_VERSION_MIN = (
10541046
"Ensure this value is less than or equal to the maximum version"
10551047
)
1056-
ERROR_FIREFOX_VERSION_MIN_96 = "The minimum targetable Firefox version is 96"
1048+
ERROR_FIREFOX_VERSION_MIN_SUPPORTED = "The minimum targetable Firefox version is 105"
10571049
ERROR_FIREFOX_VERSION_MAX = (
10581050
"Ensure this value is greater than or equal to the minimum version"
10591051
)
@@ -1125,7 +1117,7 @@ class FirefoxLabsGroups(models.TextChoices):
11251117

11261118
L10N_MIN_STRING_ID_LEN = 9
11271119

1128-
MIN_REQUIRED_VERSION = Version.FIREFOX_96
1120+
MIN_REQUIRED_VERSION = Version.FIREFOX_105
11291121

11301122
EXCLUDED_REQUIRED_MIN_VERSION = Version.FIREFOX_116
11311123

experimenter/experimenter/experiments/models.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,9 +2224,8 @@ def get_invalid_fields_errors(self):
22242224
serializer_data = NimbusReviewSerializer(self).data
22252225
serializer = NimbusReviewSerializer(self, data=serializer_data)
22262226

2227-
if serializer.is_valid():
2228-
return {}
2229-
else:
2227+
errors = {}
2228+
if not serializer.is_valid():
22302229
errors = serializer.errors
22312230

22322231
if "excluded_experiments" in errors:
@@ -2239,7 +2238,7 @@ def get_invalid_fields_errors(self):
22392238
"required_experiments"
22402239
)
22412240

2242-
return errors
2241+
return errors
22432242

22442243
def clone(self, name, user, rollout_branch_slug=None, changed_on=None):
22452244
# Inline import to prevent circular import

0 commit comments

Comments
 (0)