Skip to content
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

fix: Forced variation not available in experiment #367

Merged
merged 8 commits into from
Dec 22, 2021

Conversation

ozayr-zaviar
Copy link
Contributor

@ozayr-zaviar ozayr-zaviar commented Dec 13, 2021

Summary

  • Crash fixed after logging syntax correction
  • Updated order for checking variation in impression event
  • Unit test added for no active experiment in creating impression event
  • Unit test fixed after changes

Test plan

  • All unit tests and FSC should pass.

Copy link

@dustin-sier dustin-sier left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Need changes and tests

optimizely/event/user_event_factory.py Outdated Show resolved Hide resolved
optimizely/event/user_event_factory.py Show resolved Hide resolved
Copy link
Contributor

@msohailhussain msohailhussain left a comment

Choose a reason for hiding this comment

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

lgtm. please change the title of the PR.
Add proper comments and always recommend to add unit test for this case.

@ozayr-zaviar ozayr-zaviar changed the title fix: FSC test case fix fix: Forced variation not available in experiment Dec 14, 2021
msohailhussain and others added 2 commits December 14, 2021 11:34
Co-authored-by: Jae Kim <45045038+jaeopt@users.noreply.github.com>
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.

A couple of changes suggested.

impression_event = UserEventFactory.create_impression_event(
project_config, None, '111128', 'flag_key', 'rule_key', 'rule_type', True, user_id, user_attributes
)
self.assertIsNone(impression_event)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should not be none. With FD, {None experiment} is a valid case, for which we should forward the impression event.

if not variation and variation_id and experiment_id:
# need this condition when we send events involving forced decisions
elif variation_id and experiment_id:
# need this condition when we send events involving forced decisions (F-to-D or E-to-D with any ruleKey/variationKey combinations)
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this comment line to the top of line 52.

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 have a unit test covering this bug?

Copy link
Contributor

@The-inside-man The-inside-man left a comment

Choose a reason for hiding this comment

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

lgtm!

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

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

@msohailhussain msohailhussain merged commit 3dc944c into master Dec 22, 2021
@msohailhussain msohailhussain deleted the uzair/fsc-case-fix branch December 22, 2021 06:13
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.

None yet

5 participants