Page MenuHomePhabricator

phpunit-patch-coverage fails if a file was renamed
Closed, ResolvedPublic

Description

21:16:05 PHP Notice:  Undefined index: R in /opt/phpunit-patch-coverage/vendor/mediawiki/phpunit-patch-coverage/src/Git.php on line 57
21:16:05 PHP Fatal error:  Uncaught Error: Cannot access empty property in /opt/phpunit-patch-coverage/vendor/mediawiki/phpunit-patch-coverage/src/Git.php:59
21:16:05 Stack trace:
21:16:05 #0 /opt/phpunit-patch-coverage/vendor/mediawiki/phpunit-patch-coverage/src/CheckCommand.php(161): MediaWiki\Tool\PatchCoverage\Git->getChangedFiles('9f86db20286c2c3...')
21:16:05 #1 /opt/phpunit-patch-coverage/vendor/symfony/console/Command/Command.php(251): MediaWiki\Tool\PatchCoverage\CheckCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
21:16:05 #2 /opt/phpunit-patch-coverage/vendor/symfony/console/Application.php(946): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
21:16:05 #3 /opt/phpunit-patch-coverage/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(MediaWiki\Tool\PatchCoverage\CheckCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfo in /opt/phpunit-patch-coverage/vendor/mediawiki/phpunit-patch-coverage/src/Git.php on line 59

https://integration.wikimedia.org/ci/job/mediawiki-phpunit-coverage-patch-docker/792/console

Looks like I didn't think about file renames when implementing https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/tools/phpunit-patch-coverage/+/master/src/Git.php#28

Probably it would be easiest to consider renames as deletion of one file and creation of another.

Event Timeline

Change 487635 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/phpunit-patch-coverage@master] Properly handle renamed files

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

Change 487635 merged by jenkins-bot:
[mediawiki/tools/phpunit-patch-coverage@master] Properly handle renamed files

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

Krinkle triaged this task as Medium priority.Feb 7 2019, 2:31 AM
Krinkle removed a project: Patch-For-Review.

For your information, it seems the CI relevant for https://gerrit.wikimedia.org/r/492298 is still running an old version of the script in question.

Re-opening for now as reminder to release/deploy. (Sorry)

Re-opening for now as reminder to release/deploy. (Sorry)

I guess we need to use the 0.0.10 release into the quibble-fresnel, quibble-stretch and quibble-stretch-php70 ?