Prevent review requests created with history from adding regular diffs
Review Request #9852 — Created April 3, 2018 and submitted
We now have a notion of a review request that is created with history
support. A review request created with this flag cannot have a regular
diff attached to it. Instead, an empty DiffSet must be created and
commits attached to that. (Support for which is coming in another
patch.)This option is now specified at review request creation time and cannot
be changed once the review request is created (i.e., aftersave()
is
called and the primary key has been assigned). It can be specified via
a new field on the review request resources which defaults to the old
(i.e., no history) behaviour.
Ran unit tests.
Description | From | Last Updated |
---|---|---|
Needs to be the full path. |
chipx86 | |
Missing ugettext(). |
chipx86 | |
Is this going to be seen by end users ever? If so, we shouldn't be talking DiffSets and DiffCommits, and … |
chipx86 | |
Needs to be the full module path. |
chipx86 | |
This will be just a tad more clear with "... cannot both be set to True". |
chipx86 | |
Missing ending paren. |
chipx86 | |
This would probably be better as: return (self.extra_data and self.extra_data.get(..., False)) |
chipx86 | |
Can you also have this check the resulting errors? |
chipx86 | |
This should check the message. |
chipx86 | |
Can you group those create_ flags together? |
chipx86 | |
Spaces around *. |
chipx86 | |
Should this be two tests? |
chipx86 | |
This should check the error. |
chipx86 | |
Here, too. |
chipx86 | |
Should have ~ at the beginning. These are annoyingly long, and means this must be kept up-to-date. Maybe just have … |
chipx86 | |
We can probably just talk about publishing rather than have a long line for the function reference. |
chipx86 | |
Needs to be the full reference. |
chipx86 | |
Can you have this say explicitly that "This field cannot be set if create_with_history is set" ? |
chipx86 | |
And similar here. |
chipx86 | |
Can you put the create_ arguments together? |
chipx86 | |
Can you have this check the "reason" message? |
chipx86 | |
Two blank lines. |
chipx86 | |
Can you have this check the "reason" message? |
chipx86 | |
This can fit on one line. |
chipx86 | |
This doesn't need to be indented. item_rsp['extra_data'] can fit right after the assertEqual(. |
chipx86 | |
F401 'django.http.HttpRequest' imported but unused |
reviewbot | |
E231 missing whitespace after ',' |
reviewbot | |
F811 redefinition of unused 'test_get_dvcs_feature_disabled' from line 1569 |
reviewbot | |
Should be ValueError |
david | |
typo: mulitple |
david | |
typo: mulitple |
david | |
typo: mulitple |
david | |
Missing localization. |
chipx86 | |
"STATUSES" |
chipx86 | |
Extra blank line. |
chipx86 | |
"associated" |
chipx86 | |
This needs to explicitly use ugettext(). |
chipx86 | |
Missing a trailing comma. (So is the one above.) |
chipx86 | |
Should be assertFalse |
chipx86 | |
Typo: "creatd" -> "created" |
chipx86 | |
This fits on one line. |
chipx86 | |
Same here. |
chipx86 | |
This should say that one based on the local_site_name attr will be provided if not specified here. |
chipx86 | |
We should capitalize the field names. |
chipx86 | |
This can be split across lines. |
chipx86 | |
This should use :py:attr. |
chipx86 |
-
-
-
-
reviewboard/reviews/forms.py (Diff revision 1) Is this going to be seen by end users ever? If so, we shouldn't be talking DiffSets and DiffCommits, and need to rethink what we're telling users.
-
-
reviewboard/reviews/managers.py (Diff revision 1) This will be just a tad more clear with "... cannot both be set to True".
-
-
reviewboard/reviews/models/review_request.py (Diff revision 1) This would probably be better as:
return (self.extra_data and self.extra_data.get(..., False))
-
reviewboard/reviews/tests/test_forms.py (Diff revision 1) Can you also have this check the resulting errors?
-
-
reviewboard/reviews/tests/test_review_request.py (Diff revision 1) Can you group those
create_
flags together? -
-
-
-
-
reviewboard/testing/testcase.py (Diff revision 1) Should have
~
at the beginning.These are annoyingly long, and means this must be kept up-to-date. Maybe just have this refer to the list of status on the class (with a reference to it).
(Also, these would be
:py:attr
, not:py:data
). -
reviewboard/testing/testcase.py (Diff revision 1) We can probably just talk about publishing rather than have a long line for the function reference.
-
-
reviewboard/webapi/resources/review_request.py (Diff revision 1) Can you have this say explicitly that "This field cannot be set if create_with_history is set" ?
-
-
reviewboard/webapi/resources/review_request.py (Diff revision 1) Can you put the
create_
arguments together? -
reviewboard/webapi/tests/test_diff.py (Diff revision 1) Can you have this check the "reason" message?
-
-
reviewboard/webapi/tests/test_draft_diff.py (Diff revision 1) Can you have this check the "reason" message?
-
-
reviewboard/webapi/tests/test_review_request_draft.py (Diff revision 1) This doesn't need to be indented.
item_rsp['extra_data']
can fit right after theassertEqual(
.
Change Summary:
Addressed feedback.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+406 -22) |
Checks run (1 failed, 1 succeeded)
flake8
-
reviewboard/reviews/tests/test_forms.py (Diff revision 2) F401 'django.http.HttpRequest' imported but unused
-
Change Summary:
flake8
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+405 -22) |
Checks run (2 succeeded)
Change Summary:
Rebasing.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+405 -22) |
Checks run (2 succeeded)
Change Summary:
Catch ValueError from ReviewRequest.objects.create() and return INVALID_FORM_DATA. Add unit tests.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+454 -22) |
Checks run (2 succeeded)
Change Summary:
Hide DVCS fields when the feature is disabled. Do not allow creation of DVCS review requests when feature is disabled.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+573 -22) |
Checks run (1 failed, 1 succeeded)
flake8
-
reviewboard/webapi/tests/test_review_request.py (Diff revision 6) F811 redefinition of unused 'test_get_dvcs_feature_disabled' from line 1569
Change Summary:
Fix unit test.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+573 -22) |
Checks run (2 succeeded)
Change Summary:
Formatting.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 8 (+577 -22) |
Checks run (2 succeeded)
Change Summary:
Require repository when create_with_history=True
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 9 (+629 -22) |
Checks run (2 succeeded)
Change Summary:
Addressed David's feedback. Depend on /r/9899 to fix unit tests.
Depends On: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 10 (+629 -22) |
Checks run (2 succeeded)
Change Summary:
Fix num queries in test
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 11 (+630 -23) |
Checks run (2 succeeded)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 12 (+636 -28) |
Checks run (2 succeeded)
Change Summary:
use keyword args in override_feature_check
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 13 (+636 -28) |
Checks run (2 succeeded)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 14 (+636 -28) |
Checks run (2 succeeded)
-
-
-
-
reviewboard/webapi/resources/diff.py (Diff revision 14) Missing a trailing comma. (So is the one above.)
-
Change Summary:
addressed feedback
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 15 (+638 -30) |
Checks run (2 succeeded)
-
-
-
-
-
reviewboard/testing/testcase.py (Diff revision 15) This should say that one based on the
local_site_name
attr will be provided if not specified here. -
-
Change Summary:
Addressed Christian's issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 16 (+637 -28) |