Page MenuHomePhabricator

PHPStan failing on Wikibase backports to wmf branches
Closed, ResolvedPublic

Description

On patch set 2 of this Wikibase backport, CI failed (console):

Fatal error: Uncaught Error: Interface 'Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface' not found in /workspace/src/includes/libs/stats/IBufferingStatsdDataFactory.php:13
Stack trace:
#0 /workspace/src/includes/AutoLoader.php(221): require()
#1 [internal function]: AutoLoader::autoload()
#2 /workspace/src/includes/libs/stats/NullStatsdDataFactory.php(10): spl_autoload_call()
#3 /workspace/src/includes/AutoLoader.php(221): require('/workspace/src/...')
#4 [internal function]: AutoLoader::autoload()
#5 /workspace/src/includes/libs/rdbms/TransactionProfiler.php(117): spl_autoload_call()
#6 /workspace/src/includes/profiler/Profiler.php(61): Wikimedia\Rdbms\TransactionProfiler->__construct()
#7 /workspace/src/includes/profiler/Profiler.php(100): Profiler->__construct()
#8 /workspace/src/tests/phpunit/bootstrap.php(99): Profiler::init()
#9 phar:///workspace/src/extensions/Wikibase/vendor/phpstan/phpstan/phpstan.phar/src/Command/CommandHelper.php(133): require_once('/workspace/src/...')
#10 phar:///workspace/src/extensi in /workspace/src/includes/libs/stats/IBufferingStatsdDataFactory.php on line 13
PHP Fatal error:  Uncaught Error: Interface 'Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface' not found in /workspace/src/includes/libs/stats/IBufferingStatsdDataFactory.php:13
Stack trace:
#0 /workspace/src/includes/AutoLoader.php(221): require()
#1 [internal function]: AutoLoader::autoload()
#2 /workspace/src/includes/libs/stats/NullStatsdDataFactory.php(10): spl_autoload_call()
#3 /workspace/src/includes/AutoLoader.php(221): require('/workspace/src/...')
#4 [internal function]: AutoLoader::autoload()
#5 /workspace/src/includes/libs/rdbms/TransactionProfiler.php(117): spl_autoload_call()
#6 /workspace/src/includes/profiler/Profiler.php(61): Wikimedia\Rdbms\TransactionProfiler->__construct()
#7 /workspace/src/includes/profiler/Profiler.php(100): Profiler->__construct()
#8 /workspace/src/tests/phpunit/bootstrap.php(99): Profiler::init()
#9 phar:///workspace/src/extensions/Wikibase/vendor/phpstan/phpstan/phpstan.phar/src/Command/CommandHelper.php(133): require_once('/workspace/src/...')
#10 phar:///workspace/src/extensi in /workspace/src/includes/libs/stats/IBufferingStatsdDataFactory.php on line 13
Script phpstan analyze -a ../../tests/phpunit/bootstrap.php handling the phpstan event returned with error code 255
Script composer phpstan handling the test event returned with error code 255

We need to figure out why it’s failing and what we can do about it.

Event Timeline

Apparently the CI job runs Wikibase’s composer test before installing MediaWiki core’s dependencies? (Screenshot taken from patch set 3 of the same change, where I removed the composer phpstan command to temporarily avoid the error.)

image.png (183×330 px, 23 KB)

And Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface is just the first type that happens to be missing.

And the reason this only fails on backports seems to be that… this is a quibble-composer-* job, which just… doesn’t run on main test builds on master? The main test pipeline has quibble-vendor-* and wmf-quibble-vendor-* and mediawiki-quibble-apitests-composer-*, but no other *-composer-* jobs – those are only in test-wmf and other pipelines?

Apparently the CI job runs Wikibase’s composer test before installing MediaWiki core’s dependencies?

image.png (183×330 px, 23 KB)

And Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface is just the first type that happens to be missing.

And the difference seems to be that… this is a quibble-composer-* job, which just… doesn’t run on main test builds on master? The main test pipeline has quibble-vendor-* and wmf-quibble-vendor-* and mediawiki-quibble-apitests-composer-*, but no other *-composer-* jobs – those are only in test-wmf and other pipelines?

quibble-composer jobs are for release branches (and other circumstances where you're not aimed at Wikimedia production); they shouldn't ever be live on development or wmf/ branches.

quibble-composer jobs are for release branches (and other circumstances where you're not aimed at Wikimedia production); they shouldn't ever be live on development or wmf/ branches.

They seem to be in test-wmf and gate-and-submit-wmf at the moment if I’m reading the zuul/layout.yaml correctly: https://gerrit.wikimedia.org/r/plugins/gitiles/integration/config/+/53c171c0f8ff6333a22f7aefc54ab2acc4e50b3e/zuul/layout.yaml#1386 (part of the extension-quibble template)

Change 878132 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] Zuul: Fix extension-quibble to run vendor not composer quibble on wmf

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

Yeah, I accidentally broke this as part of the PHP 7.2 decommissioning with a copy-paste mistake. Odd that it's only happened now.

Change 878132 merged by jenkins-bot:

[integration/config@master] Zuul: Fix extension-quibble to run vendor not composer quibble on wmf

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

Mentioned in SAL (#wikimedia-releng) [2023-01-10T16:50:02Z] <James_F> Zuul: Fix extension-quibble to run vendor not composer quibble on wmf for T326653

Aha, that sounds good, thank you :)

Sorry about this. Should be fixed now.

Yup, the test build is green now. Thanks for the fix!