Fix the issue of publishing from web API without reviewers or groups specified.
Review Request #9210 — Created Sept. 23, 2017 and submitted
When creating a new review request with no reviewer or groups
assigned, attempting to publish it with PUT will be sucessful.
However, it shouldn't allow that as review requests must have a
reviewer. The issue is solved by adding conditions to validate the
review draft on the server.
Added a unit test, which passes (along with all other tests).
- Created a draft test review that don't have a reviewer/group name.
- Ran it using this command ./tests/runtests.py
reviewboard.reviews.tests.test_review_request_draft - This will raise a publishingError since there isn't reviewer.
- Fixed other unit tests that failed because of the change.
Description | From | Last Updated |
---|---|---|
The summary doesn't tell me anything. From the summary alone, I should be able to have a clear idea of … |
chipx86 | |
Please wrap your description at 72 characters. |
brennie | |
Instead of including a URL in the description you can just name the resource involved. |
brennie | |
Please wrap your description at 72 characters. |
brennie | |
The summary should be in sentence casing. |
chipx86 | |
You still need to wrap your description at 72 characters per line. |
brennie | |
I'd like to see a little more here with this change. Right now, the validation happens client-side in JavaScript for … |
chipx86 | |
Shouldn't add parenthesis here. We only use them if spanning lines. |
chipx86 | |
This blank line shouldn't be added. |
chipx86 | |
Too many blank lines. |
chipx86 | |
E265 block comment should start with '# ' |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
This should go away. |
chipx86 | |
The web UI currently displays an error message for this case, so we should use that exact string. |
chipx86 | |
You should remove the blank lines you added here. |
chipx86 | |
Too many blank lines. There should be 2. |
chipx86 | |
E303 too many blank lines (2) |
reviewbot | |
F841 local variable 'old_summary' is assigned to but never used |
reviewbot | |
F841 local variable 'old_description' is assigned to but never used |
reviewbot | |
F841 local variable 'old_testing_done' is assigned to but never used |
reviewbot | |
F841 local variable 'old_branch' is assigned to but never used |
reviewbot | |
F841 local variable 'old_bugs' is assigned to but never used |
reviewbot | |
Just one blank line here. |
chipx86 | |
E303 too many blank lines (3) |
reviewbot | |
This should test for the error message as well. |
chipx86 | |
W391 blank line at end of file |
reviewbot | |
Too many blank lines. You should remove the ones you added. |
chipx86 | |
W291 trailing whitespace |
reviewbot | |
E501 line too long (114 > 79 characters) |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
E501 line too long (114 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E501 line too long (106 > 79 characters) |
reviewbot | |
E501 line too long (106 > 79 characters) |
reviewbot | |
This newline should be removed. |
mike_conley | |
Glad you added a test for the lack of reviewers, but can you add some tests for the lack of … |
mike_conley | |
These extra newlines should be removed. |
mike_conley | |
This extra newline should be removed. |
mike_conley | |
E999 SyntaxError: EOL while scanning string literal |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E124 closing bracket does not match visual indentation |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E124 closing bracket does not match visual indentation |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E124 closing bracket does not match visual indentation |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
These need to be marked for translation with ugettext. |
brennie | |
Single quotes. This should be marked for translation with ugettext. |
brennie | |
Single quotes. This should be marked for translation with ugettext. |
brennie | |
Single quotes. This should be marked for translation with ugettext. |
brennie | |
Undo this. |
brennie | |
This needs to be localized (using ugettext). |
chipx86 | |
These as well. |
chipx86 | |
This can be one statement. |
chipx86 | |
Imports must be included alphabetically. |
chipx86 | |
"publish" isn't explicit enough when looking at a whole list of tests. We prefer including the class name. Can you … |
chipx86 | |
You don't need to define this function anymore, since it's just chaining up. |
chipx86 | |
E501 line too long (88 > 79 characters) |
reviewbot | |
These can go on the same line. |
brennie | |
Undo this. |
brennie | |
Alphabetical order. |
brennie | |
Why are we no longer doing this client side? It save s a round trip. |
brennie | |
This looks like your project is starting to leak into your EasyFix. You'll want to separate them, and do project … |
mike_conley | |
This doesn't need the parens around it (we only use them if the list of imports wraps to multiple lines). |
david | |
Parens can go on the same line as the last part of the text. |
david | |
Moving this line doesn't seem to be changing functionality but it is making the imports no longer alphabetically sorted. |
bleblan2 | |
This import is also not in alphabetical order (e before f). |
bleblan2 | |
Grammar isn't quite right--needs to be "isn't a reviewer" |
david | |
This is the test for not having a description but you're checking for the error about not having a summary. … |
bleblan2 | |
W292 no newline at end of file |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
W391 blank line at end of file |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
E501 line too long (105 > 79 characters) |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot |
-
-
The summary doesn't tell me anything. From the summary alone, I should be able to have a clear idea of the purpose of this change. As it is, I have to know what reviewers name issue you're talking about.
The description also needs a lot more fleshing out. I want to see what the problem was, why it was a problem, how it was fixed. Look at the Writing Good Change Descriptions guide for details on what we expect.
Content must also wrap to 70-75 characters in your description/testing.
Testing Done's content needs some work as well. I'd suggest getting a mentor and having him go over ways to make the testing clear and succint.
-
I'd like to see a little more here with this change. Right now, the validation happens client-side in JavaScript for this field. The client also validates the summary and description. Both of these should also move into the server-side validation in your change (and you should summarize the change appropriately, like "Move UI-side validation for required review request fields into the backend"). You should then get rid of the client-side versions of these so we only have one validation codepath to go through.
-
-
-
-
-
-
-
-
-
-
- Summary:
-
Fixed reviewers name issueFixed the Issue of Publishing From Web API Without Reviewers or Groups Specified
- Description:
-
~ Fixed the Issue of Publishing From Web API Without Reviewers or Groups Specified
~ When creating a new review request with no reviewer or groups assigned, attempting to publish it with PUT .../api/review-requests/####/draft/ public=1 will be sucessful. However, it shouldn't allow that as review requests must have a reviewer. The issue is solved by adding conditions to validate the review draft on the server.
- Testing Done:
-
- When user attempt to publish using PUT .../api/review-requests/####/draft/ public=1, the people or group names is not required. The user can submit the review request with no reviewers or groups assigned.
- There weren't any condition to check for user or group name in the web API. This change checks for people or group name to see if they're entered or not. - Added a unit test, which passes (along with all other tests).
~ Tested by creating a draft review request without containing user/group names. After trying to publish it this will raise publish error.
~ - Created a draft test review that don't have a reviewer/group name.
+ - Ran it using this command ./tests/runtests.py reviewboard.reviews.tests.test_review_request_draft
+ - This will raise a publishingError since there isn't reviewer.
- Commit:
-
07f33dbc16e7d628d28e8adb606a7c09edd819a57b960f1130a660c49df6dc3086f46ae20a232740
- Commit:
-
7b960f1130a660c49df6dc3086f46ae20a2327401d24398b63fcb1d14899bde171dc5b0040ea813c
- Diff:
-
Revision 3 (+40 -18)
- Commit:
-
1d24398b63fcb1d14899bde171dc5b0040ea813cb0b96286e45e8057e1b1636b0ec8c4f2ee9540b7
- Diff:
-
Revision 4 (+44 -19)
- Commit:
-
b0b96286e45e8057e1b1636b0ec8c4f2ee9540b7a77089f54749bc327013b8d511d78056a6a1db0b
- Diff:
-
Revision 5 (+46 -19)
- Commit:
-
a77089f54749bc327013b8d511d78056a6a1db0bbe52cc8e8e01c6d95edcd01aa090b273e79cee0d
- Diff:
-
Revision 6 (+46 -19)
- Commit:
-
be52cc8e8e01c6d95edcd01aa090b273e79cee0db6dffa2eeed963a1e942526f08d5a75b7a8270b8
- Diff:
-
Revision 7 (+73 -19)
- Commit:
-
b6dffa2eeed963a1e942526f08d5a75b7a8270b8765f712c52834a891bee580974e60e8a4a913db3
- Diff:
-
Revision 8 (+74 -19)
Checks run (2 succeeded)
- Description:
-
~ When creating a new review request with no reviewer or groups assigned, attempting to publish it with PUT .../api/review-requests/####/draft/ public=1 will be sucessful. However, it shouldn't allow that as review requests must have a reviewer. The issue is solved by adding conditions to validate the review draft on the server.
~ When creating a new review request with no reviewer or groups assigned, attempting to publish it with PUT will be sucessful. However, it shouldn't allow that as review requests must have a reviewer. The issue is solved by adding conditions to validate the review draft on the server.
- Commit:
-
765f712c52834a891bee580974e60e8a4a913db37a68c52fdfc99b64b78f3b7863b932bd6994efea
- Diff:
-
Revision 9 (+72 -19)
Checks run (2 succeeded)
- Summary:
-
Fixed the Issue of Publishing From Web API Without Reviewers or Groups SpecifiedFixed the Issue of Publishing From Web API Without Reviewers or Groups Specified.
- Commit:
-
7a68c52fdfc99b64b78f3b7863b932bd6994efeac0c86a0ca3728366e7cf736d563f466541e0d4ec
- Diff:
-
Revision 10 (+71 -24)
- Commit:
-
c0c86a0ca3728366e7cf736d563f466541e0d4ecec6d4d6c7e3f24a2496e0254b428148e29883289
- Diff:
-
Revision 11 (+72 -24)
Checks run (2 succeeded)
- Description:
-
~ When creating a new review request with no reviewer or groups assigned, attempting to publish it with PUT will be sucessful. However, it shouldn't allow that as review requests must have a reviewer. The issue is solved by adding conditions to validate the review draft on the server.
~ When creating a new review request with no reviewer or groups
+ assigned, attempting to publish it with PUT will be sucessful. + However, it shouldn't allow that as review requests must have a + reviewer. The issue is solved by adding conditions to validate the + review draft on the server. - Testing Done:
-
Added a unit test, which passes (along with all other tests).
- Created a draft test review that don't have a reviewer/group name.
~ - Ran it using this command ./tests/runtests.py reviewboard.reviews.tests.test_review_request_draft
~ - Ran it using this command ./tests/runtests.py
reviewboard.reviews.tests.test_review_request_draft
- This will raise a publishingError since there isn't reviewer.
- Commit:
-
ec6d4d6c7e3f24a2496e0254b428148e298832893d85f20ea55eee23162169c3eca7699558845175
- Diff:
-
Revision 12 (+99 -24)
Checks run (2 succeeded)
- Commit:
-
3d85f20ea55eee23162169c3eca7699558845175ae36187944ab976c1c3dfa85e173aa59f0adef1f
- Diff:
-
Revision 13 (+71 -24)
Checks run (2 succeeded)
-
-
Moving this line doesn't seem to be changing functionality but it is making the imports no longer alphabetically sorted.
-
-
This is the test for not having a description but you're checking for the error about not having a summary. This should probably be changed to set a summary on the draft and then the error should be about the description not being there.
- Branch:
-
release-3.0.xmaster
- Commit:
-
ae36187944ab976c1c3dfa85e173aa59f0adef1f6d1d668e854ef48bde23dca3a8b6aaa32f8a4d79
- Commit:
-
305520b7f15c7d40a6f2056107c9ce642e70680421fe322f8e9c810d15f83db8e18c9f02ca5fc1de
Checks run (2 succeeded)
- Commit:
-
21fe322f8e9c810d15f83db8e18c9f02ca5fc1dea73e6ade4f583b68118f4c59560a6b62df3ae35d
Checks run (2 succeeded)
- Change Summary:
-
Many of the unit tests were failing because they were not adding reviewers, summary, or description to review requests.
Fixed that by adding a boolean parameter in review request creator that defaults to adding reviewers. [WIP]
- Summary:
-
Fixed the issue of publishing from web API without reviewers or groups specified.Fixed the issue of publishing from web API without reviewers or groups specified. [WIP]
- Testing Done:
-
Added a unit test, which passes (along with all other tests).
- Created a draft test review that don't have a reviewer/group name.
- Ran it using this command ./tests/runtests.py
reviewboard.reviews.tests.test_review_request_draft
- This will raise a publishingError since there isn't reviewer.
+ - Fixed other unit tests.
- Commit:
-
a73e6ade4f583b68118f4c59560a6b62df3ae35d95fefbd0d72c7bbc7128746aaee026123955e539
- Diff:
-
Revision 19 (+98 -27)
Checks run (1 failed, 1 succeeded)
flake8
- Change Summary:
-
Fixed more unit tests.
- Summary:
-
Fixed the issue of publishing from web API without reviewers or groups specified. [WIP][WIP] Fixed the issue of publishing from web API without reviewers or groups specified.
- Commit:
-
95fefbd0d72c7bbc7128746aaee026123955e539297a5d737825968a5bb4baa4451d578188424abc
- Diff:
-
Revision 20 (+152 -80)
Checks run (2 succeeded)
- Summary:
-
[WIP] Fixed the issue of publishing from web API without reviewers or groups specified.Fixed the issue of publishing from web API without reviewers or groups specified.
- Testing Done:
-
Added a unit test, which passes (along with all other tests).
- Created a draft test review that don't have a reviewer/group name.
- Ran it using this command ./tests/runtests.py
reviewboard.reviews.tests.test_review_request_draft
- This will raise a publishingError since there isn't reviewer.
~ - Fixed other unit tests.
~ - Fixed other unit tests that failed because of the change.
- Commit:
-
297a5d737825968a5bb4baa4451d578188424abcf5e16b32982abd8c1c7812c78595cf206945a421
- Diff:
-
Revision 21 (+149 -78)