Fix change numbers and commit IDs not appearing on review requests.

Review Request #8609 — Created Jan. 11, 2017 and submitted

Information

Review Board
release-2.5.x
7463d2d...

Reviewers

We had a regression a few releases ago where change numbers/commit IDs
were being stored solely on a draft and not on a review request,
preventing those change numbers/commit IDs from being returned in
conflict error responses or matching properly when posting a change for
review.

This was largely a problem with Perforce. The workflow for Perforce is
to use RBTools to post a change number. If that change number is already
posted, the review request matching it is returned, and RBTools then
extracts the change number for use in subsequent requests. However, this
was no longer being set on the review request, so it was coming back as
a null value.

We now always set this on the review request itself, updating both the
commit ID and the change number. This happens on the initial save,
before we even try to update the draft based on that commit ID/change
number. This value is still cleared as expected when discarding the
review request.

Tested manually and verified that posting a change for review using
an existing change number now updates the correct review request again.
Verified it was broken before.

Tested manually that Perforce changes show "pending" when the change is
pending, and don't when it's not, fixing bug #4484.

Unit tests pass.

Description From Last Updated

Use <URL> and the @webapi_test_template decorator??

brenniebrennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/tests/test_review_request_manager.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/reviews/managers.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/tests/test_review_request_manager.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/reviews/managers.py
    
    
  2. 
      
brennie
  1. 
      
  2. Show all issues

    Use <URL> and the @webapi_test_template decorator??

  3. 
      
david
  1. Bug 4484?

  2. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/tests/test_review_request_manager.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/reviews/managers.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/tests/test_review_request_manager.py
        reviewboard/webapi/tests/test_review_request.py
        reviewboard/reviews/managers.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
david
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.5.x (5db07e1)