Setting up the bot to handle Git repositories and pass the repository paths to the tools
Review Request #5869 — Created May 23, 2014 and discarded
Sets up repository on ReviewBot load
- stores repositories in root folder
- updates repositories programaticallySupports Git, but easy to extend for new types of repositories
- switch to base commit
- use SCM tool to apply patch to temp repositoryFixed bug in make_tempfile
Delete temporary folders
Added cached_property to ReviewBot
- turned File properties into cached properties
- cached path property on Repository_CloneAdded new Tool base class to support access to entire repository
- sending repository path to tool
- comment on a file by its path
- created example ReviewBot tool to look at entire repository
- added more Queues to Celery so that a bot only picks up a task that it has the repository forAdded flag to extension model to signal if ReviewBot tool supports entire directory
- added UI in admin panel to show this
The following configuration was used in reviewbot/config.py
from reviewbot.revisioning.constants import GIT BOT_REPOSITORY_SETTINGS = { 'http://localhost:8080/': { 'ReviewBot': { 'type': GIT, 'url': 'git://github.com/reviewboard/ReviewBot.git', }, }, }
The following tool was added at the path reviewbot/tools/pep8repo.py
import os from reviewbot.tools import RepositoryTool from reviewbot.tools.process import execute from reviewbot.utils import is_exe_in_path class PEP8RepoTool(RepositoryTool): name = 'PEP8 Style Checker - Entire Repository' version = '0.2' description = "Checks code for style errors using the PEP8 tool." def check_dependencies(self): return is_exe_in_path('pep8') def handle_repository(self, repository_working_directory): path = repository_working_directory.path if not path: return False for root, subFolders, files in os.walk(path): for file_path in files: if not file_path.endswith('.py'): continue full_path = os.path.join(root, file_path) output = execute( [ 'pep8', '-r', full_path ], split_lines=True, ignore_errors=True) for line in output: parsed = line.split(':', 3) lnum = int(parsed[1]) col = int(parsed[2]) msg = parsed[3] repository_working_directory.comment( full_path, 'Col: %s\n%s' % (col, msg), lnum) return True
I used a server running on "http://localhost:8080" to test my changes. The setup process is the same as if you were setting up ReviewBot normally. When refreshing the list of tools, PEP8 Style Checker - Entire Repository should show up with a value of true in the 'working directory required' column. To test I set both it and the normal PEP8 Style Checker to run automatically to compare output.
Tests:
1. On the second startup of the bot, it should take less time than the second to start Celery (if you include the reviewboard repository it is more noticeable). This indicates that the repository is being stored between bot sessions as expected. These repositories should stored in a folder system ~/ReviewBotRepositories/server_url/repo_name/.
2. In the celery startup output, it should be shown that one of the Celery Queues the bot is listening on is: pep8repo.0.2.http://localhost:8080/.ReviewBot exchange=pep8repo.0.2.http://localhost:8080/.ReviewBot(direct) key=pep8repo.0.2.http://localhost:8080/.ReviewBot
3. The reviewboard page /admin/extensions/reviewbotext.extension.ReviewBotExtension/db/reviewbotext/reviewbottool/ should show a column called Working directory required. For the tool 'PEP8 Style Checker - Entire Repository' there should be a green check.
5. In the middle of a review being made (celery.contrib.rdb.set_trace() was used to pause in the middle), there should be a file in /tmp/ that contains the patch to apply to the repository to get the code as it is in the review request.
4. In the middle of a review being made (celery.contrib.rdb.set_trace() was used to pause in the middle), there should be a folder in /tmp/ that contains the ReviewBot repository without the .git folder. The state of the repository should be identical to that of the review request.
5. After a publishing a review, checking the /tmp/ folder of the bot should show there are no temp files or directories.
6. Both the normal PEP8 and the full repository PEP8 should complete without error. The resulting code comments should be identical. Of particular note, there should be no comments on files not changed in the review request.
Description | From | Last Updated |
---|---|---|
Col: 14 E203 whitespace before ':' |
reviewbot | |
Col: 14 E203 whitespace before ':' |
reviewbot | |
local variable 'repo' is assigned to but never used |
reviewbot | |
Col: 15 E203 whitespace before ':' |
reviewbot | |
Col: 14 E203 whitespace before ':' |
reviewbot | |
Col: 15 E203 whitespace before ':' |
reviewbot | |
Col: 14 E203 whitespace before ':' |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
local variable 'repo' is assigned to but never used |
reviewbot | |
'Repo' imported but unused |
reviewbot | |
'NoSuchPathError' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 80 E501 line too long (99 > 79 characters) |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 52 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 54 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 51 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 53 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 71 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 73 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
'ToolRepository' imported but unused |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
Col: 50 E261 at least two spaces before inline comment |
reviewbot | |
Col: 50 E262 inline comment should start with '# ' |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
'RepositoryManager' imported but unused |
reviewbot | |
local variable 'tool_repository' is assigned to but never used |
reviewbot | |
Col: 22 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 24 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 29 E203 whitespace before ':' |
reviewbot | |
local variable 'tool_repository' is assigned to but never used |
reviewbot | |
You'll want to put a blank line before from reviewboar.revisioning.repository_manager import RepositoryManger. The why we style our imports is as … |
SM smacleod | |
Leave this blank line in, we want 2 blanks here. |
SM smacleod | |
So as I mentioned in the hackpad we want to namespace the configuration down one more level to include the … |
SM smacleod | |
Is there a reason you chose to use abstract base classes for this? If not, I think we should just … |
SM smacleod | |
The docstring should be before any code in the method. |
SM smacleod | |
What is _path here suppose to represent, and why does it just return self.name? What am I missing? |
SM smacleod | |
So a couple of things with this: @classmethod methods should generally use "cls" as the first argument, not "self". What … |
SM smacleod | |
Instead of doing these checks from constants and then using a particular class, we should just create a dictionary mapping … |
SM smacleod | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
In order to intiialize the tool repository we'll need: * The name of the repository * The Review Board server … |
SM smacleod | |
local variable 'tool_repository' is assigned to but never used |
reviewbot | |
Lets call this working_dir_required |
SM smacleod | |
'RepositoryManager' imported but unused |
reviewbot | |
undefined name 'shutil' |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
local variable 'e' is assigned to but never used |
reviewbot | |
undefined name 'logging' |
reviewbot | |
Col: 25 E128 continuation line under-indented for visual indent |
reviewbot | |
'rdb' imported but unused |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
undefined name 'self' |
reviewbot | |
Col: 29 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
undefined name 'path' |
reviewbot | |
undefined name 'payload' |
reviewbot | |
undefined name 'logger' |
reviewbot | |
undefined name 'repository_manager' |
reviewbot | |
undefined name 'payload' |
reviewbot | |
undefined name 'RepositoryClone' |
reviewbot | |
undefined name 'logger' |
reviewbot | |
undefined name 'repository_clone' |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
'RepositoryClone' imported but unused |
reviewbot | |
Col: 19 E262 inline comment should start with '# ' |
reviewbot | |
'GIT' imported but unused |
reviewbot | |
Maybe I should include this in the comments rather than in the actual code. I really want whoever writes the … |
MA matthewcmaclean | |
Can you remove the extra space and add a period at the end of the sentence? |
anselina | |
Capitalize the first word + period (for consistency?) |
PE PeterTran | |
s/supoort/support |
anselina | |
s/an/An |
anselina | |
Can you capitalize URL? Here and in all your other comments/docstrings. |
anselina | |
Remove the apostrophe on "name's". |
anselina | |
We generally add full-package imports before single-item imports, so this should go after import tempfile. |
anselina | |
Remove the extra space before and after the sentence, and add a period. |
anselina | |
Can you add a blank line after this? We generally have one blank line before and after if/for/while blocks. |
anselina | |
Can you add a blank line before this, while you're here? |
anselina | |
Add a blank line before this. |
anselina | |
Remove the extra space before the sentence. |
anselina | |
Remove the extra space before and after the sentence. |
anselina | |
Remove the extra space before and after the sentence. Here and in all other docstrings below. |
anselina | |
Remove the extra space before the sentence, and add a period. |
anselina | |
This should come directly after from git.exc import NoSuchPathError (since RBTools would be considered as a third-party library import for … |
anselina | |
This should be: from os import chdir, get cwd from re import sub from django.utils.functional import cached_property from rbtools.commands.patch import … |
anselina | |
We generally use single quotes for strings. (Here and in other places.) |
anselina | |
Can you change this to: logging.warning( 'server: %s, repository %s: type%s is not supported' % (server_url, repo_name, repo_settings['type'])) |
anselina | |
You will need a space after been. Otherwise when the Exception is raised it'll be concatenated like: Respository _ in … |
PE PeterTran | |
Can you make this into a single-line docstring, like """Returns the server URL and names of repositories the bot supports."""? |
anselina | |
s/seperately/separately |
anselina | |
Should this class be uppercase? |
PE PeterTran | |
Can you remove the extra space before the sentence, and add a period? |
anselina | |
Add a blank line after this. |
anselina | |
Since you removed your pep8repo tool used for testing, this line should also be deleted. |
anselina | |
If there are multiple tools with working_directory_required == True, this will initialize the RepositoryManager multiple times. Each queue would be … |
anselina | |
If the patch doesn't apply cleanly or raises an error, we probably shouldn't proceed with the review. execute() has some … |
anselina | |
Can we call this RepositoryWorkingDirectory instead (or something to that effect), and change the docstring to "Represents a working directory … |
anselina | |
Can we put this in a function like initialize_repository_manager(), and just add a call to this in celery.py if a … |
anselina | |
Can you indent this an extra level? |
anselina | |
"static" should be removed since we can now do more than just static analysis with the full working directory. |
anselina | |
Indent this an extra level. |
anselina | |
Actually, sorry, instead of calling initialize_repositories() here, how about we call it in supported_repositories()? |
anselina | |
Globals are usually capitalized, so can you make this be REPOSITORIES? |
anselina | |
Let's set REPOSITORIES = None in line 12, and set REPOSITORIES = {} here. This way, we can just do … |
anselina |
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/config.py Ignored Files:
-
Description: |
|
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||
Diff: |
Revision 2 (+109 -2) |
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
-
-
-
-
-
bot/reviewbot/revisioning/base_repository.py (Diff revision 2) Col: 1 E302 expected 2 blank lines, found 1
-
bot/reviewbot/revisioning/git_repository.py (Diff revision 2) Col: 1 E302 expected 2 blank lines, found 1
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 2) Col: 1 E302 expected 2 blank lines, found 1
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 2) Col: 80 E501 line too long (99 > 79 characters)
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 1 E302 expected 2 blank lines, found 1
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 52 E251 unexpected spaces around keyword / parameter equals
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 54 E251 unexpected spaces around keyword / parameter equals
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 51 E251 unexpected spaces around keyword / parameter equals
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 53 E251 unexpected spaces around keyword / parameter equals
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 71 E251 unexpected spaces around keyword / parameter equals
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 73 E251 unexpected spaces around keyword / parameter equals
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 80 E501 line too long (83 > 79 characters)
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 2) Col: 1 W391 blank line at end of file
-
-
-
-
-
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
-
bot/reviewbot/revisioning/git_repository.py (Diff revision 2) local variable 'repo' is assigned to but never used
-
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 2) 'NoSuchPathError' imported but unused
-
Change Summary:
Fixed style issues
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+117 -2) |
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
-
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
Description: |
|
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||
Diff: |
Revision 4 (+120 -1) |
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
-
bot/reviewbot/tasks.py (Diff revision 4) Col: 22 E251 unexpected spaces around keyword / parameter equals
-
bot/reviewbot/tasks.py (Diff revision 4) Col: 24 E251 unexpected spaces around keyword / parameter equals
-
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 4) 'RepositoryManager' imported but unused
-
bot/reviewbot/tasks.py (Diff revision 4) local variable 'tool_repository' is assigned to but never used
Change Summary:
Fixing reviewbot issues
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+117 -1) |
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files:
-
bot/reviewbot/tasks.py (Diff revision 5) local variable 'tool_repository' is assigned to but never used
Change Summary:
Added base repository commit and repository name to payload
Description: |
|
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||||||||||||||
Diff: |
Revision 6 (+137 -25) |
-
Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files: bot/reviewbot/revisioning/.repository_manager.py.swp extension/reviewbotext/.handlers.py.swp bot/reviewbot/.config.py.swp Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py Ignored Files: bot/reviewbot/revisioning/.repository_manager.py.swp extension/reviewbotext/.handlers.py.swp bot/reviewbot/.config.py.swp
-
bot/reviewbot/revisioning/tool_repository.py (Diff revision 6) Col: 1 E302 expected 2 blank lines, found 1
-
bot/reviewbot/tasks.py (Diff revision 6) local variable 'tool_repository' is assigned to but never used
-
I think we're moving in the right directions here. I've done a quick pass and noted some of the style issues I caught, as well as some of the bigger conventional, architectural, or preferential issues.
Also, it looks like a bunch of binary swap files snuck into your diff. Please remove these from your commits in future revisions.
-
bot/reviewbot/celery.py (Diff revision 6) You'll want to put a blank line before
from reviewboar.revisioning.repository_manager import RepositoryManger
.The why we style our imports is as follows:
<Python Standard Library Imports>
<Blank Line>
<Third Party Library Imports>
<Blank Line>
<Package Imports>Where third party library imports are things from outside the project (anything not from "reviewbot")
-
-
bot/reviewbot/config.py (Diff revision 6) So as I mentioned in the hackpad we want to namespace the configuration down one more level to include the Review Board server url.
So in this case we'd have:
repo_settings = {
"http://localhost:8080/": {
"RBTools": {
"type": GIT,
"url": "git://github.com/reviewboard/rbtools.git",
},
"Review Board": {
"type": GIT,
"url": "git://github.com/reviewboard/reviewboard.git",
},
},
} -
bot/reviewbot/revisioning/base_repository.py (Diff revision 6) Is there a reason you chose to use abstract base classes for this?
If not, I think we should just use the normal inheritance. Just defining a set of methods in the base class which make up the interace and then defining them in each class should be fine.
-
bot/reviewbot/revisioning/base_repository.py (Diff revision 6) The docstring should be before any code in the method.
-
bot/reviewbot/revisioning/base_repository.py (Diff revision 6) What is
_path
here suppose to represent, and why does it just returnself.name
? What am I missing? -
bot/reviewbot/revisioning/repository_manager.py (Diff revision 6) So a couple of things with this:
@classmethod
methods should generally use "cls" as the first argument, not "self". What is actually passed will be the class not an object so this makes that clearer.Using this sort of singleton class as an object is less testable than just actually using an object or sets of functions - and we usually don't do it this way around the rest of the code. (I know, Review Bot doesn't have test... but I hope it does one day).
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 6) Instead of doing these checks from constants and then using a particular class, we should just create a dictionary mapping repositories type string to the classes. That will allow a quick lookup and instantiation of the proper class.
All of these repo types should inherit from the same class and have the same interface going forward. So while there is only git right now, keep that in mind.
-
bot/reviewbot/tasks.py (Diff revision 6) In order to intiialize the tool repository we'll need: * The name of the repository * The Review Board server URL,
I think we should keep the commit information out of it at the initialization step, and move that into a method you call on the ToolRepository object - "getWorkingdirectoryForCommit()" or something.
-
Change Summary:
Create temporary folder with base commit folder.
Description: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||||||||||||||
Diff: |
Revision 7 (+211 -25) |
-
Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/reviewbot/processing/filesystem.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py
-
bot/reviewbot/processing/filesystem.py (Diff revision 7) Col: 1 E302 expected 2 blank lines, found 1
-
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 7) Col: 25 E128 continuation line under-indented for visual indent
-
Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/base_repository.py bot/reviewbot/processing/filesystem.py bot/setup.py bot/reviewbot/revisioning/tool_repository.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py
-
-
-
bot/reviewbot/revisioning/base_repository.py (Diff revision 7) local variable 'e' is assigned to but never used
-
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 8 (+282 -25) |
-
Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/revisioning/constants.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
-
bot/reviewbot/revisioning/repository_client.py (Diff revision 8) Col: 9 E265 block comment should start with '# '
-
bot/reviewbot/revisioning/repository_clone.py (Diff revision 8) Col: 80 E501 line too long (85 > 79 characters)
-
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 8) Col: 29 E126 continuation line over-indented for hanging indent
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 8) Col: 17 E128 continuation line under-indented for visual indent
Change Summary:
Finished adding the ability to apply a patch to a directory and have moved where the RepositoryClone object is accessible from.
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Branch: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
Commit: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 9 (+353 -61) |
-
Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
bot/reviewbot/revisioning/repository_client.py (Diff revision 9) Col: 80 E501 line too long (85 > 79 characters)
-
bot/reviewbot/revisioning/repository_client.py (Diff revision 9) Col: 80 E501 line too long (83 > 79 characters)
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 9) Col: 21 E128 continuation line under-indented for visual indent
-
bot/reviewbot/tools/__init__.py (Diff revision 9) Col: 19 E262 inline comment should start with '# '
-
Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
-
-
-
-
-
-
-
-
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Branch: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commit: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 10 (+520 -55) |
-
Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
Change Summary:
Re-added GitPython into setup.py. It must have gotten lost in a rebase.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 11 (+520 -55) |
-
Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 12 (+521 -55) |
-
Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
Change Summary:
Added all the tests I check. I also added more queues to Celery so that a bot only takes on tasks for repositories it can handle.
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Testing Done: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commit: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 13 (+470 -62) |
-
Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
-
-
bot/reviewbot/config.py (Diff revision 13) Maybe I should include this in the comments rather than in the actual code. I really want whoever writes the config to use those constants, hence the inclusion here.
Change Summary:
Fixed bracket issues in the config.py and moved the import into the comments as it isn't actually used.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 14 (+471 -62) |
-
Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
-
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 14) You will need a space after been. Otherwise when the Exception is raised it'll be concatenated like:
Respository _ in server __ has not beeninitialized in ...
-
-
Thanks for the detailed description! This is mostly a style review since I haven't been following your project closely. I'll try to follow up with another review of the logic though, after I read your Hackpad.
-
bot/reviewbot/celery.py (Diff revision 14) Can you remove the extra space and add a period at the end of the sentence?
-
-
-
bot/reviewbot/config.py (Diff revision 14) Can you capitalize URL? Here and in all your other comments/docstrings.
-
-
bot/reviewbot/processing/filesystem.py (Diff revision 14) We generally add full-package imports before single-item imports, so this should go after
import tempfile
. -
bot/reviewbot/processing/filesystem.py (Diff revision 14) Remove the extra space before and after the sentence, and add a period.
-
bot/reviewbot/processing/filesystem.py (Diff revision 14) Can you add a blank line after this? We generally have one blank line before and after if/for/while blocks.
-
bot/reviewbot/processing/filesystem.py (Diff revision 14) Can you add a blank line before this, while you're here?
-
-
bot/reviewbot/processing/filesystem.py (Diff revision 14) Remove the extra space before the sentence.
-
bot/reviewbot/processing/filesystem.py (Diff revision 14) Remove the extra space before and after the sentence.
-
bot/reviewbot/processing/review.py (Diff revision 14) Remove the extra space before and after the sentence. Here and in all other docstrings below.
-
bot/reviewbot/processing/review.py (Diff revision 14) Remove the extra space before the sentence, and add a period.
-
bot/reviewbot/revisioning/git_repository_client.py (Diff revision 14) This should come directly after
from git.exc import NoSuchPathError
(since RBTools would be considered as a third-party library import for Review Bot). -
bot/reviewbot/revisioning/repository_client.py (Diff revision 14) This should be:
from os import chdir, get cwd from re import sub from django.utils.functional import cached_property from rbtools.commands.patch import Patch from reviewbot.processing.filesystem import make_tempfile
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 14) We generally use single quotes for strings. (Here and in other places.)
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 14) Can you change this to:
logging.warning( 'server: %s, repository %s: type%s is not supported' % (server_url, repo_name, repo_settings['type']))
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 14) Can you make this into a single-line docstring, like """Returns the server URL and names of repositories the bot supports."""?
-
-
bot/reviewbot/utils.py (Diff revision 14) Can you remove the extra space before the sentence, and add a period?
-
-
bot/setup.py (Diff revision 14) Since you removed your pep8repo tool used for testing, this line should also be deleted.
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 15 (+518 -62) |
-
Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/tools/pep8repo.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
Change Summary:
Removed pep8repo.py which I by mistake added back in.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 16 (+471 -62) |
-
Tool: Pyflakes Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
Tool: PEP8 Style Checker Processed Files: bot/setup.py bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/reviewbot/revisioning/repository_clone.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
This looks great! You may not have time for this, but I think it'd be good to also grab the branch information off the review request, and actually checkout that branch before switching to the base commit and applying the patch.
-
bot/reviewbot/celery.py (Diff revision 16) If there are multiple tools with working_directory_required == True, this will initialize the RepositoryManager multiple times. Each queue would be added several times extra too.
Also, I'm just curious if there is a reason for having separate queues for each repository (instead of a single pep8repo tool queue, for example)?
-
bot/reviewbot/revisioning/git_repository_client.py (Diff revision 16) If the patch doesn't apply cleanly or raises an error, we probably shouldn't proceed with the review. execute() has some parameters dealing with errors.
-
bot/reviewbot/revisioning/repository_clone.py (Diff revision 16) Can we call this RepositoryWorkingDirectory instead (or something to that effect), and change the docstring to "Represents a working directory of a specified repository."? It's easy to mistake this to be an actual clone of the repo.
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 16) Can we put this in a function like initialize_repository_manager(), and just add a call to this in celery.py if a working directory is required for one of the tools? This will make it more testable for the future.
-
-
bot/reviewbot/tools/__init__.py (Diff revision 16) "static" should be removed since we can now do more than just static analysis with the full working directory.
-
Change Summary:
Updated code as per the review. Not all the issues have been resolved as I have further questions on the implementation.
Testing Done: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 17 (+485 -62) |
-
Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_working_dir.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/setup.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/repository_working_dir.py bot/reviewbot/revisioning/repository_manager.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/setup.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
-
bot/reviewbot/celery.py (Diff revision 17) Actually, sorry, instead of calling initialize_repositories() here, how about we call it in supported_repositories()?
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 17) Globals are usually capitalized, so can you make this be REPOSITORIES?
-
bot/reviewbot/revisioning/repository_manager.py (Diff revision 17) Let's set
REPOSITORIES = None
in line 12, and setREPOSITORIES = {}
here.This way, we can just do
if REPOSITORIES is None
to check if the RepositoryClients have been instantiated/initialized, so we don't need theinitialized
boolean anymore.Let's actually also move this logic to supported_repositories(), so it'll look like:
def supported_repositories(): global REPOSITORIES if REPOSITORIES is None: initialize_repositories() return REPOSITORIES.keys()
Testing Done: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 18 (+492 -62) |
-
Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/constants.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/setup.py bot/reviewbot/revisioning/repository_working_dir.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py
-
Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py bot/reviewbot/revisioning/git_repository_client.py bot/reviewbot/tools/__init__.py bot/reviewbot/revisioning/constants.py bot/reviewbot/processing/filesystem.py extension/reviewbotext/admin.py bot/setup.py bot/reviewbot/revisioning/repository_working_dir.py bot/reviewbot/celery.py extension/reviewbotext/handlers.py extension/reviewbotext/resources.py extension/reviewbotext/extension.py bot/reviewbot/utils.py extension/reviewbotext/models.py bot/reviewbot/revisioning/__init__.py bot/reviewbot/processing/review.py bot/reviewbot/config.py bot/reviewbot/revisioning/repository_client.py