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
Unknown Object (File)
Sat, Feb 15, 10:18 AM
Unknown Object (File)
Sun, Feb 9, 10:22 AM
Unknown Object (File)
Sun, Feb 9, 10:22 AM
Unknown Object (File)
Sun, Feb 9, 10:22 AM
Unknown Object (File)
Sun, Feb 9, 10:22 AM
Unknown Object (File)
Fri, Jan 31, 3:20 PM
Unknown Object (File)
Mon, Jan 27, 7:51 AM
Unknown Object (File)
Jan 18 2025, 12:14 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}