Page MenuHomePhabricator

Improve exception behavior for Herald commit rules which fail to load diff context
ClosedPublic

Authored by epriestley on Oct 23 2013, 12:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jun 2 2025, 2:37 AM
Unknown Object (File)
May 17 2025, 3:32 AM
Unknown Object (File)
May 17 2025, 3:32 AM
Unknown Object (File)
Apr 24 2025, 12:00 AM
Unknown Object (File)
Apr 9 2025, 7:56 PM
Unknown Object (File)
Apr 5 2025, 2:21 PM
Unknown Object (File)
Apr 3 2025, 6:13 PM
Unknown Object (File)
Mar 20 2025, 5:31 PM
Subscribers

Details

Summary

This code is a little funky right now, and can return array("error message") and then try to call getHunks() on it. Additionally, each field loads the commit's changes separately.

Instead, load the commit's changes once and cache them, and handle exceptions appropriately.

Test Plan
  • Created a rule like "changed, added, removed content all match /.*/" to force all fields to generate.
  • Ran it successfully.
  • Faked an error and ran it, got reasonable results.

Diff Detail

Branch
cadapter
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

Valid run:

{F73328}

Faked failure:

{F73330}