Page MenuHomePhabricator

Fix $wgMathFullRestbaseURL so it doesn't require a $wgExtensionFunction to set
Open, Needs TriagePublic

Description

Splitting from T286515#7235469.

At https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/477ea0f97c1d763582b76570882e530149dd8356/wmf-config/CommonSettings.php#2845 there's a hack that does:

	// Set up $wgMathFullRestbaseURL - similar to VE RESTBase config above
	// HACK: $wgServerName is not available yet at this point, it's set by Setup.php
	// so use a hook
	$wgExtensionFunctions[] = function () {
		global $wgServerName, $wgMathFullRestbaseURL, $wmfRealm;
		$wgMathFullRestbaseURL = $wmfRealm === 'production'
			? 'https://wikimedia.org/api/rest_'  // T136205
			: "//$wgServerName/api/rest_";
	};

AFAICT no other service needs this hack, why is Math special? Can it do it like everything else and not require the extension function?

Event Timeline

I don't know if we still need that. However, we are about to switch from restbase to the new mediawiki rest API. So if that can wait a bit^(TM) it will be resolved automatically.

@Physikerwelt Has it been "a bit"? In other words: Is the above extension function hook still needed in wmf-config?

Sunsetting Restbase takes longer than expected. I am also surprised that it takes that long, maybe @daniel can give an estimate.