-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New control group and changes on when to show search widget cta #723
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
New control group and changes on when to show search widget cta #723
Conversation
* Removing from experiment concept test as control group
|
@subsymbolic I will move this PR over to you. |
subsymbolic
left a comment
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.
Great work, provided a few tidy ups in the comments.
| features = listOf(ConceptTest, SuppressHomeTabWidgetCta, SuppressOnboardingDefaultBrowserCta), | ||
| filterBy = { isEnglishLocale() }), | ||
| Variant( | ||
| key = "ml", |
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.
You'll need a new variant here, ml was recently reserved for the eu auction, see RESERVED_EU_AUCTION_VARIANT at the top. You should have been protected from this by the verifyNoDuplicateVariantNames test but it didn't quite happen because RESERVED_EU_AUCTION_VARIANT is a special case and not in the variants list. Let's add and protect the next person.
| ) | ||
| } | ||
|
|
||
| private fun givenSerpCtaShown() { |
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.
Nice! I like the way you have set these out.
| // Is Serp | ||
| if (!daxDialogSerpShown() && isSerpUrl(it.url)) { | ||
| return DaxDialogCta.DaxSerpCta(onboardingStore, appInstallStore) | ||
| if (isSerpUrl(it.url)) { |
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.
Nice work making this self-documenting. Let's delete the // Is Serp comment, it's no longer needed.
| setConceptTestFeature(SearchWidgetDaxCta) | ||
| givenSerpCtaShown() | ||
| givenAtLeastOneNonSerpCtaShown() | ||
| whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_SEARCH_WIDGET)).thenReturn(true) |
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.
If I set this condition to false, the test should fail but it doesn't. Update test to be identical to its opposite test above, other than this condition and assertion.
malmstein
left a comment
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.
couple of comments on readability
| whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_SEARCH_WIDGET)).thenReturn(true) | ||
| val site = site(url = "http://www.duckduckgo.com") | ||
|
|
||
| val value = testee.refreshCta(coroutineRule.testDispatcher, isBrowserShowing = true, site = site) |
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'd rather we don't test if something is null as result of a business logic function
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.
Will this change only apply if DaxDialogCta.NotNeeded exists or also for null values in general?
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.
When a null value is a possible and expected value os an API (whether it should be or not is another discussion) we should test it just like we would any other value. What's your reason for not wanting to test it @malmstein?
| return when { | ||
| !daxDialogSerpShown() -> DaxDialogCta.DaxSerpCta(onboardingStore, appInstallStore) | ||
| canShowWidgetDaxCta() -> DaxDialogCta.SearchWidgetCta(widgetCapabilities, onboardingStore, appInstallStore) | ||
| else -> null |
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 return here something like DaxDialogCta.NotNeeded instead of null?
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 agree with a different strategy to avoid returning null but I think we should agree first on a guideline or a tech design (using a new type inside Cta class like you suggested, and maybe Option in other cases).
Also, I think the change should be introduced in a different PR (LHF or inside the next project that comes here to introduce new Ctas). why? Because the change will affect how Ctas are handled in BrowserTabViewModel, BrowserTabFragment, and other methods in this same file + their own tests. The PR will be big enough to deserve its own PR so the reviewer can focus on the refactor.
what do you think?
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.
Nullability is a well-defined concept in kotlin, the code is understandable, not lying and not duplicating state. This is a good suggestion however I place it in the "nice to have" rather than PR blocking category.
* Test refactor to guard from someone using EU_AUCTION key variant
If null variant, test should throw exception and be invalid. We can remove unnecessary !! when asserting values
|
@cmonfortep I have approved these changes however there is an outstanding question from @malmstein who is out. You are welcome to wait until that is resolved or, if you're blocked, you are welcome to merge now but continue that conversation with a view to creating a followup PR if required. |
…feature/cristian/experiment2_flow_changed # Conflicts: # app/src/androidTest/java/com/duckduckgo/app/statistics/VariantManagerTest.kt
|
@malmstein moving forward with this PR, but happy to discuss your proposal offline. Thanks for the review. |
Task/Issue URL: https://app.asana.com/0/0/1163707393081881/f
Tech Design URL:
CC: https://app.asana.com/0/0/1163228561849713/f
Description:
Moving as a control group a variant with concept test + Ctas.
Dropping variant only showing concept test.
Only show search widget Cta if the user has seen at least on nonSerp Cta.
Steps to test this PR:
Concept test variant ml: Concept test with old ctas
Concept test variant mh: concept test with ctas as dax dialogs:
Side note: a more detailed way of testing all the different combinations is explained inside #716 . If the reviewer decides to use any test scenario from that PR, please ensure it's still valid taking into account the changes introduced in this PR.
Internal references:
Software Engineering Expectations
Technical Design Template