Serialize primary keys in DiffCommits and history entries

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

Information

Review Board
release-4.0.x
d57abd3...

Reviewers

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
Commit:
0a0c09fc7c49aadf11d3a89469b5d1f4c618ec76
8560976f3a0f6d74d84af1fd5b220c45189f8b9b

Checks run (1 failed, 1 succeeded)

flake8 passed.
JSHint failed.

JSHint

brennie
chipx86
  1. 
      
  2. Show all issues

    Unwanted "for" in the summary.

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

    Can you put this in alphabetical order?

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

    Too many blank lines.

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

    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. Show all issues

    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:
Completed
Change Summary:
Pushed to release-4.0.x (fd27c65)