This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/bitbucket.py Ignored Files:
Fix the extraction of commit hashes from Bitbucket webhook payloads.
Review Request #5851 — Created May 21, 2014 and submitted
I needed to make this change before
/bitbucket/hooks/close-submitted/would work for commits which don't have the review request ID in the commit message.
This is what a Bitbucket webhook looks like:
I don't have access to a Mercurial repository, but according to the sparse documentation of the format, the important parts of the Mercurial webhook JSON are identical to the git version:
Previously, the commit hash was read from the 'node' field of the JSON payload,
which only holds the first 12 characters of the git hash.
If we're trying to determine which review request ID corresponds to a given
webhook, but the request ID is not mentioned in the commit comment, then we must
search for an existing review request which matches the commit hash in the
Since the 'get_review_request_id' function searches for an exact match of the
commit hash, we now use the 'raw_node' property, which contains the full hash.
Tested by pushing to a private Bitbucket git.
The commit did not mention the review request ID, but the request was automatically closed after the webhook was received.
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/bitbucket.py Ignored Files: