Page MenuHomePhabricator

Unclear expectations around path/module in $wgVirtualRestConfig
Open, LowPublic

Description

MediaWikiServices::getVirtualRESTServiceClient() expects $wgVirtualRestConfig to contain the individual service configurations under a paths key, indexed by mount point. The documentation, WMF production
and Vagrant (1, 2) put the configuration under the module key instead. DefaultSettings.php mentions both options but leaves the relation between them unclear. It seems like all MediaWiki extensions that use VirtualRESTServiceClient just piece the config together manually (1, 2, 3, 4). Is the service wiring deprecated/abandoned? Is it an unfinished rewrite? Are new extensions expected to set up their client manually? More clarity around that would be welcome.

Event Timeline

mobrovac added a project: Services (later).

The ServiceWiring code was introduced in August 2016. Apparently nothing used it until January 2020, when it was used in an experimental REST handler, but that handler will presumably fail in production due to this bug.

The ServiceWiring code was introduced in August 2016. Apparently nothing used it until January 2020, when it was used in an experimental REST handler, but that handler will presumably fail in production due to this bug.

It wouldn't fail in prod since the handler as well is patching the config together manually just like in the other cases.