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
F18762900: D7384.id.diff
Mon, Oct 6, 9:16 PM
F18755530: D7384.diff
Sun, Oct 5, 6:02 AM
F18634430: D7384.id16632.diff
Sep 16 2025, 10:17 PM
F18478529: D7384.diff
Sep 3 2025, 6:00 AM
F18101403: D7384.id16632.diff
Aug 9 2025, 12:57 PM
F17955584: D7384.id16639.diff
Aug 1 2025, 4:53 AM
F17948526: D7384.id.diff
Jul 31 2025, 9:17 PM
F17924431: D7384.id16632.diff
Jul 30 2025, 9:59 AM
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}