Page MenuHomePhabricator

Expose Experiment Re-enrollment method
Open, HighPublic5 Estimated Story Points

Description

This task covers:

AC

  • Developers can update an identifier for a given identifier type, e.g. Coordinator::IDENTIFIER_TYPE_MW_USER
  • Developers cannot update the identifier for the Coordinator::IDENTIFIER_TYPE_EDGE_UNIQUE identifier type

Example API

PHP

namespace MediaWiki\Extension\MetricsPlatform\TestKitchen;

interface Coordinator {
	const IDENTIFIER_TYPE_EDGE_UNIQUE = 'edge-unique';
	const IDENTIFIER_TYPE_MW_USER = 'mw-user';
	const IDENTIFIER_TYPE_SEARCH_SESSION = 'search-session';

	/**
	 * Updates the identifier.
	 * 
	 * When an identifier is updated all experiments that require the
	 * identifier type are enrolled and the `XLab.ExperimentManager` service is
	 * updated with those enrollments. If this is done before the
	 * `BeforePageOutput` hook is run, then the output is decorated with those
	 * enrollments also.
	 *
	 * @throws \DomainException If the identifier type can't be updated, i.e.
	 *  it's {@link Coordinator::IDENTIFIER_TYPE_MW_USER}
	 */
	public function updateIdentifier( string $identifierType, string $identifier );
}

Open Questions

  • Should there be an equivalent method for the JavaScript SDK?

Event Timeline

JVanderhoop-WMF moved this task from Incoming to READY TO GROOM on the Test Kitchen board.
Sgs moved this task from Inbox to Tracking on the Growth-Team board.
Sgs subscribed.

Change #1235768 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/TestKitchen@master] PHP:

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

Change #1235769 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/TestKitchen@master] WIP: PHP: Add ExperimentManager::updateUser()

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

Change #1235768 merged by jenkins-bot:

[mediawiki/extensions/TestKitchen@master] PHP: Extend experiment config fetching to instruments

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