Add API methods for registering tests and retrieving a list of tests registered, and sending them via /beacon/impression
Description
Details
Event Timeline
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
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
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
Change 291120 had a related patch set uploaded (by Awight):
Update CentralNotice submodule
Change 291118 merged by jenkins-bot:
ext.centralNotice.display: API for registering tests
Example campaign configuration:
https://meta.wikimedia.org/w/index.php?title=Special:CentralNotice&subaction=noticeDetail¬ice=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.
@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.
Change 292367 had a related patch set uploaded (by AndyRussG):
ext.centralNotice.display: API for registering tests
Change 292367 merged by jenkins-bot:
ext.centralNotice.display: API for registering tests