Code added for Tracking User Changes..\n

Review Request #2615 — Created Sept. 24, 2011 and discarded

Information

Review Board

Reviewers

I have added code for tracking user changes. 
Manual testing using the django development server has been done.\n
Description From Last Updated

Typo: "appent" should be "append". Also, it looks like this evolution will only be executed if the DB backend is …

mike_conleymike_conley

"class Meta" should go under all of the field definitions.

daviddavid

I have a feeling that this, and many other places where we might retrieve a draft, will be broken if …

daviddavid

Reading through the code, the user parameter here is used to determine who should be listed in the "From" field …

daviddavid

There's extra whitespace here.

daviddavid

Along with the change above to the method signature, this should be user=self.changedesc.user

daviddavid
david
  1. The major thing that I've noticed on this pass is that things will probably be broken in a lot of cases if multiple users have drafts for the same review request. This will take some testing to fix.
    
    Please also run the unit tests:
    ./reviewboard/manage.py test
  2. reviewboard/reviews/models.py (Diff revision 1)
     
     
     
    "class Meta" should go under all of the field definitions.
  3. reviewboard/reviews/models.py (Diff revision 1)
     
     
     
    I have a feeling that this, and many other places where we might retrieve a draft, will be broken if multiple users have drafts for the same review request.
    
    For this place, I'd suggest making 'user' a non-optional parameter (and updating all the calls to ReviewRequestDraft.create appropriately), and then passing draft_creator=user in to get_or_create here.
    
    You'll also have to update ReviewRequest.get_draft to find the right draft.
  4. reviewboard/reviews/models.py (Diff revision 1)
     
     
    Reading through the code, the user parameter here is used to determine who should be listed in the "From" field of the email. Since we're now storing that information in the draft/changedesc, we no longer need to plumb it through here. You can remove the user parameter and update the call sites.
  5. reviewboard/reviews/models.py (Diff revision 1)
     
     
    There's extra whitespace here.
  6. reviewboard/reviews/models.py (Diff revision 1)
     
     
    Along with the change above to the method signature, this should be user=self.changedesc.user
  7. 
      
mike_conley
  1. Hey Waleed,
    
    Nice job here!  I've found a possible problem with one of your evolutions - notes below.
    
    Thanks,
    
    -Mike
  2. Typo: "appent" should be "append".
    
    Also, it looks like this evolution will only be executed if the DB backend is MySQL.  I can understand why the other evolution does this - likely to patch some database inconsistencies.  But your evolution needs to be applied for all database types.
    
    So I'd take it out of the IF clause.
  3. 
      
DE
DE
DE
DE
mike_conley
  1. Hey Waleed - not sure what's going on here - I see that your review request is being updated, but the diff is staying the same.
    
    -Mike
  2. 
      
DE
Review request changed

Status: Discarded

Loading...