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
F15417545: D7384.id16639.diff
Thu, Mar 20, 5:31 PM
F15384163: D7384.id.diff
Fri, Mar 14, 6:59 PM
F15376425: D7384.id16639.diff
Thu, Mar 13, 3:33 AM
Unknown Object (File)
Fri, Feb 28, 12:05 PM
Unknown Object (File)
Wed, Feb 26, 6:27 AM
Unknown Object (File)
Wed, Feb 26, 6:27 AM
Unknown Object (File)
Feb 22 2025, 12:39 AM
Unknown Object (File)
Feb 15 2025, 10:18 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}