4633: ReviewBot - pmd

Misery

Looks like there is no ReviewBot category here. So adding this to Reviewboard.

What version are you running?

3.0.2 and ReviewBot master

What steps will reproduce the problem?

  1. Upload a patch with a git diff for a binary
  2. Let pmd check those review

What is the expected output? What do you see instead?

pmd success but it shows "internal error"

Please provide any additional information below.

[2018-01-18 14:43:39,900: ERROR/Worker-3] reviewbot.tasks.RunTool[bcb8bc97-42ab-4a5a-9d28-746894f18214]: Error executing tool "PMD": There was an error fetching a source file. (HTTP 500, API Error 221) (server=https://rb.user.de/, review_request_id=9515, diff_revision=2)
Traceback (most recent call last):
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/reviewbot/tasks.py", line 185, in RunTool
base_commit_id=base_commit_id)
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/reviewbot/tools/init.py", line 61, in execute
self.handle_files(review.files, settings)
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/reviewbot/tools/init.py", line 77, in handle_files
self.handle_file(f, settings)
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/reviewbot/tools/pmd.py", line 52, in handle_file
path = f.get_patched_file_path()
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/reviewbot/processing/review.py", line 81, in get_patched_file_path
contents = self.patched_file_contents
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/reviewbot/processing/review.py", line 52, in patched_file_contents
patched_file = self._api_filediff.get_patched_file()
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/rbtools/api/resource.py", line 146, in <lambda>
self._get_url(url, kwargs)))
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/rbtools/api/decorators.py", line 27, in request_method
*args,
kwargs)
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/rbtools/api/transport/sync.py", line 75, in execute_request_method
return self._execute_request(request)
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/rbtools/api/transport/sync.py", line 84, in _execute_request
rsp = self.server.make_request(request)
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/rbtools/api/request.py", line 587, in make_request
self.process_error(e.code, e.read())
File "/home/user/reviewbot-worker/local/lib/python2.7/site-packages/rbtools/api/request.py", line 560, in process_error
rsp['err']['msg'])
APIError: There was an error fetching a source file. (HTTP 500, API Error 221)

Misery
#1 Misery

Seems the checker will fail for binaries.

Misery
#2 Misery

I missed the reviewboard error....

DEBUG - None - A - /api/review-requests/35/diffs/1/files/375/patched-file/ - root - Begin: Patching file dummy.png
DEBUG - None - A - /api/review-requests/35/diffs/1/files/375/patched-file/ - root - End: Patching file dummy.png
DEBUG - None - A - /api/review-requests/35/diffs/1/files/375/patched-file/ - root - Patching file dummy.png took 0.019539 seconds
ERROR - None - A - /api/review-requests/35/diffs/1/files/375/patched-file/ - root - PatchedFileResource: Error retrieving patched file for FileDiff 375: The patch to "dummy.png" did not apply cleanly.
Traceback (most recent call last):
File "/var/www/dist/lib/python2.7/site-packages/reviewboard/webapi/resources/base_patched_file.py", line 66, in get
patched_file = get_patched_file(orig_file, filediff, request)
File "/var/www/dist/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 261, in get_patched_file
return patch(diff, buffer, filediff.dest_file, request)
File "/var/www/dist/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 204, in patch
diff, rejects)
PatchError: The patch to "dummy.png" did not apply cleanly.

david
#3 david

Created a Review Bot project.

  • -reviewboard
    +reviewbot
Misery
#4 Misery

Let avoid it: https://reviews.reviewboard.org/r/9530/