Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Mat001
Copy link
Contributor

@Mat001 Mat001 commented Sep 13, 2022

Summary

  • Integrate OdpSegmentManager, OdpEventmanager and OdpConfig into OdpManager
  • Add unit tests
  • acceptance criteria in the linked story below

Test plan

  • added unit tests, mypy type checking, linting

Issues

Copy link
Contributor

@andrewleap-optimizely andrewleap-optimizely left a 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

Copy link
Contributor

@jaeopt jaeopt left a 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.

Copy link
Contributor

@andrewleap-optimizely andrewleap-optimizely left a 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.

Copy link
Contributor

@jaeopt jaeopt left a 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.

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,
Copy link
Contributor

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.

Copy link
Contributor

@jaeopt jaeopt left a 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).')
Copy link
Contributor

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.

@Mat001 Mat001 requested a review from jaeopt September 20, 2022 18:27
Copy link
Contributor

@jaeopt jaeopt left a 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

Copy link
Contributor

@andrewleap-optimizely andrewleap-optimizely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewleap-optimizely andrewleap-optimizely changed the title Mpirnovar/odp manager feat: add odp manager Sep 21, 2022
@andrewleap-optimizely andrewleap-optimizely merged commit d1b521b into master Sep 21, 2022
@andrewleap-optimizely andrewleap-optimizely deleted the mpirnovar/odp_manager branch September 21, 2022 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants