Fill-database
Review Request #2104 — Created Feb. 6, 2011 and submitted
Here is the fully functioning fill-database script. Command and arguments take the form of: ./reviewboard/manage.py fill-database --users=N1 --review-requests=N2:N3 --diffs=N4:N5 --reviews=N6:N7 --diff-comments=N8:N9 Added: a password can now be set for all users created using --password=TEXT fill-database --users=10 --password=custom1 For instance: ./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1 --reviews=1 --diff-comments=1 or ./reviewboard/manage.py fill-database --users=1 --review-requests=1:10 --diffs=1:5 --reviews=1:5 --diff-comments=1:5
Testing for fill-database March 20, 2011 tests added: Tested missing diff directory, missing diff files, & missing repo directory Tested causing error cases where try/except clauses were changed March 13, 2011 Tests added: Tested running exceptions, where path files could not be found Tested adding the password parameter (--password=test5) Tested adding random lorem ipsum wording to summary & description In the cases below where the database is empty a superuser has been created Test adding only one user on empty database ./reviewboard/manage.py fill-database --users=1 Test adding many users on an empty database ./reviewboard/manage.py fill-database --users=100 ./reviewboard/manage.py fill-database --users=1000 Test adding large num of users ./reviewboard/manage.py fill-database --users=10000 Test adding users and arguments other than review-request (shouldn't add anything but users) ./reviewboard/manage.py fill-database --users=5 --diffs=1 ./reviewboard/manage.py fill-database --users=5 --reviews=1 ./reviewboard/manage.py fill-database --users=5 --diffs=1 --reviews=1 ./reviewboard/manage.py fill-database --users=5 --diff-comments=1 ./reviewboard/manage.py fill-database --users=5 --diffs=1 --reviews=1 --diff-comments=1 Test adding users and review-requests to emtpy database ./reviewboard/manage.py fill-database --users=1 --review-requests=1 ./reviewboard/manage.py fill-database --users=1 --review-requests=1:10 ./reviewboard/manage.py fill-database --users=100 --review-requests=1:10 Test adding arguments other than diffs (shouldn't add anything but users & review-requests) ./reviewboard/manage.py fill-database --users=1 --review-requests=1 --reviews=100 ./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diff-comments=100 ./reviewboard/manage.py fill-database --users=1 --review-requests=1 --reviews=100 --diff-comments=100 Test adding users, review-requests, and diffs to empty database ./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1 ./reviewboard/manage.py fill-database --users=100 --review-requests=1:10 --diffs=0:10 Test adding users, requests, diffs, and arguments other than reviews (shouldn't add anything but users, requests & diffs) ./reviewboard/manage.py fill-database --users=5 --review-requests=1:5 --diffs=1:10 --diff-comments=10 Test adding users, requests, diffs, and reviews to empty database ./reviewboard/manage.py fill-database --users=1 --review-requests=1:5 --diffs=1 --reviews=1 ./reviewboard/manage.py fill-database --users=100 --review-requests=0:5 --diffs=0:5 --reviews=0:5 Test adding users, requests, diffs, reviews, and comments to empty database ./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1 --reviews=1 --diff-comments=1 Test adding additional information to existing database ./reviewboard/manage.py fill-database --users=5 --review-requests=1:5 --diffs=1:5 --reviews=1:10 --diff-comments=1:10 Test adding lots of information ./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1 --reviews=100 --diff-comments=1 ./reviewboard/manage.py fill-database --users=5 --review-requests=5 --diffs=10 --reviews=100 --diff-comments=1 ./reviewboard/manage.py fill-database --users=100 --review-requests=10 --diffs=10 --reviews=10 --diff-comments=10 [unfortunately while this last test does work, I ran it for 24hour without it completing the task entirely] Test some params at 0, shouldn't execute following parameters ./reviewboard/manage.py fill-database --users=5 --review-requests=0 --diffs=1:5 --reviews=1:5 --diff-comments=1:5 ./reviewboard/manage.py fill-database --users=5 --review-requests=2 --diffs=0 --reviews=1:5 --diff-comments=1:5 ./reviewboard/manage.py fill-database --users=5 --review-requests=2 --diffs=2 --reviews=0 --diff-comments=1:5 ./reviewboard/manage.py fill-database --users=5 --review-requests=2 --diffs=2 --reviews=2 --diff-comments=0 Additional quantity-based tests: ./reviewboard/manage.py fill-database --users=5 --review-requests=1:5 --diffs=1:10 --reviews=1:10 --diff-comments=1:10 ./reviewboard/manage.py fill-database --users=100 --review-requests=100 ./reviewboard/manage.py fill-database --users=100 --review-requests=50 --diffs=20 ./reviewboard/manage.py fill-database --users=100 --review-requests=30 --diffs=10 ./reviewboard/manage.py fill-database --users=100 --review-requests=20 --diffs=5 --reviews=50 ./reviewboard/manage.py fill-database --users=100 --review-requests=20 --diffs=5 --reviews=20 ./reviewboard/manage.py fill-database --users=100 --review-requests=20 --diffs=5 --reviews=10 ./reviewboard/manage.py fill-database --users=100 --review-requests=10 --diffs=5 --reviews=10 --diff-comments=10
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Branch: |
|
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 3) According to PEP-8 (the python style guide), imports should be separated into three groups, with a blank line in between each of those groups. Standard library (os, random, optparse) Other 3rd party modules (django) Package imports (reviewboard) Within each of these three sections, please alphabetize the import lines.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 3) The help text here is a little repetitive. I'd get rid of "Specifies the" from each, and provide examples of what the input should look like, especially for the range items. I think these would be more helpful: "The number of users to add" "The number of review requests per user [min:max]" "The number of diffs per user [min:max]" I also think that "diffs" should be per review request, and "diff-comments" should be per diff. Also your last help text (for diff-comments) is incorrect.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 3) It might be nice to let people either specify a single number or a range (you can parse that fairly easily). These might also be nicer to store as tuples instead of separate variables for min and max.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 3) I know that a lot of this kind of output is probably temporary and for debug purposes, but chances are pretty good that the user knows what they entered. The output should inform about the progress and communicate how long the user has to wait before long-running operations are done.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 3) This can be much shorter: return (int(item.strip()) for item in com_string.split(':')) Also note that we wrap lines to 80 characters.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 3) Since this is an error message, please print it to stderr. print >> sys.stderr, "..." Also wrap to 80 characters.
Change Summary:
Made the corrections that David has spelled out below. In this iteration the diffs are able to be uploaded from a specified directory.
Diff: |
Revision 4 (+221) |
---|
Change Summary:
Here is the first completely working version of fill-database
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 5 (+288) |
Change Summary:
Updated title & test cases
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
-
Steve: Good work on this. There are a few minor style things - a sweep with the pep8 script (http://pypi.python.org/pypi/pep8) will help you nail them all. Some other concerns: 1) Shouldn't we create the reviews/management/diffs folder, instead of asking users to create it on their own? 2) Shouldn't we include some .diff files, instead of asking users to create them on their own? 3) According to the Django documentation, @transaction.commit_on_success only rolls back if we throw an exception. In some cases, you're exiting on a failure, which means that the database commits the transaction at that point - even though we've failed. This can leave the database in a tricky state (I got this error after not having any .diff files, and it wouldn't go away until I reverted by DB manually: http://www.pastie.org/1667934). Better to throw exceptions, and rollback the DB on failure. So those are my comments. Thanks for your work, -Mike
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Space between "#" and "Generate"
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Why is manage.py here? I think you can just have "/../scmtools/testdata/git_repo" and get the same effect.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Similarly, I don't think manage.py is required here.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Hold up - so we need to add a new folder called "diffs" under "reviews/management/commands/diffs"? That should probably be part of this review request too, then. Git generally ignores empty folders, but you can get it to pay attention by putting an empty .gitignore in it.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) At least two spaces before inline comment, and a space between "#" and "add"
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Hm...and we need .diff files too? Should we generate these ourselves, and include them?
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Since you're using @transaction.commit_on_success, you'll probably want to throw exceptions to ensure that the db gets rolled back.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Space on either side of +
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Two spaces before inline comment, and space between "#" and "avoids"
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Or should this be a fill-database optional parameter?
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Space on either side of "=" operator. There are a bunch of these, but I'll just mention it this one time.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) I think these should be different for each review request - it'll give a better sense of variety when looking at the dashboard, instead of seeing the same summary/descriptions all over the place. Maybe some Lorem Ipsum would be appropriate here.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) I think these comments are OK to be in lowercase. ;)
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) So you just want the most recent one? file_diff = cur_diff.files.order_by('timestamp')[0] oughta do the trick, unless I misunderstand what you're trying to do. Also, two spaces before inline comment, space after "#".
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Space after #, lowercase the comment.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Hm. We should guarantee that the diffs we provide (if we're providing diffs) have more than 220 lines. Or, like you say, we need to detect that per diff. Hrm. Is there no diffviewer util for this?
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) space after , and space on either side of -
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Hm. NameError is for when a local or global variable is not defined. Both output and req_val *should* be defined here...not sure why you need to catch this one, nor pass it silently.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Maybe provide an example here - like "Example: --review-requests=2:5"
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) Again, we'll want to throw an exception in order to rollback the db.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) More concise / neater option: return ''.join(random.choice(string.ascii_lowercase) for x in range(5, 8))
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 5) I'd prefer failing early, like: if not value: return 0 if len(value) == 1: return value[0] return random.randrange(value[0], value[1])
Change Summary:
Fixed issues and added suggestions listed by Mike in previous review
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 6 (+26220 -1) |
Change Summary:
Updated description to include password changes
Description: |
|
---|
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) You can import both of these at once.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) forms, and then models (alphabetical order on the module level)
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) You probably should do: def handle_noargs(self, users=None, review_requests=None, ....., **options):
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Most management commands will take a verbosity parameter. That should probably be used. That way things can be done from scripts.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Parameters should be aligned.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Use os.path.join: repo_dir = os.path.join(os.path.abspath(sys.argv[0]), "..", "scmtools", "testdata", "git_repo") This ensures it works across platforms.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) This is an odd way to do it. I don't really think oyu need to throw an exception and then catch it immediately. Just do the if statement and then print the error.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) This should actually be: raise CommandError('...') No trailing \n. Also, that lets you get rid of the exit() below. It means that other commands can wrap this and not terminate early.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Probably should combine to one statement.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Comments should be in sentence casing with trailing periods.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Same thing about os.path.join
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Same about comments. Here and everywhere else.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Shouldn't need to? Especially if using os.path.join.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) This can be simplified as: files = [f for f in os.listdir(diff_dir) if f.endswith('.diff')]
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Same comments about comment styles.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Same as above. Just going to assume you'll fix these for the others below.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) One per line. We should have different names so we can distinguish when looking at pages.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Should use @example.com, since @email.com might be legit (and @example.com is allowed by some RFC)
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Rather than this, we should always use set_password. The SHA1 isn't good enough, because it depends on the SECRET_KEY.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) You should be able to leave these out.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Should use print, and one per actual line. Also, instead of casting to strings and concatenating, use Python format strings.
-
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Params should align. I think None can fit on the same line though?
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) User.objects.get(pk=1) Actually, we're doing this in a loop, so let's only fetch this one time throughout the whole lifetime of this program. It'll speed things up a bit.
-
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Same comments about format strings and printing.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) 'filename' is usually a string. Use 'f'
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Should be able to fit on a line./
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Same as above. I'm going to assume you'll go through and take care of the rest.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Can these params not fit after .create( ?
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Should do this as infrequently as possible.
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Kind of icky. Do we really need to do that so often? The inner loop isn't good enough?
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Should use print for each logical line. That'd be a total of two. Also, format strings.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Descriptions of functions should be in python docstring format: def parseCommand(...) """One line summary""" or: """One line summary Optional description. """
-
-
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) I don't like magic numbers. These should be constants near the top of the file.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) We're going to create this every single time this is called, which will be slow. Define it as a constant at the top of the file.
-
reviewboard/reviews/management/commands/fill-database.py (Diff revision 6) Params should be aligned.
Change Summary:
Fixed corrections noted by Christian
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 7 (+26231 -12) |
-
Make sure master is merged in and references were fetched from origin. I'm seeing stray changes in here. Also, best to keep this just "Fill-database script" or something in the summary. Things shouldn't have a version number until they're officially in, and changing the summary breaks the threading in my e-mail client :) Once this is updated with master, I'll do another review.
Change Summary:
re-rebased with master
Summary: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 8 (+26246 -15) |
Change Summary:
At last, a version that is up-to-date with the lastest version of reviewboard as of March 21, 2011: 9:46pm (PST)
Change Summary:
Forgot to do a search for trailing whitespace. Now updated with no trailing whitespace.
Diff: |
Revision 10 (+26214 -1)
|
---|