Add GitHub post-receive hook to close review requests automatically.

Review Request #5596 — Created March 7, 2014 and submitted — Latest diff uploaded

Information

Review Board
master
798641b...

Reviewers

This is a GitHub post-receive hook that will automatically close review requests as "submitted" after a push. To determine which review requests should be closed, it scans through each commit's commit message for the following strings (case-insensitive): "Reviewed at <reviewboard_url>/r/<id>" or "Review request #<id>". The regex used for this can be overriden in settings_local.py.

Added the post-receive webhook URL to a private GitHub repository, and tested different pushes:
- Commit with a review request ID that is not submitted (verified that the review request is closed and set to submitted)
- Commit with a review request ID that is already submitted (got a warning that the review request is already submitted)
- Commit without a review request ID in the commit message (got a debug message that no matching review request ID was found)
- Commit with a private review request (verified that the review request is closed)
- Commits referencing the same review request ID
- Multiple commits
- Merge commits
- Branch creation and deletion
- Commits pushed to two branches

I also overrode the regex and flags in settings_local.py, and got the expected change in matching review request IDs.