Skip to content

Commit

Permalink
Fix mozilla#9741 bug(nimbus): Some of the FML errors are non-determin…
Browse files Browse the repository at this point in the history
…istic and that is triggering the serialization repeatedly
  • Loading branch information
eliserichards committed Nov 14, 2023
1 parent 9152b19 commit 4526594
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions experimenter/experimenter/experiments/api/v5/serializers.py
@@ -1,4 +1,5 @@
import json
import logging
import re
import typing
from collections import defaultdict
Expand Down Expand Up @@ -41,6 +42,8 @@
from experimenter.projects.models import Project
from experimenter.settings import SIZING_DATA_KEY

logger = logging.getLogger()


class TransitionConstants:
VALID_STATUS_TRANSITIONS = {
Expand Down Expand Up @@ -1441,11 +1444,9 @@ def _validate_feature_value_against_schema(
def _validate_with_fml(self, feature_config, channel, obj):
loader = NimbusFmlLoader(feature_config.application, channel)
if fml_errors := loader.get_fml_errors(obj, feature_config.slug):
return [
f"{NimbusExperiment.ERROR_FML_VALIDATION}: "
f"{e.message} at line {e.line+1} column {e.col}"
for e in fml_errors
]
for e in fml_errors:
logger.error(f"{e.message} at line {e.line+1} column {e.col}")
return [f"{NimbusExperiment.ERROR_FML_VALIDATION}"]
return None

def _validate_schema(self, obj, schema):
Expand Down

0 comments on commit 4526594

Please sign in to comment.