Page MenuHomePhabricator

Fix an issue where Herald may fail to extract content from an empty commit
ClosedPublic

Authored by epriestley on Apr 20 2022, 4:53 PM.
Tags
None
Referenced Files
F14084932: D21761.id51876.diff
Sat, Nov 23, 10:12 AM
F14084931: D21761.id51878.diff
Sat, Nov 23, 10:12 AM
Unknown Object (File)
Thu, Nov 21, 7:45 PM
Unknown Object (File)
Mon, Nov 18, 10:45 AM
Unknown Object (File)
Thu, Nov 14, 10:03 PM
Unknown Object (File)
Thu, Nov 14, 5:25 AM
Unknown Object (File)
Thu, Nov 14, 3:43 AM
Unknown Object (File)
Thu, Nov 14, 1:47 AM
Subscribers
None

Details

Summary

Ref T13667. The Herald "content added" rule (and other similar rules) do not correctly extract content from empty commits.

When we load an empty raw diff, return an empty changed content map.

Ref T13588. Also fix some PHP8.1 null/string stuff

Test Plan
  • Ran "bin/repository reparse --publish <commit>", with an empty commit hash and a nonempty commit hash.
  • Reviewed Herald transcripts for general sanity.

Diff Detail

Repository
rP Phabricator
Branch
sub3
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 25648
Build 35476: arc lint + arc unit

Unit TestsFailed

TimeTest
0 msDiffusionURITestCase::testBlobDecode
EXCEPTION (RuntimeException): explode(): Passing null to parameter #2 ($string) of type string is deprecated #0 [internal function]: PhutilErrorHandler::handleError(8192, 'explode(): Pass...', '/Users/epriestl...', 521) #1 /Users/epriestley/dev/core/lib/phabricator/src/applications/diffusion/request/DiffusionRequest.php(521): explode('/', NULL)
6 msDiffusionURITestCase::testURIGeneration
EXCEPTION (RuntimeException): strlen(): Passing null to parameter #1 ($string) of type string is deprecated #0 /Users/epriestley/dev/core/lib/phabricator/src/applications/repository/storage/PhabricatorRepository.php(752): PhutilErrorHandler::handleError(8192, 'strlen(): Passi...', '/Users/epriestl...', 752) #1 /Users/epriestley/dev/core/lib/phabricator/src/applications/diffusion/request/__tests__/DiffusionURITestCase.php(142): PhabricatorRepository->generateURI(Array)
0 msPhabricatorRepositoryTestCase::testSubversionPathInfo
EXCEPTION (RuntimeException): strlen(): Passing null to parameter #1 ($string) of type string is deprecated #0 /Users/epriestley/dev/core/lib/phabricator/src/applications/repository/storage/PhabricatorRepository.php(304): PhutilErrorHandler::handleError(8192, 'strlen(): Passi...', '/Users/epriestl...', 304) #1 /Users/epriestley/dev/core/lib/phabricator/src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php(60): PhabricatorRepository->getSubversionPathURI()
0 msPhabricatorRepositoryURITestCase::testRepositoryURICanonicalization
EXCEPTION (RuntimeException): strlen(): Passing null to parameter #1 ($string) of type string is deprecated #0 /Users/epriestley/dev/core/lib/phabricator/src/applications/repository/storage/PhabricatorRepository.php(582): PhutilErrorHandler::handleError(8192, 'strlen(): Passi...', '/Users/epriestl...', 582) #1 /Users/epriestley/dev/core/lib/phabricator/src/applications/repository/storage/PhabricatorRepository.php(591): PhabricatorRepository->getURI()
32 msPhabricatorRepositoryURITestCase::testURIGeneration
EXCEPTION (RuntimeException): strlen(): Passing null to parameter #1 ($string) of type string is deprecated #0 /Users/epriestley/dev/core/lib/phabricator/src/applications/repository/storage/PhabricatorRepository.php(284): PhutilErrorHandler::handleError(8192, 'strlen(): Passi...', '/Users/epriestl...', 284) #1 /Users/epriestley/dev/core/lib/phabricator/src/applications/repository/storage/PhabricatorRepository.php(1180): PhabricatorRepository->getSubversionBaseURI()
View Full Test Results (5 Failed · 27 Passed · 1 Skipped)