Page MenuHomePhabricator

enable use of a composer created autoloader in extensions deployed to production
Closed, ResolvedPublic

Description

Enable use of a composer created autoloader in extensions. The result would need to be deployable to production. I'm not asking for composer being run during deployment or on production, but as now before in a build step. The resulting autoloader would then be commited to the vendor repository.

Status quo:

  • Extensions deployed in production may declare composer dependencies which then get commited to mediawiki/vendor.git (the autoloader build by composer for those dependencies is included and works, but extensions may not have any autoloader prefixes and other composer autoloader settings that are added themselves).
  • Wikibase and other Mediawiki extensions are build with composer to Wikidata.git (this includes the composer generated autoloader) which is then deployed like other extensions. (Which results in e.g. extensions/Wikidata/extensions/Wikibase/ on production.)
  • https://github.com/wikimedia/composer-merge-plugin supports including requirements from other composer.json files, but not autoloader settings. See https://github.com/wikimedia/composer-merge-plugin/issues/18 for the feature request.
  • Semantic Mediawiki also has a composer generated autoloader (I was told) and wikitech.w.o is stuck on an old pre-composer version until this is solved.

After this is solved all extensions may use those composer features and Wikibase would just be an extension that is like any other extension.

Event Timeline

JanZerebecki raised the priority of this task from to Needs Triage.
JanZerebecki updated the task description. (Show Details)
JanZerebecki renamed this task from enable use of production deployed autoloader for extensions that is created by composer to enable use of a composer created autoloader in extensions deployed to production.May 5 2015, 5:04 PM
JanZerebecki updated the task description. (Show Details)
JanZerebecki set Security to None.
JanZerebecki updated the task description. (Show Details)

This would indeed be useful for the Wikidata project, especially when we start getting extensions on top of Wikibase Repostory, which will be soon. We'll be able to drop our Wikidata specific build step, have things end up in extensions as expected, and also avoid any issues related to having dependencies shared by core and build extensions being there multiple times.

SMW and several other extensions would benefit in much the same way. Supporting their autoloader definitions is required before one can recommend people to use composer.local.json rather than composer.json.

Change 214275 had a related patch set uploaded (by Legoktm):
Bump composer-merge-plugin to v1.1.0

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

Change 214275 merged by BryanDavis:
Bump composer-merge-plugin to v1.1.0

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

Legoktm assigned this task to JeroenDeDauw.

@JanZerebecki seems that fix would unlock a lot of issue for Wikibase and CI :-]

@JeroenDeDauw thank you very much!

Change 214603 had a related patch set uploaded (by JanZerebecki):
[DO NOT MERGE] Switch wikidata composer run to use the merge plugin.

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

Change 214603 merged by jenkins-bot:
Switch wikidata composer run to use the merge plugin.

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