Initial backend support for review requests with commit history.
Review Request #6779 — Created Jan. 15, 2015 and discarded
Add the
DiffCommitResource
andDraftDiffCommitResource
resources.
TheDiffCommitResource
is a resource for retrieving the information
about theCommits
under a particular DiffSet. The
DraftDiffCommitResource
inherits from theDiffCommitResource
and
modifies it to allow for the creation ofCommit
s and associated
FileDiff
s. TheDraftDiffCommitResource
handles the uploading of
FileDiff
s forCommit
s instead of theDiffSetResource
.Register the
Commit
model for bothDiffCommitResource
and
DraftDiffCommitResource
in the API. They are item child resources of
theDiffSetResource
andDraftDiffSetResource
resources,
respectively.The
DiffSetResource.create
method now takes an extra optional field,
create_empty
, that determines if theDiffSet
that is created is
created without uploading a.diff
file. This is used in the creation
of review requests with commit histories.The
FileDiffResource
andDraftFileDiffResource
classes now filter
their results based on thecommit
query parameter. If nocommit
query parameter is given, only thoseFileDiff
s unattached to a
Commit
will 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 newCommit
instances. It is very similar to
diffviewer.forms.UploadDiffForm
and may need to be refactored.Refactor behaviour for uploading
FileDiff
s from theDiffSetManager
to a new class, theDiffProcessorMixin
. This mix-in handles the
initial processing of.diff
files, their comparison (for header vs
source files), generating file lists, and creating actualFileDiff
s
from upload (it calls the child class's implementation of
create_from_data
).The
DiffSetManager
now has acreate_empty
method for creating
DiffSet
s withoutFileDiff
s for usage withCommit
s.Add the
CommitManager
model. It inherits from the
DiffProcessorMixin.
Update the
validate_diff
endpoint to use named parameters for
DiffSetManager.create_from_upload
because of the refactoring.Add a WebAPI capability to show that the server supports review
requests with commit histories.TODO:
- Unit tests forthcoming.
- Manual testing information forthcoming.
Ran unit tests.
Able to create a review request with a single commit of history via
RBTools
(see: https://reviews.reviewboard.org/r/6787/).
Description | From | Last Updated |
---|---|---|
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 25 E131 continuation line unaligned for hanging indent |
reviewbot | |
Col: 29 E131 continuation line unaligned for hanging indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 1 E303 too many blank lines (3) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
'datetime' imported but unused |
reviewbot | |
'urlencode' imported but unused |
reviewbot | |
'get_resource_for_object' imported but unused |
reviewbot |
- Change Summary:
-
Fix ReviewBot's issues. Add in the manager for the
DiffCommit
model. - Diff:
-
Revision 2 (+830 -151)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Change Summary:
-
Update it so its not so broken.
- Testing Done:
-
~ Ran unit tests.
~ Ran unit tests.
+ Able to create a review request with a single commit of history via RBTools
(patch forthcoming). - Depends On:
-
- Diff:
Revision 3 (+853 -151)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
-
-
-
-
- Change Summary:
-
Fix ReviewBot's issues.
- Commit:
-
4b46239a9e25c4704dac22c1ce97bc9517d94724
- Diff:
-
Revision 4 (+996 -154)
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/admin.py reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/diffviewer/evolutions/__init__.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/admin.py reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/diffviewer/evolutions/__init__.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/evolutions/add_commit_history_fields.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Change Summary:
-
Update testing information to reference RBTools RR.
- Testing Done:
-
Ran unit tests.
~ Able to create a review request with a single commit of history via RBTools
(patch forthcoming).~ Able to create a review request with a single commit of history via + RBTools
(see: https://reviews.reviewboard.org/r/6787/).
- Change Summary:
-
change mimetype to be
diff-commit
instead ofcommit
. - Diff:
-
Revision 5 (+849 -151)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Change Summary:
-
Add Web API capabilities for RRs with commit history
- Description:
-
Add the
DiffCommitResource
andDraftDiffCommitResource
resources.The DiffCommitResource
is a resource for retrieving the informationabout the Commits
under a particular DiffSet. TheDraftDiffCommitResource
inherits from theDiffCommitResource
andmodifies it to allow for the creation of Commit
s and associatedFileDiff
s. TheDraftDiffCommitResource
handles the uploading ofFileDiff
s forCommit
s instead of theDiffSetResource
.Register the
Commit
model for bothDiffCommitResource
andDraftDiffCommitResource
in the API. They are item child resources ofthe DiffSetResource
andDraftDiffSetResource
resources,respectively. The
DiffSetResource.create
method now takes an extra optional field,create_empty
, that determines if theDiffSet
that is created iscreated without uploading a .diff
file. This is used in the creationof review requests with commit histories. The
FileDiffResource
andDraftFileDiffResource
classes now filtertheir results based on the commit
query parameter. If nocommit
query parameter is given, only those FileDiff
s unattached to aCommit
will be return. This filtering is only applied to the listAPI, not the item API. Add a new form, the
UploadCommitForm
, for handling the processing ofdata for creating new Commit
instances. It is very similar todiffviewer.forms.UploadDiffForm
and may need to be refactored.Refactor behaviour for uploading
FileDiff
s from theDiffSetManager
to a new class, the DiffProcessorMixin
. This mix-in handles theinitial processing of .diff
files, their comparison (for header vssource files), generating file lists, and creating actual FileDiff
sfrom upload (it calls the child class's implementation of create_from_data
).The
DiffSetManager
now has acreate_empty
method for creatingDiffSet
s withoutFileDiff
s for usage withCommit
s.Add the
CommitManager
model. It inherits from theDiffProcessorMixin.
Update the
validate_diff
endpoint to use named parameters forDiffSetManager.create_from_upload
because of the refactoring.+ Add a WebAPI capability to show that the server supports review
+ requests with commit histories. + TODO:
- Unit tests forthcoming. - Manual testing information forthcoming. - Diff:
-
Revision 6 (+850 -173)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Change Summary:
-
Add validation for the merge parents
- Diff:
-
Revision 7 (+873 -151)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Change Summary:
-
Save the models. Save them!
- Diff:
-
Revision 8 (+876 -151)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Diff:
-
Revision 9 (+876 -151)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Change Summary:
-
merge_parent_id
->merge_parent_ids
everywhere - Diff:
-
Revision 10 (+876 -151)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py
- Change Summary:
-
Check the
merge_commit_ids
to make sure they are truthy before enumerating them. - Diff:
-
Revision 11 (+877 -151)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py Tool: Pyflakes Processed Files: reviewboard/webapi/resources/draft_diff.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/resources/draft_diff_commit.py reviewboard/webapi/server_info.py reviewboard/diffviewer/models.py reviewboard/webapi/resources/filediff.py reviewboard/webapi/resources/diff.py reviewboard/webapi/resources/diff_commit.py reviewboard/diffviewer/forms.py reviewboard/diffviewer/managers.py reviewboard/webapi/resources/validate_diff.py reviewboard/webapi/resources/draft_filediff.py