Page MenuHomePhabricator

Create composer package that contains most of the MediaWiki extension phan config instead of copy/pasting it each time
Closed, ResolvedPublic

Description

For now this could just distribute a PHP file that returns the giant array. Individual extensions could require that file, modify the array, and return it for phan.

Event Timeline

Having a default config sounds good.

  • phpcs has mediawiki-codesniffer
  • eslint has eslint-config-wikimedia
  • stylelint has stylelint-config-wikimedia
Legoktm renamed this task from Create composer package that contains most of the MediaWiki extension phan coverage instead of copy/pasting it each time to Create composer package that contains most of the MediaWiki extension phan config instead of copy/pasting it each time.Feb 3 2018, 8:40 PM

Change 407988 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/phan@master] Initial commit

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

Change 407988 merged by jenkins-bot:
[mediawiki/tools/phan@master] Initial commit

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

Change 408107 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/TwoColConflict@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

This doesn't work yet because jenkins is not installing local composer dependencies when running phan...

Change 410005 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[integration/config@master] ci-src-setup: Install extension's composer dependencies too

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

Change 410005 merged by jenkins-bot:
[integration/config@master] ci-src-setup: Install extension's composer dependencies too

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

The TwoColConflict PoC patch should be ready to merge now.

Change 408107 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

$cfg = require __DIR__ . '/../../vendor/mediawiki/mediawiki-phan-config/src/config.php';

Hm.. could we expose this as a public interface instead? E.g. a public static member on a namespaced/autoloaded class? Or if we want stay as a 'returning file array', we could at least have a class method that does the same thing, but from within the library. So that from the outside we just reference MediaWiki\Phan\Config::$defaults or MediaWiki\Phan\Config::getDefaults(), instead of requiring the file directly from vendor, which seems a bit fragile.

The following extensions now missing the new package:

  • ArticleCreationWorkflow
  • CirrusSearch
  • LoginNotify
  • Wikibase

Change 414123 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/ArticleCreationWorkflow@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

Change 414124 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/LoginNotify@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

Change 414125 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/CirrusSearch@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

Changed three extensions.

mediawiki/extensions/Wikibase and mediawiki/core are still using own free config file.
Both seems very special, maybe should be tracked in own phabs when there should be changed.

Ideas of improving phan-config should be tracked as own phab

Change 414125 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

Change 414124 merged by jenkins-bot:
[mediawiki/extensions/LoginNotify@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

Change 414123 merged by jenkins-bot:
[mediawiki/extensions/ArticleCreationWorkflow@master] Use mediawiki/mediawiki-phan-config to centralize phan configuration

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

This is basically all done now. I believe Wikibase is the only holdout, but that's because it still isn't using the standard directory layout.