Page MenuHomePhabricator

CentralNotice: test registration
Closed, ResolvedPublic1 Estimated Story Points

Description

Add API methods for registering tests and retrieving a list of tests registered, and sending them via /beacon/impression

Related Objects

StatusSubtypeAssignedTask
ResolvedDereckson
ResolvedJdlrobson
Resolvedovasileva
ResolvedJdlrobson
Resolvedputnik
Resolved Jhernandez
Resolved Jhernandez
Resolved Moushira
Resolvedphuedx
Resolveddr0ptp4kt
Resolved Jhernandez
ResolvedJdlrobson
ResolvedPcoombe
ResolvedAndyRussG
ResolvedNone
Resolveddr0ptp4kt
Resolved Tbayer
Resolved Jhernandez

Event Timeline

AndyRussG set the point value for this task to 1.

Quick question @DStrine and @AndyRussG : do we have an idea on when this task will be done?
The reading team should have their deployments needed out by May 26th [https://phabricator.wikimedia.org/T132604] and just wanted to check if we'll be able to get this task ready before that?

Thank you!

Change 290361 had a related patch set uploaded (by AndyRussG):
ext.centralNotice.display: API for registering tests

https://gerrit.wikimedia.org/r/290361

The only gotcha I've noticed so far is that the mediaWiki.centralNotice.registerTest call can't happen until the ext.centralNotice.display module is loaded, but needs to come before we call recordImpression. The easiest workaround might be to call registerTest from a legacy alterImpressionData hook.

That involves putting something like this in the banner body:

<script>
mediaWiki.centralNotice.bannerData.alterImpressionData = function( impressionData ) {
    mediaWiki.centralNotice.registerTest( (MYCONDITION ? 'caseA' : 'caseB') );

    return true;
};
</script>

Also, it's a bit difficult to send around testing links because any "banner=" parameter will cause recordImpression not to fire.

Change 290361 merged by jenkins-bot:
ext.centralNotice.display: API for registering tests

https://gerrit.wikimedia.org/r/290361

Thanks for the change! When should we expect this to be deployed? Just want to know when I can start working on T134291.

Change 291118 had a related patch set uploaded (by Awight):
ext.centralNotice.display: API for registering tests

https://gerrit.wikimedia.org/r/291118

Change 291120 had a related patch set uploaded (by Awight):
Update CentralNotice submodule

https://gerrit.wikimedia.org/r/291120

Change 291118 merged by jenkins-bot:
ext.centralNotice.display: API for registering tests

https://gerrit.wikimedia.org/r/291118

Example campaign configuration:
https://meta.wikimedia.org/w/index.php?title=Special:CentralNotice&subaction=noticeDetail&notice=fr_tech_T134286
Example banner:
https://meta.wikimedia.org/wiki/Special:CentralNoticeBanners/edit/fr_tech_T134286
Project URL to see the banner:
http://aa.wikibooks.org/

If you're using a browser that displays sendbeacon requests, you should be able to see the testIdentifiers parameter go out.

If the feature turns out to be broken after deployment, it's unused so can remain deployed broken as long as it doesn't cause any JavaScript console messages.

Change 291120 merged by jenkins-bot:
Update CentralNotice submodule

https://gerrit.wikimedia.org/r/291120

@Pcoombe this is ready to play with on production! Also, reading web informs me that there's a new mw.config var: 'PopupsExperiment' that's true when the hovercards are shown on a page.

This caused T136387 and the production deployment was just reverted.

Change 292367 had a related patch set uploaded (by AndyRussG):
ext.centralNotice.display: API for registering tests

https://gerrit.wikimedia.org/r/292367

Change 292367 merged by jenkins-bot:
ext.centralNotice.display: API for registering tests

https://gerrit.wikimedia.org/r/292367

Confirmed this appears to be working as expected. Thanks!