-
Notifications
You must be signed in to change notification settings - Fork 36
[FSSDK-11175] Update: Implement Decision Service methods to handle CMAB #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[FSSDK-11175] Update: Implement Decision Service methods to handle CMAB #457
Conversation
…rt OptimizelyFactory
- test_optimizely.py fixed to expect new Decision objects
…er and decision service
… and ensure key is of bytes type in hash128
decide_reasons += decision_variation_value.get('reasons', []) | ||
cmab_decision = decision_variation_value.get('result') | ||
if not cmab_decision or decision_variation_value['error']: | ||
self.logger.error(Errors.CMAB_FETCH_FAILED.format(decide_reasons[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you log the cmab error but does not propagate it upward as an exception or error object.
Instead you return
In the _decide method in optimizely.py do you then check the returned decision for cmab errors?
My understanding is that cmab error should be handled by the client and error should propagate all the way to the client.
Maybe you define error and could return smth like:
return None, decide_reasons, cmab_uuid, CmabFetchError(error_msg)
and then in the _decide in optimzely.py you could do smth like:
if error and is instance(error, CmabFetchError):
self.logger.warning(f"Received error while making a decision for feature {key}: {error}")
# Create an error decision
return OptimizelyDecision(
flag_key=key,
user_context=user_context,
reasons=[str(error)] if include_reasons else []
)
@raju-opti what do you think?
…add __init__.py for cmab module
Summary
Decision Service methods to handle CMAB
Test plan
Added unit tests
Issues
FSSDK-11175