Page MenuHomePhabricator

Clean up ExtensionRegistry autoloading mess
Open, Needs TriagePublic

Description

I (Legoktm) made a mistake early in the ExtensionRegistry design, and special cased autoloading. I recognized this back in May 2018, and filed T196012: ExtensionRegistry::readFromQueue() should not autoload classes. There was some complication with the installer at the time, so I didn't prioritize fixing it.

Then T226911: Support running unit tests and extending MediaWikiUnitTestCase in skins and extensions happened, which messed up a lot of things, and added technical debt that still is unresolved. My CR at first patch and second patch mostly sum up what I think the situation is:

My understanding is that this fundamentally broken. It doesn't check manifest_version, it skips dependency checking, it reaches into ExtensionRegistry and makes a part of the processing that should never have been public, public, and abuses it. There's no clear documentation of what should happen, nor the potential side-effects. Autoloading extensions without actually loading them is not something that is supported in the ExtensionRegistry architecture. If we want to do that, it should be a conscious choice, with design/architecture work behind it, not like this.

It's likely too late to revert this now, but it still needs significant clean up.

Then T196090: Extensions should be able to add to the test autoloader came along, and while well intentioned, only made the above problem even worse.