Add initial web API for commit histories.
Review Request #6816 — Created Jan. 20, 2015 and submitted — Latest diff uploaded
|6933, 6787, 6931|
|chipx86, mike_conley, smacleod|
DiffCommitResourceis a resource for retrieving the information
DiffCommitsunder a particular
DraftDiffCommitResourceinherits from the
modifies it to allow for the creation of
DraftDiffCommitResourcehandles the uploading of
DiffCommitsinstead of the
DiffSetResourcePOST method now takes an extra optional field,
create_empty, that determines if the DiffSet that is created is
created without uploading a
.diff file. This is used in the creation
of review requests with commit histories.
DraftFileDiffResourceclasses now filter
their results based on the commit query parameter. If no commit query
parameter is given, only those
FileDiffsunattached to a
DiffCommitwill be return. This filtering is only applied to the
list API, not the item API.
Add a new form, the
UploadCommitForm, for handling the processing of
data for creating new
Refactor behaviour for uploading
to a new class, the
DiffProcessorMixin. This mix-in handles the
initial processing of
.difffiles, their comparison (for header vs.
source files), generating file lists, and creating actual
from upload (it calls the child class's implementation of
DiffSetManagernow has a
create_emptymethod for creating
FileDiffsfor usage with
DiffCommitManagermodel. It inherits from the
Add a WebAPI capability to show that the server supports review
requests with commit histories. This allows new versions of
support commit histories to create review requests with history by
default if the tool supports it.
Add new unit tests for the web API. The tests include:
test_filediff, which tests
FileDifffiltering of a
test_draft_diff_commit, which does the base API tests for the
test_diff_commit, which does the base API tests for the
Unit tests pass.
Did the following manual testing:
- Created a review request via
rbt post. It was automatically
created with history. (There was one commit under the draft).
- Able to read the commit list and single commit via the API.
- Able to filter the
FileDiffitem resource was not filtered.
- Able to publish, discard, and delete the review request.
- Able to use all the public API endoint functionality of the
published RR anonymously