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
F18880491: D7384.id.diff
Thu, Nov 6, 8:19 PM
F18872779: D7384.diff
Wed, Nov 5, 6:10 AM
F18762900: D7384.id.diff
Oct 6 2025, 9:16 PM
F18755530: D7384.diff
Oct 5 2025, 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
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}