Page MenuHomePhabricator

Fix suggester bot unable to run phpcs
Open, Needs TriagePublic

Description

Currently seeing these errors on Toolforge.

{"message":"Error thrown while handling message App\\Message\\GerritStream. Sending for retry #1 using 1000 ms delay. Error: \"Handling \"App\\Message\\GerritStream\" failed: The process \"'vendor/bin/phpcs' '--cache=/tmp/fixsugge
sterbot/cache/mediawiki-extensions-GrowthExperiments.json' '-q' '--report=/data/project/fixsuggesterbot/fix-suggester-bot/src/PHP_CodeSniffer/Reports/GerritRobotComments.php' '/tmp/fixsuggesterbot/cache/gerrit/mediawiki-extensions
-GrowthExperiments-1027587-3'\" exceeded the timeout of 60 seconds.\"","context":{"message":{},"class":"App\\Message\\GerritStream","retryCount":1,"delay":1000,"error":"Handling \"App\\Message\\GerritStream\" failed: The process \
"'vendor/bin/phpcs' '--cache=/tmp/fixsuggesterbot/cache/mediawiki-extensions-GrowthExperiments.json' '-q' '--report=/data/project/fixsuggesterbot/fix-suggester-bot/src/PHP_CodeSniffer/Reports/GerritRobotComments.php' '/tmp/fixsugg
esterbot/cache/gerrit/mediawiki-extensions-GrowthExperiments-1027587-3'\" exceeded the timeout of 60 seconds.","exception":{"class":"Symfony\\Component\\Messenger\\Exception\\HandlerFailedException","message":"Handling \"App\\Mess
age\\GerritStream\" failed: The process \"'vendor/bin/phpcs' '--cache=/tmp/fixsuggesterbot/cache/mediawiki-extensions-GrowthExperiments.json' '-q' '--report=/data/project/fixsuggesterbot/fix-suggester-bot/src/PHP_CodeSniffer/Repor
ts/GerritRobotComments.php' '/tmp/fixsuggesterbot/cache/gerrit/mediawiki-extensions-GrowthExperiments-1027587-3'\" exceeded the timeout of 60 seconds.","code":0,"file":"/data/project/fixsuggesterbot/fix-suggester-bot/vendor/symfon
y/messenger/Middleware/HandleMessageMiddleware.php:80","previous":{"class":"Symfony\\Component\\Process\\Exception\\ProcessTimedOutException","message":"The process \"'vendor/bin/phpcs' '--cache=/tmp/fixsuggesterbot/cache/mediawik
i-extensions-GrowthExperiments.json' '-q' '--report=/data/project/fixsuggesterbot/fix-suggester-bot/src/PHP_CodeSniffer/Reports/GerritRobotComments.php' '/tmp/fixsuggesterbot/cache/gerrit/mediawiki-extensions-GrowthExperiments-102
7587-3'\" exceeded the timeout of 60 seconds.","code":0,"file":"/data/project/fixsuggesterbot/fix-suggester-bot/vendor/symfony/process/Process.php:1217"}}},"level":400,"level_name":"ERROR","channel":"messenger","datetime":"2024-06
-24T22:25:21.353946+00:00","extra":{}}

Event Timeline

Switching to a non deprecated base image (PHP 8.2) seems to have solved that problem. But now we have a different issue, which is that the contents of the report are a phpcs error:

ERROR: Referenced sniff "./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" does not exist

Run "phpcs --help" for usage information

/tmp/fixsuggesterbot/reports/gerrit/mediawiki/extensions/GrowthExperiments/phpcs.1027587-5.json

I have made a bunch of changes (see linked MRs in this task), so phpcs generation should work. The next step is to update the format to use the new suggestions format that Gerrit introduced in 3.9/3.10.