-
Notifications
You must be signed in to change notification settings - Fork 36
feat: add odp manager #405
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
Conversation
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.
Looking good! Appreciate the thorough tests. Just a few suggestions/changes requested
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.
Looks good! A few changes and clarifications suggested.
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.
Looking good! One more small fix.
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.
All changes look good! A couple of more clarifications.
optimizely/odp/odp_manager.py
Outdated
self.odp_config = OdpConfig() | ||
self.logger = logger or optimizely_logger.NoOpLogger() | ||
|
||
self.segment_manager = None | ||
self.event_manager = None | ||
|
||
if not self.enabled: | ||
self.logger.info('ODP is disabled.') | ||
return | ||
|
||
if segment_manager: | ||
segment_manager.odp_config = self.odp_config | ||
self.segment_manager = segment_manager | ||
else: | ||
self.segment_manager = OdpSegmentManager(self.odp_config, |
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.
Can we consider removing odp_config from the constructor params? It should be overriden for custom segment-manager anyway? Let's talk about it when integrating at the top level.
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.
I see an error in cache timeout.
@@ -78,7 +86,7 @@ def identify_user(self, user_id: str) -> None: | |||
self.logger.debug('ODP identify event is not dispatched (ODP disabled).') | |||
return | |||
if self.odp_config.odp_state() == OdpConfigState.NOT_INTEGRATED: | |||
self.logger.debug('ODP Identify event is not dispatched (ODP not integrated).') | |||
self.logger.debug('ODP identify event is not dispatched (ODP not integrated).') |
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.
Line 107-114, send_event raises multiple exceptions. They should be processed separately at the top level. We can discuss again when integrated.
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.
LGTM with a nit
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.
LGTM
Summary
Test plan
Issues