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
F19896992: D7384.id.diff
Sun, Mar 29, 6:01 AM
F19887249: D7384.id.diff
Mon, Mar 23, 2:08 AM
F19826695: D7384.id16632.diff
Mon, Mar 9, 12:09 AM
F19826624: D7384.id16632.diff
Sun, Mar 8, 11:15 PM
F19825309: D7384.diff
Mar 8 2026, 10:15 AM
F19823345: D7384.id.diff
Mar 7 2026, 11:24 AM
F19711888: D7384.id16639.diff
Feb 11 2026, 7:41 PM
F19705615: D7384.diff
Feb 11 2026, 7:48 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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Valid run:

{F73328}

Faked failure:

{F73330}