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
F18478529: D7384.diff
Wed, Sep 3, 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
F17923580: D7384.diff
Jul 30 2025, 8:25 AM
Unknown Object (File)
Jun 2 2025, 2:37 AM
Unknown Object (File)
May 17 2025, 3:32 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}