Add API for working with drafts of diffs.

Review Request #4645 — Created Sept. 24, 2013 and submitted

chipx86
Review Board
master
reviewboard

Add API for working with drafts of diffs.

There was no way, through the API, to get an existing diff uploaded as a
draft. One could be created by issuing a POST, and the payload would be
returned, but the links to the resource in that payload would result in
a 404 due to the diffs resource not showing draft diffs.

This fixes this by introducing a new
/api/review-requests/<id>/draft/diffs/... tree that mirrors the public
/api/review-requests/<id>/diffs/... tree. Diffs that are part of a draft
will link there. The client can inspect this to see everything that will
be published.

Unit tests pass.

Tested uploading a diff against the local server and saw that resulting
payload was correct and linked to the correct place.

Description From Last Updated

'DOES_NOT_EXIST' imported but unused

reviewbotreviewbot

'TestTool' imported but unused

reviewbotreviewbot

local variable 'diffset' is assigned to but never used

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

'os' imported but unused

reviewbotreviewbot

'INVALID_FORM_DATA' imported but unused

reviewbotreviewbot

'scmtools' imported but unused

reviewbotreviewbot

'DiffSet' imported but unused

reviewbotreviewbot

'TestTool' imported but unused

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

local variable 'filediff' is assigned to but never used

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

redefinition of unused 'test_get' from line 121

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot

local variable 'rsp' is assigned to but never used

reviewbotreviewbot
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/testing/testcase.py
    reviewboard/webapi/resources/draft_diff.py
    reviewboard/webapi/tests/urls.py
    reviewboard/webapi/resources/init.py
    reviewboard/webapi/tests/test_draft_diff.py
    reviewboard/webapi/resources/diff.py
    reviewboard/reviews/models.py
    reviewboard/webapi/resources/review_request_draft.py
    reviewboard/webapi/tests/test_draft_filediff.py
    reviewboard/webapi/resources/original_file.py
    reviewboard/webapi/resources/patched_file.py
    reviewboard/webapi/tests/mimetypes.py
    reviewboard/webapi/resources/draft_filediff.py
    reviewboard/webapi/tests/base.py
    Ignored Files:
    docs/manual/webapi/2.0/resources/draft-file-diff-list.txt
    docs/manual/webapi/2.0/resources/index.txt
    docs/manual/webapi/2.0/resources/draft-diff-list.txt
    docs/manual/webapi/2.0/resources/draft-diff.txt
    docs/manual/webapi/2.0/resources/draft-file-diff.txt
    docs/manual/fixtures/initial_data.json

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/testing/testcase.py
    reviewboard/webapi/resources/draft_diff.py
    reviewboard/webapi/tests/urls.py
    reviewboard/webapi/resources/init.py
    reviewboard/webapi/tests/test_draft_diff.py
    reviewboard/webapi/resources/diff.py
    reviewboard/reviews/models.py
    reviewboard/webapi/resources/review_request_draft.py
    reviewboard/webapi/tests/test_draft_filediff.py
    reviewboard/webapi/resources/original_file.py
    reviewboard/webapi/resources/patched_file.py
    reviewboard/webapi/tests/mimetypes.py
    reviewboard/webapi/resources/draft_filediff.py
    reviewboard/webapi/tests/base.py
    Ignored Files:
    docs/manual/webapi/2.0/resources/draft-file-diff-list.txt
    docs/manual/webapi/2.0/resources/index.txt
    docs/manual/webapi/2.0/resources/draft-diff-list.txt
    docs/manual/webapi/2.0/resources/draft-diff.txt
    docs/manual/webapi/2.0/resources/draft-file-diff.txt
    docs/manual/fixtures/initial_data.json

  2. 'DOES_NOT_EXIST' imported but unused

  3. 'TestTool' imported but unused

  4. local variable 'diffset' is assigned to but never used

  5. local variable 'rsp' is assigned to but never used

  6. local variable 'rsp' is assigned to but never used

  7. 'os' imported but unused

  8. 'INVALID_FORM_DATA' imported but unused

  9. 'scmtools' imported but unused

  10. 'DiffSet' imported but unused

  11. 'TestTool' imported but unused

  12. local variable 'rsp' is assigned to but never used

  13. local variable 'filediff' is assigned to but never used

  14. local variable 'rsp' is assigned to but never used

  15. local variable 'rsp' is assigned to but never used

  16. local variable 'rsp' is assigned to but never used

  17. redefinition of unused 'test_get' from line 121

  18. local variable 'rsp' is assigned to but never used

  19. local variable 'rsp' is assigned to but never used

  20. local variable 'rsp' is assigned to but never used

  21. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/testing/testcase.py
    reviewboard/webapi/resources/draft_diff.py
    reviewboard/webapi/tests/urls.py
    reviewboard/webapi/resources/init.py
    reviewboard/webapi/tests/test_draft_diff.py
    reviewboard/webapi/resources/diff.py
    reviewboard/reviews/models.py
    reviewboard/webapi/resources/review_request_draft.py
    reviewboard/webapi/tests/test_draft_filediff.py
    reviewboard/webapi/resources/original_file.py
    reviewboard/webapi/resources/patched_file.py
    reviewboard/webapi/tests/mimetypes.py
    reviewboard/webapi/resources/draft_filediff.py
    reviewboard/webapi/tests/base.py
    Ignored Files:
    docs/manual/webapi/2.0/resources/draft-file-diff-list.txt
    docs/manual/webapi/2.0/resources/index.txt
    docs/manual/webapi/2.0/resources/draft-diff-list.txt
    docs/manual/webapi/2.0/resources/draft-diff.txt
    docs/manual/webapi/2.0/resources/draft-file-diff.txt
    docs/manual/fixtures/initial_data.json

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/testing/testcase.py
    reviewboard/webapi/resources/draft_diff.py
    reviewboard/webapi/tests/urls.py
    reviewboard/webapi/resources/init.py
    reviewboard/webapi/tests/test_draft_diff.py
    reviewboard/webapi/resources/diff.py
    reviewboard/reviews/models.py
    reviewboard/webapi/resources/review_request_draft.py
    reviewboard/webapi/tests/test_draft_filediff.py
    reviewboard/webapi/resources/original_file.py
    reviewboard/webapi/resources/patched_file.py
    reviewboard/webapi/tests/mimetypes.py
    reviewboard/webapi/resources/draft_filediff.py
    reviewboard/webapi/tests/base.py
    Ignored Files:
    docs/manual/webapi/2.0/resources/draft-file-diff-list.txt
    docs/manual/webapi/2.0/resources/index.txt
    docs/manual/webapi/2.0/resources/draft-diff-list.txt
    docs/manual/webapi/2.0/resources/draft-diff.txt
    docs/manual/webapi/2.0/resources/draft-file-diff.txt
    docs/manual/fixtures/initial_data.json

  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...