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
F15484757: D7384.diff
Wed, Apr 9, 7:56 PM
F15472534: D7384.diff
Sat, Apr 5, 2:21 PM
F15467836: D7384.id16639.diff
Thu, Apr 3, 6:13 PM
F15417545: D7384.id16639.diff
Thu, Mar 20, 5:31 PM
F15384163: D7384.id.diff
Mar 14 2025, 6:59 PM
F15376425: D7384.id16639.diff
Mar 13 2025, 3:33 AM
Unknown Object (File)
Feb 28 2025, 12:05 PM
Unknown Object (File)
Feb 26 2025, 6:27 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}