Page MenuHomePhabricator

minus-x broke MediaWiki core CI: Too many arguments, expected arguments "command" "path"
Closed, ResolvedPublic

Description

E.g. https://integration.wikimedia.org/ci/job/mediawiki-quibble-composertest-php70-docker/10986/console :

01:17:02 INFO:test.run_composer_test:Running composer test
...
01:17:12 > composer minus-x 'includes/DefaultSettings.php' 'includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php' 'includes/password/UserPasswordPolicy.php' 'includes/user/User.php' 'tests/phpunit/includes/auth/AbstractPasswordPrimaryAuthenticationProviderTest.php' 'tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php' 'tests/phpunit/includes/password/UserPasswordPolicyTest.php'
01:17:12 > minus-x check 'includes/DefaultSettings.php' 'includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php' 'includes/password/UserPasswordPolicy.php' 'includes/user/User.php' 'tests/phpunit/includes/auth/AbstractPasswordPrimaryAuthenticationProviderTest.php' 'tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php' 'tests/phpunit/includes/password/UserPasswordPolicyTest.php'
01:17:12 
01:17:12                                                             
01:17:12   Too many arguments, expected arguments "command" "path".  
01:17:12                                                             
01:17:12 
01:17:12 check <path>
01:17:12 
01:17:12 Script minus-x check handling the minus-x event returned with error code 1
01:17:12 Script composer minus-x handling the test event returned with error code 1

Apparently some CI code calls composer test specifically on the changed files, and minus-x gets confused from the extra arguments.

Event Timeline

Change 481834 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] Revert "build: Run minus-x to check for executable files that shouldn't be"

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

Change 481834 merged by jenkins-bot:
[mediawiki/core@master] Revert "build: Run minus-x to check for executable files that shouldn't be"

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

It seems MinusX can only work on one directory and not of a list of one or more files as given by CI

> composer minus-x 'includes/logging/LogPager.php'
> minus-x check 'includes/logging/LogPager.php'
MinusX
======
Processing /workspace/src/includes/logging/LogPager.php...

In CheckCommand.php line 236:
                                                                               
  RecursiveDirectoryIterator::__construct(/workspace/src/includes/logging/Log  
  Pager.php): failed to open dir: Not a directory                              
                                                                               

check <path>

So the question is, if MinusX needs support for a list of files over the arguments or does mediawiki/core needs a new CI job to always run over the whole repo, see T212746 for the other issue. Than MinusX does not need adjustment.

hashar claimed this task.

That got fixed by reverting the addition of minus-x (which was https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/402166/ ).

I have described arguments being passed to composer test on T188022#4847735 which I reopened.