This task tracks the high-ish-level goal of creating a framework to enrol users in experiments, track those enrolments, and bucket the user.
Since the first milestone targets experimentation on the Wikipedias, the framework is limited to PHP and JS.
=== Pseudocode
```lang=php,name=pseudocode.php
use RequestContext;
use MediaWiki\MediaWikiServices;
$user = RequestContext::getMain()->getUser();
$experimentManagerFactory = MediaWikiServices::getInstance()->getService( 'Experiments.ExperimentManagerFactory' );
$experimentManager = $experimentManagerFactory->newExperimentManager( RequestContext::getMain() );
$experiment = $experimentManager->getExperiment( 'PSEUDOCODE' );
echo "User {$user->getName()} was enrolled in the {$experiment->getName()} experiment. " .
"They were placed in the \"{$experiment->getBucket()}\" bucket. ";
```
```lang=js,name=pseudocode.js
const experiments = require( 'mw.experiments' ).enroll();
experiments.getExperiment( 'PSEUDOCODE', ( user, bucket, loaded_modules ) => {
console.log(
`User ${user.name} was enrolled in the "${experiment.name}" experiment. ` +
`They were placed in the "${bucket}" bucket. ` +
`The following ResourceLoader modules were loaded: ` + loaded_modules.join( ', ' )
);
} );
```
=== TODO
==== Tasks
[] Investigate other PHP and JS experimentation/feature management frameworks
** Growthbook: https://docs.growthbook.io/lib/php and https://docs.growthbook.io/lib/js
** #growthexperiments: https://phabricator.wikimedia.org/T335124#8795980