Create a new Review Request after creating a PR on Github
Review Request #8741 — Created Feb. 12, 2017 and discarded
I didn't have permission to modify r/8437/, so I'm posting this as a separate RR. A decent portion of this diff is stuff that Dominic did. Anything involving social authentication is stuff I did.
Users may now authenticate with GitHub, associating their RR account with their GitHub account. When a webhook pull request is incoming, it will attempt to find a user with that GitHub username and submit it under their name, else it submits it under a dummy account (No_Submitter).
I have also added the ability to authenticate with a BitBucket account. The data is currently not showing up in the database even though it successfully authenticates.
Nothing except testing that it actually works - no unit tests or attempting to break it.
Description | From | Last Updated |
---|---|---|
There's some weird stuff going on in settings.py. It looks like you may have squashed some changes into this one. |
brennie | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
We should use social-auth-core and social-auth-app-django for this. See http://python-social-auth.readthedocs.io/en/latest/. We don't want to limit this too just GitHub. Ideally … |
brennie | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 5 E303 too many blank lines (3) |
reviewbot | |
local variable 'e' is assigned to but never used |
reviewbot | |
Col: 22 E225 missing whitespace around operator |
reviewbot | |
Col: 80 E501 line too long (100 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 5 E303 too many blank lines (3) |
reviewbot | |
local variable 'e' is assigned to but never used |
reviewbot | |
Col: 22 E225 missing whitespace around operator |
reviewbot | |
Col: 80 E501 line too long (100 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'HttpResponseRedirect' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 0 |
reviewbot | |
Col: 5 E303 too many blank lines (3) |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
redefinition of unused 'login_required' from line 3 |
reviewbot | |
'render' imported but unused |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 5 E303 too many blank lines (3) |
reviewbot | |
local variable 'e' is assigned to but never used |
reviewbot | |
undefined name 'UserSocialAuth' |
reviewbot | |
Col: 22 E225 missing whitespace around operator |
reviewbot | |
Col: 80 E501 line too long (100 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'HttpResponseRedirect' imported but unused |
reviewbot | |
redefinition of unused 'login_required' from line 3 |
reviewbot | |
'render' imported but unused |
reviewbot | |
Col: 48 E225 missing whitespace around operator |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
Imports should be alphabetized. |
brennie | |
redefinition of unused 'login_required' from line 3 |
reviewbot | |
'render' imported but unused |
reviewbot | |
This would go with the django imports asits a 3rd party import. In general, imports are grouped as such: from … |
brennie | |
Undo this. |
brennie | |
See other comment about imports. |
brennie | |
Only one blank line between class methods. |
brennie | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
These must be added in load_siteconfig in admin/siteconfig.py line 366 with the web api token backend. |
brennie | |
These need to be blank and added to the settings_local template. |
brennie | |
These need to be blank and added to the settings_local template. |
brennie | |
Missing trailing comma. |
brennie | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
Undo this. |
brennie | |
We should only render these if a user hasnt already connected with them. |
brennie | |
Lets put these under social/ or something. Otherwise they are polluting the global URL namespace. |
brennie | |
These would be in settings.py |
brennie | |
redefinition of unused 'login_required' from line 3 |
reviewbot | |
'render' imported but unused |
reviewbot | |
redefinition of unused 'ReviewRequest' from line 51 |
reviewbot | |
redefinition of unused 'User' from line 17 |
reviewbot | |
Col: 5 E303 too many blank lines (2) |
reviewbot | |
Col: 20 E703 statement ends with a semicolon |
reviewbot | |
Col: 5 E303 too many blank lines (2) |
reviewbot | |
Col: 5 E303 too many blank lines (2) |
reviewbot | |
Col: 27 E225 missing whitespace around operator |
reviewbot | |
Col: 43 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 45 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 65 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 67 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 80 E501 line too long (132 > 79 characters) |
reviewbot | |
Col: 81 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 83 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 119 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 121 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
Col: 1 E303 too many blank lines (3) |
reviewbot | |
This file shouldnt be in the diff. |
brennie | |
If you insert the other auth backends correctly, this wont be necessary. See my comment from a while back. |
brennie | |
Undo. |
brennie | |
Blank line between these. |
brennie | |
Undo |
brennie | |
The password backend kludge stuff needs to be undone. |
brennie | |
Undo. |
brennie | |
Can you add documentation to explain what this does? |
brennie | |
Undo. |
brennie | |
Missing a period. |
brennie | |
Use a tuple. This list should not be changing at runtime. |
brennie | |
Review Board |
brennie | |
Single quotes for strings. |
brennie | |
Reformat as: raise ValueError( '... %s' % ', '.join(self.PR_STATUSES) ) |
brennie | |
Reformat as: status_url = self._build_api_url( '%s/statuses/%s % (self._get_repo_api_url(repository), commit) ) |
brennie | |
Missing trailing comma. |
brennie | |
We dont use PEP484. This should be typename, optional, e.g., unicode, optional. |
brennie | |
types should use :py:class:`type` You can just say the response status here instead, e.g. "A 200 OK is returned if … |
brennie | |
Blank line between these |
brennie | |
Blank line between these. |
brennie | |
This corresponds to a header, so it should use the header name X-Hub-Signature. |
brennie | |
dict. Same elsewhere. |
brennie | |
Blank line between these. |
brennie | |
This seems like testing code, yes? |
brennie | |
Should use an invalid password instead. |
brennie | |
You can move that inline. |
brennie | |
Undo |
brennie | |
Undo. |
brennie | |
3rd party stuff should come before reviewboard. |
brennie | |
Undo. |
brennie | |
Looks like youve had a rebase go bad. |
brennie | |
First import should be from __future__ import unicode_literals. |
brennie | |
These methods need docstrings. |
brennie | |
booleans are singletons in python, you will want to use is not True. |
brennie | |
str.format() is quite slow. Use %-interpolation instead. |
brennie | |
Reformat as per other comment. |
brennie | |
We prefer to format as: return { 'social': social, 'user': social.user, 'new_association': True, } No semicolon necessary. |
brennie | |
comments should be complete sentences and end with periods. |
brennie | |
'string' imported but unused |
reviewbot | |
'random.choice' imported but unused |
reviewbot | |
This shouldn't be in the diff. Whats up with this? |
brennie | |
Likewise this also shouldn't be in the diff. |
brennie | |
'social.exceptions.AuthCanceled' imported but unused |
reviewbot | |
undefined name '_' |
reviewbot | |
undefined name '_' |
reviewbot | |
undefined name '_' |
reviewbot | |
'django.http.HttpResponse' imported but unused |
reviewbot | |
'social.exceptions as social_exceptions' imported but unused |
reviewbot | |
'djblets.configforms.forms.ConfigPageForm' imported but unused |
reviewbot | |
'django.contrib.messages' imported but unused |
reviewbot | |
'django.shortcuts.redirect' imported but unused |
reviewbot | |
'django.shortcuts.HttpResponseRedirect' imported but unused |
reviewbot | |
'django.core.urlresolvers.reverse' imported but unused |
reviewbot | |
'django.conf.urls.include' imported but unused |
reviewbot | |
'django.http.HttpResponseRedirect' imported but unused |
reviewbot | |
'django.utils.translation.ugettext_lazy as _' imported but unused |
reviewbot | |
'django.core.urlresolvers.reverse' imported but unused |
reviewbot | |
'djblets.util.decorators.augment_method_from' imported but unused |
reviewbot | |
'djblets.configforms.views.ConfigPagesView' imported but unused |
reviewbot | |
'reviewboard.admin.decorators.superuser_required' imported but unused |
reviewbot |
- Description:
-
I didn't have permission to modify r/8437/, so I'm posting this as a separate RR. A decent portion of this diff is stuff that Dominic did. Anything involving "github usernames" is stuff I did.
I have added the ability for a user to specify their GitHub username (in the settings page), and when a webhook pull request is incoming, it will attempt to find a user with that GitHub username and submit it under their name, else it submits it under a dummy account.
~ There is a ton of messiness, I know. Didn't attempt to clean it up whatsoever.
~ There is a ton of messiness, I know. Didn't attempt to clean it up whatsoever. Please don't review this yet, I'm just dumping for the status report!
-
-
We should use
social-auth-core
andsocial-auth-app-django
for this. See http://python-social-auth.readthedocs.io/en/latest/. We don't want to limit this too just GitHub. Ideally we would able to link to PRs from GitHub, GitLab, Bitbucket, etc. So a generic notion of a service (likesocial-auth-core
provides) is what we're going to want to do.
- Commit:
-
978f3fc42cf2a4e61feda2a175e59ed6c086d9ee98505b04723e77f10411958a64faa419ce823787
- Diff:
-
Revision 2 (+174 -8)
-
Tool: Pyflakes Processed Files: reviewboard/settings.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/accounts/evolutions/github_username.py reviewboard/urls.py reviewboard/hostingsvcs/github.py reviewboard/accounts/admin.py reviewboard/accounts/models.py Ignored Files: docs/manual/fixtures/initial_data.json Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/accounts/evolutions/github_username.py reviewboard/urls.py reviewboard/hostingsvcs/github.py reviewboard/accounts/admin.py reviewboard/accounts/models.py Ignored Files: docs/manual/fixtures/initial_data.json
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/accounts/urls.py reviewboard/settings.py reviewboard/accounts/views.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/accounts/evolutions/github_username.py reviewboard/urls.py reviewboard/hostingsvcs/github.py reviewboard/accounts/admin.py reviewboard/accounts/models.py Ignored Files: reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/urls.py reviewboard/settings.py reviewboard/accounts/views.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/accounts/evolutions/github_username.py reviewboard/urls.py reviewboard/hostingsvcs/github.py reviewboard/accounts/admin.py reviewboard/accounts/models.py Ignored Files: reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/settings.py reviewboard/accounts/views.py reviewboard/accounts/urls.py reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/urls.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/settings.py reviewboard/accounts/views.py reviewboard/accounts/urls.py reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/urls.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json
-
-
-
-
-
-
-
- Description:
-
I didn't have permission to modify r/8437/, so I'm posting this as a separate RR. A decent portion of this diff is stuff that Dominic did. Anything involving "github usernames" is stuff I did.
~ I have added the ability for a user to specify their GitHub username (in the settings page), and when a webhook pull request is incoming, it will attempt to find a user with that GitHub username and submit it under their name, else it submits it under a dummy account.
~ Users may now authenticate with GitHub, associating their RR account with their GitHub account. When a webhook pull request is incoming, it will attempt to find a user with that GitHub username and submit it under their name, else it submits it under a dummy account.
- - There is a ton of messiness, I know. Didn't attempt to clean it up whatsoever. Please don't review this yet, I'm just dumping for the status report!
- Description:
-
~ I didn't have permission to modify r/8437/, so I'm posting this as a separate RR. A decent portion of this diff is stuff that Dominic did. Anything involving "github usernames" is stuff I did.
~ I didn't have permission to modify r/8437/, so I'm posting this as a separate RR. A decent portion of this diff is stuff that Dominic did. Anything involving social authentication is stuff I did.
~ Users may now authenticate with GitHub, associating their RR account with their GitHub account. When a webhook pull request is incoming, it will attempt to find a user with that GitHub username and submit it under their name, else it submits it under a dummy account.
~ Users may now authenticate with GitHub, associating their RR account with their GitHub account. When a webhook pull request is incoming, it will attempt to find a user with that GitHub username and submit it under their name, else it submits it under a dummy account (No_Submitter).
+ + I have also added the ability to authenticate with a BitBucket account. The data is currently not showing up in the database even though it successfully authenticates.
- Commit:
-
50e112852047b6ecd0e890108f6392019963ae2509d5a5a2fc012b88053e19dbf678ceb086331f8f
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/settings.py reviewboard/accounts/views.py reviewboard/accounts/urls.py reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/urls.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/settings.py reviewboard/accounts/views.py reviewboard/accounts/urls.py reviewboard/accounts/pages.py reviewboard/accounts/forms/pages.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/urls.py reviewboard/hostingsvcs/github.py Ignored Files: reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json
-
-
-
-
-
-
-
-
-
This would go with the django imports asits a 3rd party import.
In general, imports are grouped as such:
from __future__ import unicode_literals import os # Standard library import django # 3rd Party import reviewboard # The current repo.
-
-
-
-
These must be added in load_siteconfig in admin/siteconfig.py line 366 with the web api token backend.
-
-
-
-
-
-
-
- Branch:
-
masterdvcs
- Commit:
-
09d5a5a2fc012b88053e19dbf678ceb086331f8f6ce94eb347765c701017ebdb5fd2455d4085abe8
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/evolutions/__init__.py reviewboard/accounts/views.py reviewboard/accounts/urls.py reviewboard/accounts/pages.py reviewboard/reviews/evolutions/pull_request.py reviewboard/accounts/forms/pages.py reviewboard/diffviewer/diffutils.py reviewboard/reviews/builtin_fields.py reviewboard/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/hostingsvcs/service.py reviewboard/settings.py reviewboard/hostingsvcs/github.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py Ignored Files: reviewboard/templates/base/_nav_support_menu.html reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json reviewboard/templates/accounts/claim_github.html
-
-
-
-
-
-
-
Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/reviews/models/base_comment.py reviewboard/reviews/evolutions/__init__.py reviewboard/accounts/views.py reviewboard/accounts/urls.py reviewboard/accounts/pages.py reviewboard/reviews/evolutions/pull_request.py reviewboard/accounts/forms/pages.py reviewboard/diffviewer/diffutils.py reviewboard/reviews/builtin_fields.py reviewboard/urls.py reviewboard/hostingsvcs/tests/test_github.py reviewboard/hostingsvcs/service.py reviewboard/settings.py reviewboard/hostingsvcs/github.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py Ignored Files: reviewboard/templates/base/_nav_support_menu.html reviewboard/templates/accounts/external_service_auth.html docs/manual/fixtures/initial_data.json reviewboard/templates/accounts/claim_github.html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Commit:
-
6ce94eb347765c701017ebdb5fd2455d4085abe876e0a1a01a0f3dd0e377df7941354b94a01db9dc
Checks run (2 succeeded, 1 failed with error)
-
-
-
If you insert the other auth backends correctly, this wont be necessary. See my comment from a while back.
-
-
-
-
-
-
-
-
-
-
-
-
-
Reformat as:
status_url = self._build_api_url( '%s/statuses/%s % (self._get_repo_api_url(repository), commit) )
-
-
-
types should use
:py:class:`type`
You can just say the response status here instead, e.g.
"A 200 OK is returned if the review request was updated successfully. Otherwise a 400 Bad Request is returned."
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We prefer to format as:
return { 'social': social, 'user': social.user, 'new_association': True, }
No semicolon necessary.
-
- Summary:
-
Create a new Review Request after creating a PR on Github - duplicate [WIP]Create a new Review Request after creating a PR on Github
- Commit:
-
76e0a1a01a0f3dd0e377df7941354b94a01db9dc2288ef1ac25f2cfbcd5b0194e957ace6dc86b97e
- Commit:
-
2288ef1ac25f2cfbcd5b0194e957ace6dc86b97e2214898a7f6d2eba433d0a36b0a56a8f40917c5c