Diff Doctor

Review Request #6993 — Created Feb. 28, 2015 and discarded — Latest diff uploaded

Information

Review Board
master

Reviewers

This project attempts to provide a more helpful user interface when a patch fails.
A patch fails when either components: the patch file, or the to-be-patched file is corrupt. Less likely, linux patch can also fail.
The first step of this project is to catch the error in patch() as a PatchError, and provide the user a download link to the reject files as a ZIP file. This link will be implemented as a Django view.
The second step of this project involves displaying the reject files (original, diff and .rej files), rendered as in-line HTML with Pygments, in place of the error traceback.

Manual testing has been done, for:
- Normal review requests (no diff error), returns a 404
- Review request containing a failed patch, with failure due to faulty original-file (corrupted endpoints in 3rd party services with their own repositories, like gitweb, or cgit). These will return a 404 page
- Review request containing a failed patch, with failure due to patch() itself. I have only managed to replicate this by manually uploading a corrupted diff file, but am unaware of how this could happen in a real use case. The in-line reject files show up as expected in the traceback box, and the .zip download is functional