Pull Request Integration
Review Request #7963 — Created Feb. 15, 2016 and discarded
Pull Request Integration Feature
https://student-sonar.herokuapp.com/projects
This currently takes a GitHub payload containing pull request information and creates a new review request on Review Board. When a new review request is created, the GitHub commit is tagged with a status containing information about the review request. When an update is made to the pull request (synchronize), a new payload is sent and the associated review request is looked up from previously tagged information. After the review request is found, the updated pull request data overwrites the existing review request.
The status of the pull request on GitHub's side changes accordingly with the approval state of the review request.
A button exists to both merge the pull request and close the review request, when the review request has an approval status.
Payload is simulated to see how Review Board reacts. I test to see that a new Review Request is successfully created and that it is updated when a synchronize action is called.
Description | From | Last Updated |
---|---|---|
What if the X-Hub-Signature header is not provided? This will cause an attribute error (because NoneType doesn't define split method). |
brennie | |
local variable 'server_url' is assigned to but never used |
reviewbot | |
'GitDiffParser' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E116 unexpected indentation (comment) |
reviewbot | |
Col: 9 E116 unexpected indentation (comment) |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 54 E221 multiple spaces before operator |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 20 E225 missing whitespace around operator |
reviewbot | |
Col: 58 E225 missing whitespace around operator |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
local variable 'server_url' is assigned to but never used |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E116 unexpected indentation (comment) |
reviewbot | |
Col: 9 E116 unexpected indentation (comment) |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 54 E221 multiple spaces before operator |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 20 E225 missing whitespace around operator |
reviewbot | |
Col: 58 E225 missing whitespace around operator |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
local variable 'server_url' is assigned to but never used |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 65 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 65 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 65 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 45 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 19 W292 no newline at end of file |
reviewbot | |
'spy_on' imported but unused |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
local variable 'response' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 23 E231 missing whitespace after ':' |
reviewbot | |
'File' imported but unused |
reviewbot | |
'DiffCompatVersion' imported but unused |
reviewbot | |
'DiffSet' imported but unused |
reviewbot | |
'FileDiff' imported but unused |
reviewbot | |
'GitDiffParser' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 18 E225 missing whitespace around operator |
reviewbot | |
Col: 17 E225 missing whitespace around operator |
reviewbot | |
Col: 35 E231 missing whitespace after ':' |
reviewbot | |
Col: 80 E501 line too long (87 > 79 characters) |
reviewbot | |
local variable 'diffset' is assigned to but never used |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 45 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 17 W292 no newline at end of file |
reviewbot | |
Col: 80 E501 line too long (113 > 79 characters) |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 43 E231 missing whitespace after ':' |
reviewbot | |
Col: 44 E203 whitespace before ',' |
reviewbot | |
Col: 45 E231 missing whitespace after ',' |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 23 E231 missing whitespace after ':' |
reviewbot | |
Col: 23 E231 missing whitespace after ':' |
reviewbot | |
'urllib2' imported but unused |
reviewbot | |
'HttpRequest' imported but unused |
reviewbot | |
'File' imported but unused |
reviewbot | |
'DiffCompatVersion' imported but unused |
reviewbot | |
'DiffSet' imported but unused |
reviewbot | |
'FileDiff' imported but unused |
reviewbot | |
'GitDiffParser' imported but unused |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 26 E231 missing whitespace after ',' |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 45 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
local variable 'token' is assigned to but never used |
reviewbot | |
undefined name 'tkn' |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 20 W292 no newline at end of file |
reviewbot | |
Col: 80 E501 line too long (113 > 79 characters) |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 43 E231 missing whitespace after ':' |
reviewbot | |
Col: 44 E203 whitespace before ',' |
reviewbot | |
Col: 45 E231 missing whitespace after ',' |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 23 E231 missing whitespace after ':' |
reviewbot | |
Col: 23 E231 missing whitespace after ':' |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 80 E501 line too long (106 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (90 > 79 characters) |
reviewbot | |
Col: 13 E131 continuation line unaligned for hanging indent |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
local variable 'response' is assigned to but never used |
reviewbot | |
No blank line here. |
chipx86 | |
This looks like leftover debug code? |
chipx86 | |
Let's be explicit with the naming: "pull_request" and "pull-request", instead of "pr". |
chipx86 | |
Needs a docstring. See https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/ |
chipx86 | |
This is only used in one place, so you can just inline review_request.repository in that place. |
chipx86 | |
We don't use this form in our codebase. Should be: if review_request.approved: status = 'success' else: status = 'pending' |
chipx86 | |
Leftover debugging. |
chipx86 | |
_tag_branch (and most of these other methods) should be methods on the class, rather than being top-level functions. |
chipx86 | |
No need for this return. |
chipx86 | |
No blank line. |
chipx86 | |
This should go into further detail on exactly what will be happening, from a high level. Also needs info on … |
chipx86 | |
Leftover debugging. |
chipx86 | |
Blank line between these. |
chipx86 | |
Leftover debugging. |
chipx86 | |
Blank line between these. |
chipx86 | |
This is better formatted like: extra_data_dict = json.dumps({ 'id': ..., 'statuses_url': ..., ... }) |
chipx86 | |
Should be abbreviated "review_request", not "rr", for consistency with the rest of the codebase. |
chipx86 | |
Instead of creating all this yourself, you should use ReviewRequest.objects.create(), which will do a bunch of important things that your … |
chipx86 | |
No need to save the review request after adding the diffset. It doesn't affect the Review Request object. |
chipx86 | |
No blank line here. |
chipx86 | |
Comments should be in sentence casing and end with a period. This is also wrapping a bit early. |
chipx86 | |
Leftover debugging. |
chipx86 | |
This should all be happening on a draft, not on the review request itself. |
chipx86 | |
Needs to follow the docstring conventions outlined in the guide above. Same with the other functions below. |
chipx86 | |
Most of this should be inlined: return { 'repository': ..., 'summary': ..., ... } |
chipx86 | |
Leftover debugging. |
chipx86 | |
Since this is having to wrap a bit awkwardly, let's pull it out into its own variable. |
chipx86 | |
Leftover debugging. |
chipx86 | |
Blank line between these. Also, the logging.error should be a logging.exception. No need for exc_info=1 in this case. |
chipx86 | |
Best not to abbreviate so much. "tkn" should be "token". Same everywhere else. |
chipx86 | |
Indentation is a bit weird. Instead, I'd do: ghc.api_post( status_url, json.dumps({ ... }), headers={ 'Authorization': token, }) |
chipx86 | |
Everything should be in sentence casing and end with a period. |
chipx86 | |
Leftover debugging. |
chipx86 | |
Where does the -5 come from? If we have to use a number like this, we should document it. |
chipx86 | |
Leftover debugging. Check the rest of the file for this as well. |
chipx86 | |
Can be one statement. |
chipx86 | |
This means we'll crash when someone issues a merge. Best to have a proper error instead. |
chipx86 | |
Blank line between these. |
chipx86 | |
Not sure what this is really trying to say. |
chipx86 | |
Blank line between code and comments. |
chipx86 | |
Typo. |
chipx86 | |
Blank line between code and blocks. |
chipx86 | |
We have a constant for this: ReviewRequest.CLOSE_SUBMITTED. |
chipx86 | |
Blank line between these. |
chipx86 | |
code is an integer. Also, there are constants you should compare against in httplib. |
chipx86 | |
Blank line between these. |
chipx86 | |
Must follow our docstring format. First line has to be a single-line summary, and we need parameter docs. See the … |
chipx86 | |
Should only have a single from ... import per module. Use parens to wrap. |
chipx86 | |
""" on the next line. |
chipx86 | |
Should have a trailing comma. |
chipx86 | |
Here, too. |
chipx86 | |
Same here. Needs to check a flag. Also, it's assuming there's a hosting_service that isn't None, which is a bad … |
chipx86 | |
Leftover debugging. |
chipx86 | |
Unnecessary new blank line. |
chipx86 | |
Same here about checking a capability and hosting_service None-ness. Blank line before and after the conditional block. |
chipx86 | |
This code should never know about the specifics of the service being used. Instead, have a capability flag on the … |
chipx86 | |
Col: 13 E131 continuation line unaligned for hanging indent |
reviewbot | |
Since we want to move to using the API and not this, please make a note here with a big … |
chipx86 | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
undefined name '_get_auth_token' |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
undefined name 'statuses_url' |
reviewbot | |
undefined name '_get_auth_token' |
reviewbot | |
Col: 21 E222 multiple spaces after operator |
reviewbot | |
Col: 80 E501 line too long (91 > 79 characters) |
reviewbot | |
Col: 33 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 32 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 33 E122 continuation line missing indentation or outdented |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 9 E303 too many blank lines (2) |
reviewbot | |
Col: 80 E501 line too long (88 > 79 characters) |
reviewbot | |
'GitHub' imported but unused |
reviewbot | |
undefined name 'merge_pull_request' |
reviewbot | |
'DiffSetHistory' imported but unused |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 36 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 33 E126 continuation line over-indented for hanging indent |
reviewbot | |
'HostingServiceError' imported but unused |
reviewbot | |
undefined name 'HostingServiceError' |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 36 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 33 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 36 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 36 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 36 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 36 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot |
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/github.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/github.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/github.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/github.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/github.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/github.py
-
-
-
- Description:
-
Pull Request Integration Feature
https://student-sonar.herokuapp.com/projects
~ This currently has a handler for printing payloads when any GitHub event is triggered. Code is based off
post_receive_hook_close_submitted()
~ This currently takes a GitHub payload containing pull request information and creates a new review request on Review Board. When a new review request is created, the GitHub commit is tagged with a status containing information about the review request. When an update is made to the pull request (synchronize), a new payload is sent and the associated review request is looked up from previously tagged information. After the review request is found, the updated pull request data overwrites the existing review request.
- Testing Done:
-
~ None yet.
~ Payload is simulated to see how Review Board reacts. I test to see that a new Review Request is successfully created.
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/tests/test_github.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/tests/test_github.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/tests/test_github.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/tests/test_github.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/github.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/hostingsvcs/service.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/github.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/hostingsvcs/service.py WARNING: Number of comments exceeded maximum, showing 30 of 33.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Summary:
-
[WIP] Pull Request IntegrationPull Request Integration
- Description:
-
Pull Request Integration Feature
https://student-sonar.herokuapp.com/projects
~ This currently takes a GitHub payload containing pull request information and creates a new review request on Review Board. When a new review request is created, the GitHub commit is tagged with a status containing information about the review request. When an update is made to the pull request (synchronize), a new payload is sent and the associated review request is looked up from previously tagged information. After the review request is found, the updated pull request data overwrites the existing review request.
~ This currently takes a GitHub payload containing pull request information and creates a new review request on Review Board. When a new review request is created, the GitHub commit is tagged with a status containing information about the review request. When an update is made to the pull request (synchronize), a new payload is sent and the associated review request is looked up from previously tagged information. After the review request is found, the updated pull request data overwrites the existing review request.
+ The status of the pull request on GitHub's side changes accordingly with the approval state of the review request. + A button exists to both merge the pull request and close the review request, when the review request has an approval status. - Testing Done:
-
~ Payload is simulated to see how Review Board reacts. I test to see that a new Review Request is successfully created.
~ Payload is simulated to see how Review Board reacts. I test to see that a new Review Request is successfully created and that it is updated when a synchronize action is called.
- Diff:
-
Revision 8 (+372 -2)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
-
-
-
-
-
-
-
We don't use this form in our codebase. Should be:
if review_request.approved: status = 'success' else: status = 'pending'
-
-
_tag_branch
(and most of these other methods) should be methods on the class, rather than being top-level functions. -
-
-
This should go into further detail on exactly what will be happening, from a high level.
Also needs info on the function parameters, as detailed in the guide I linked above.
-
-
-
-
-
This is better formatted like:
extra_data_dict = json.dumps({ 'id': ..., 'statuses_url': ..., ... })
-
-
Instead of creating all this yourself, you should use
ReviewRequest.objects.create()
, which will do a bunch of important things that your code isn't doing, like setting a Local Site ID when needed. (Also, this code needs to factor in Local Sites).See that method (
reviewboard/reviews/managers.py:ReviewRequestManager.create
) to see what it's doing. -
No need to save the review request after adding the diffset. It doesn't affect the Review Request object.
-
-
-
-
-
Needs to follow the docstring conventions outlined in the guide above.
Same with the other functions below.
-
-
-
-
-
Blank line between these.
Also, the
logging.error
should be alogging.exception
. No need forexc_info=1
in this case. -
-
Indentation is a bit weird. Instead, I'd do:
ghc.api_post( status_url, json.dumps({ ... }), headers={ 'Authorization': token, })
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Must follow our docstring format. First line has to be a single-line summary, and we need parameter docs. See the guide above.
-
-
-
-
-
Same here. Needs to check a flag.
Also, it's assuming there's a
hosting_service
that isn'tNone
, which is a bad assumption. -
-
-
Same here about checking a capability and
hosting_service
None
-ness.Blank line before and after the conditional block.
-
This code should never know about the specifics of the service being used. Instead, have a capability flag on the hosting service saying that it can merge pull requests, like
can_merge_pull_requests
.Also, this needs to only present the button if the review request is associated with a pull request.
-
Since we want to move to using the API and not this, please make a note here with a big "XXX" that this is temporary, and explain what it needs to be turned into.
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/reviews/models/review.py reviewboard/hostingsvcs/service.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/reviews/review_detail.html
-
-
-