-
-
reviewboard/hostingsvcs/hook_utils.py (Diff revision 1) While the regex will hopefully be correctly written, I think we should sanity-check by wrapping this in a
try ValueError:
-
Add a check to find a review request with a matching commit ID for webhooks.
Review Request #5666 — Created April 1, 2014 and submitted
Information | |
---|---|
anselina | |
Review Board | |
master | |
d46c0e5... | |
Reviewers | |
reviewboard, students | |
Previously, we relied only on the regex to match a review request ID in the
commit message. Now, we use the regex to try to find a matching review request
ID in the commit message, and if no match is found, we then use the commit ID
to try to find a matching review request.
I pushed different commits to a GitHub repository with the post-receive webhook
enabled (and saw the expected behaviour):
- Commit that did not match the regex but matched a review request's commit ID
- Commit that did not match the regex and did not match a review request's
commit ID
- Commit that matched the regex
Description | From | Last Updated |
---|---|---|
While the regex will hopefully be correctly written, I think we should sanity-check by wrapping this in a try ValueError: |
|
|
You'll still need to set a value here, or there won't be anything to return. What would the caller do … |
|
|
This line isn't needed. |
|
Change Summary:
Fixed review issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+27 -6) |
-
-
reviewboard/hostingsvcs/hook_utils.py (Diff revisions 1 - 2) You'll still need to set a value here, or there won't be anything to return.
What would the caller do if the return value isn't a valid review request ID?
(We also may want to use None instead of 0 to indicate that we don't have the ID.)
Change Summary:
Set a missing review_request_id value, and return None instead of 0 when a matching review request ID cannot be found.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+30 -8) |