Serialize primary keys in DiffCommits and history entries

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

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.
Description From Last Updated

Col: 30 Expected '{' and instead saw 'debugger'.

reviewbotreviewbot

Col: 30 Forgotten 'debugger' statement?

reviewbotreviewbot

Col: 30 Expected '{' and instead saw 'debugger'.

reviewbotreviewbot

Col: 30 Forgotten 'debugger' statement?

reviewbotreviewbot

Unwanted "for" in the summary.

chipx86chipx86

Can you put this in alphabetical order?

chipx86chipx86

Too many blank lines.

chipx86chipx86

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'] = …

chipx86chipx86

Should be in alphabetical order.

chipx86chipx86
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
david
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (fd27c65)
Loading...