Page MenuHomePhorge

Fix RuntimeException: min(): Array must contain at least one element
ClosedPublic

Authored by aklapper on Aug 22 2023, 09:09.

Details

Summary

Make sure that $epochs[] is never empty but contains 0 so min($epochs) will not complain.

Closes T15623

Test Plan

Carefully read the code (as I am unaware of reproduction steps).

Diff Detail

Repository
rP Phorge
Branch
T15623min (branched from master)
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 799
Build 799: arc lint + arc unit

Unit TestsFailed

TimeTest
1,517 msPhabricatorLibraryTestCase::testEverythingImplemented
EXCEPTION (Exception): Source file "/var/www/html/phorge/phorge/src/applications/project/xaction/PhabricatorProjectDescriptionTransaction.php" failed to load. #0 /var/www/html/phorge/arcanist/src/init/lib/PhutilBootloader.php(211): PhutilBootloader->executeInclude('...') #1 /var/www/html/phorge/arcanist/src/symbols/PhutilSymbolLoader.php(423): PhutilBootloader->loadLibrarySource('...', '...')
243 msPhabricatorLibraryTestCase::testLibraryMap
Assertion failed, expected 'true' (at PhutilLibraryTestCase.php:45): The library map is out of date. Rebuild it with `arc liberate`. These entries differ: class.PhabricatorProjectDescriptionTransaction, xmap.PhabricatorProjectDescriptionTransaction.
4 msPhabricatorLibraryTestCase::testMethodVisibility
EXCEPTION (Exception): Source file "/var/www/html/phorge/phorge/src/applications/project/xaction/PhabricatorProjectDescriptionTransaction.php" failed to load. #0 /var/www/html/phorge/arcanist/src/init/lib/PhutilBootloader.php(211): PhutilBootloader->executeInclude('...') #1 /var/www/html/phorge/arcanist/src/symbols/PhutilSymbolLoader.php(423): PhutilBootloader->loadLibrarySource('...', '...')
3 msDiffusionServeControllerTestCase::testHandleRequest
2 assertions passed.
147 msPhabricatorCelerityTestCase::testCelerityMaps
1 assertion passed.
View Full Test Results (3 Failed · 5 Passed)

Event Timeline

Obviously not a clean tree, sorry. Thus ran arc liberate, now arc asked whether to include unstaged changes in src/__phutil_library_map__.php (yes)

and that's now wrong because src/__phutil_library_map__.php includes a non-existing file though I had ran git stash. I love git...

Try again, after an rm and arc liberate on master, and then a git rebase master on this branch

This revision is now accepted and ready to land.Aug 22 2023, 09:27