Page MenuHomePhabricator

Jenkins must not load ZeroPortal before ZeroBanner
Closed, ResolvedPublic

Description

mediawiki-extensions-zend and mediawiki-extensions-hhvm are currently failing on master for ZeroBanner commits.

https://integration.wikimedia.org/ci/job/mediawiki-extensions-hhvm/1593/console
https://integration.wikimedia.org/ci/job/mediawiki-extensions-zend/1563/console

21:26:40 ZeroBanner extension has not been added

.. produced by ZeroPortal.php, which requires ZeroBanner be loaded first.

This previously worked fine, since the extension dependencies at https://github.com/wikimedia/integration-config/blob/8119a485f7709c56ccc6a0d59a54ee9c1829672a/jjb/mediawiki-extensions.yaml#L1028-L1031 were in the right order and didn't include downstream dependencies.

The 'mediawiki-extensions-{phpflavor}' (using Zool cloner and the extension group), is broken for ZeroBanner commits because ZeroPortal is part of the group and incorrectly being loaded first.

mediawiki/conf.d/50_mw_ext_loader.php

	// Make sure the current extension is loaded last
	if ( $currentExt ) {
		$currentExtFile = $ext_to_load[$currentExt];
		unset( $ext_to_load[$currentExt] );
		$ext_to_load[$currentExt] = $currentExtFile;
	}

This is killing ZeroBanner.

Event Timeline

Krinkle raised the priority of this task from to Unbreak Now!.
Krinkle updated the task description. (Show Details)
Krinkle subscribed.
gerritbot subscribed.

Change 187492 had a related patch set uploaded (by Krinkle):
mediawiki/conf.d: Remove currentExt-last override

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

Patch-For-Review

Change 187492 merged by jenkins-bot:
mediawiki/conf.d: Remove currentExt-last override

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

hashar subscribed.

We should be able to load extensions in random order, for example by using scandir() which might yields then in their order of creations.

The way we have fixed those die() issue, is to move it from the extension entry point to a SetupAfterCache hook (which is executed early but after all extensions have been included). That is much more robust.

Change 188115 had a related patch set uploaded (by Hashar):
Delay ZeroBanner die requirement after setup

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

Patch-For-Review

@hashar Yeah, but that's not the reality right now. At the moment https://gerrit.wikimedia.org/r/188115 has not been merged yet, and there's also still the dependency on JsonConfig.

I noticed change rCICF49e703cb8592: Ensure extensions are loaded in a consistent order 49e703cb859 was broke this again, after I fixed this bug.

Closing task this as it the original issue was fixed. If you want to make the order alphabetical and universal without dependencies, maybe file an enhancement task for sometime in the future. (But first work with individual projects to support this, as right now this is not a supported expectation. Even in wmf-production we have a very specific load order.)

I noticed change rCICF49e703cb8592: Ensure extensions are loaded in a consistent order 49e703cb859 was broke this again, after I fixed this bug.

I need the order to be made consistent as described in that commit summary message. When using check experimental on AntiSpoof the extension is loaded at the end and its tests are run last (apparently) but when adding AntiSpoof to the shared job it has side effects with some other tests. Hence why I need to make sure the extensions are loaded in a set order.

I guess https://gerrit.wikimedia.org/r/188115 will be further refined and fix the issue properly eventually.

TimedMediaHandler suffers from a similar issue. It requires the MwEmbedSupport and will die early on even if MwEmbedSupport is loaded just after. Filled as T88729: TimedMediaHandler jenkins PHPUnit tests fail: depends on MwEmbedSupport extension.

Change 188115 merged by jenkins-bot:
Delay ZeroBanner die requirement after setup

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