Add API for working with drafts of diffs.
Review Request #4645 — Created Sept. 24, 2013 and submitted
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 |
reviewbot | |
'TestTool' imported but unused |
reviewbot | |
local variable 'diffset' is assigned to but never used |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
'os' imported but unused |
reviewbot | |
'INVALID_FORM_DATA' imported but unused |
reviewbot | |
'scmtools' imported but unused |
reviewbot | |
'DiffSet' imported but unused |
reviewbot | |
'TestTool' imported but unused |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
local variable 'filediff' is assigned to but never used |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
redefinition of unused 'test_get' from line 121 |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot | |
local variable 'rsp' is assigned to but never used |
reviewbot |
-
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 -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Fixed pyflakes warnings.
- Diff:
-
Revision 2 (+721 -24)
-
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
-
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