Page MenuHomePhabricator

Librarize includes/services/
Open, Needs TriagePublic

Description

The contents of includes/services/ (ServiceContainer and friends) do not use any MediaWiki-specific code, as far as I can tell, except for the Assert library. As such, they could be moved to the includes/libs/ directory, to signal this fact more clearly, or even extracted into a separate library published to Packagist.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 10 2018, 4:39 PM

Change 478729 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/core@master] Move includes/services/ into includes/libs/

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

Change 479747 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Adjust for Wikimedia\Services move

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

Change 479748 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] Adjust for Wikimedia\Services move

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

Change 479749 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/BlueSpiceFoundation@master] Adjust for Wikimedia\Services move

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

Change 478729 merged by jenkins-bot:
[mediawiki/core@master] Fully extract services framework as a library

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

Change 479748 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Adjust for Wikimedia\Services move

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

Change 479747 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Adjust for Wikimedia\Services move

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

What do we want to name the library? "Services"? "ServiceContainer"? I like the latter because it's much harder to confuse it with the nodejs services we have.

Legoktm moved this task from Untriaged to In Dev on the Librarization board.Jan 19 2019, 6:04 AM
daniel added a subscriber: daniel.Jan 19 2019, 9:05 AM

It's now in Wikimedia\Services. ServiceContainer may work though it's a bit too narrow. It would be nice to somehow indicate that this is about in-process service interfaces and DI infrastructure. On the other hand, this is indeed the view that PHP code should have of any node.js services it wants to call. So from PHP's perspective, "services" is correct.

Anyway, it's merged now. The library name should be the same as the namespace name, to avoid confusion. We can change the namespace name, but it would have to happen quickly, before extensions start using it.

It's now in Wikimedia\Services. ServiceContainer may work though it's a bit too narrow. It would be nice to somehow indicate that this is about in-process service interfaces and DI infrastructure. On the other hand, this is indeed the view that PHP code should have of any node.js services it wants to call. So from PHP's perspective, "services" is correct.

It could also be a nonsense/unique name (e.g. "pimple")

Or something distantly related/play on words of "service"..."Ace" (the sports usage of service), "Cutlery" (the dishes/utensils usage of service). I like "Ace" now.

Anyway, it's merged now. The library name should be the same as the namespace name, to avoid confusion. We can change the namespace name, but it would have to happen quickly, before extensions start using it.

It hasn't been included in a stable release yet, so we still have time to change it. We'll have to provide a compat layer anyways (includes/compat/).

Can we backronym "Ace"? "Augmentable Container Environment"?... naw...

Change 479749 merged by jenkins-bot:
[mediawiki/extensions/BlueSpiceFoundation@master] Adjust for Wikimedia\Services move

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

Change 518198 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/libs/Services@master] Initial import from MediaWiki core

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

Legoktm renamed this task from Move includes/services/ into includes/libs/ to Librarize includes/services/.Jun 21 2019, 6:13 AM

Change 518198 merged by jenkins-bot:
[mediawiki/libs/Services@master] Initial import from MediaWiki core

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

@Legoktm nice, thanks! Should extensions also be updated to require that new library in composer.json?