Serialize primary keys in DiffCommits and history entries

Review Request #10128 — Created Aug. 25, 2018 and updated

brennie
Review Board
release-4.0.x
10127
10132
d57abd3...
reviewboard

When doing an interdiff, it is possible that there could be two commits
in the RB.DiffCommitCollection that have the same commitId property.
However, they may have different properties (however unlikely), so we
now serialize commits with their primary keys and use them for lookup in
history entries instead of the commit ID. This was especially prevalent
in test cases where the commit IDs were not actually representative
(i.e., a hash) of the content of the commit.

  • Ran unit tests.
  • Ran JS tests.
  • 0
  • 0
  • 9
  • 0
  • 9
Description From Last Updated
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

brennie
Review request changed
brennie
chipx86
  1. 
      
  2. Unwanted "for" in the summary.

  3. reviewboard/diffviewer/models/diffcommit.py (Diff revision 3)
     
     
     
     
     

    Can you put this in alphabetical order?

  4. reviewboard/diffviewer/models/diffcommit.py (Diff revision 3)
     
     
     
     
     
     

    Too many blank lines.

  5. reviewboard/reviews/templatetags/reviewtags.py (Diff revision 3)
     
     
     
     

    This will easily fit on one line.

    It'll fit on the previous if you do:

    diffset = review_request_details.get_latest_diffset()
    editor_data['commits'] = [
        commit.serialize()
        for commit in diffset.commits.all()
    ]
    
  6. Should be in alphabetical order.

  7. 
      
brennie
chipx86
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
brennie
Review request changed
Loading...