Fix empty review can be published bug.
Review Request #11185 — Created Sept. 19, 2020 and updated
When publishing a review, an empty review can be published and it will
show as a blank review.The
publish()
function of review has been updated to check for empty
text in a review's Header, Comment and Footer. When a review with empty
Header, Comment and Footer is being published, the function throws a
PublishError
. A review with onlyShip It
and no text is considered
to be valid and will not raise an error. Updated#982 Testing sending
e-mails and filtering out users not on a local site
to use a non-empty
Review as we now check for empty reviews.
Ran
runtests.py
, failed#788 Testing GitHub.authorize
. Tested on
browser to ensure the fix works on Web API.
Summary | ID |
---|---|
70a42fa7cb8c3452ee7c300742c4a8ca5f8539aa |
Description | From | Last Updated |
---|---|---|
We'll want to see two Python-side unit tests that checks the "empty review" state, one with and one without validate_fields … |
chipx86 | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
Looks like this was included in this change, unintentionally. You'll want to make sure your commit only has your desired … |
chipx86 | |
Looks like you're setting these because we otherwise have a blank review which can't be published. This code is pretty … |
chipx86 | |
Can you put PublishError before RevokeShipItError? We like to keep things in alphabetical order. |
chipx86 | |
Since you're introducing new arguments, you'll need to update this to reflect our modern doc standards, like "Publish" instead of … |
chipx86 | |
These can be combined into one conditional. |
chipx86 | |
Ah interesting! Looks like you caught an issue we didn't catch before. That usually means "time to write a unit … |
chipx86 | |
F841 local variable 'review' is assigned to but never used |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
F841 local variable 'review' is assigned to but never used |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
This isn't part of your change, and should be removed. We have a better fix for this in the code … |
david | |
There's an extra blank line here. |
david |
- Commits:
-
Summary ID 741de0992ca7ec66cfd14b365880227a74ca42a7 88774decfcf087b44e0f446af3b547fd87c7c151 f20e42989c3546f053cb92522aed1584b29eac60 4cf9ad98d084e49e6459162c7ab20eb977f5011d 170f5932cc151504b22d34e79e8d85788e3039c6 ee3f1f85814ea025b3a6dff616eacab7b6dc5c3f 88eb60a7bbb0e8bf98bf3c12da079154a53bb56f 90fb63ac2d03a030874c8020a460783975abc827 ea074c9d6f6d69b44cdcdab535b012b87bb08aa1 4a12eb1e06d440ba1ba8bab71436871f1904a4eb 47e132043bf149a56df183d1af490e0a5532ef78
Checks run (2 succeeded)
-
-
We'll want to see two Python-side unit tests that checks the "empty review" state, one with and one without
validate_fields
set. -
Looks like this was included in this change, unintentionally. You'll want to make sure your commit only has your desired changes, and post only that commit for review (
rbt post HEAD
, usually). -
Looks like you're setting these because we otherwise have a blank review which can't be published.
This code is pretty old, and fortunately we have some modern test object creaation helpers that provide standard default data. Would you be up for switching to those instead? It works like:
self.create_review(review_request=review_request, user=site_user4, publish=True)
Note that
publish=True
: You can ditch thepublish()
calls with this. -
-
Since you're introducing new arguments, you'll need to update this to reflect our modern doc standards, like "Publish" instead of "Publishes," and an
Args
andRaises
.See our doc standards.
-
-
Ah interesting! Looks like you caught an issue we didn't catch before.
That usually means "time to write a unit test!" There's a test file for this in the tree that you'll want to ensure is asserting the state of this flag on error.
- Change Summary:
-
Fix 6 issues from Revision 2.
- Commits:
-
Summary ID ee3f1f85814ea025b3a6dff616eacab7b6dc5c3f 88eb60a7bbb0e8bf98bf3c12da079154a53bb56f 90fb63ac2d03a030874c8020a460783975abc827 ea074c9d6f6d69b44cdcdab535b012b87bb08aa1 4a12eb1e06d440ba1ba8bab71436871f1904a4eb 47e132043bf149a56df183d1af490e0a5532ef78 95f5466dc4edf1d491d61ad91b0819b62b42796f
Checks run (1 failed, 1 succeeded)
flake8
- Change Summary:
-
Jasmine trigger error change.
- Commits:
-
Summary ID 95f5466dc4edf1d491d61ad91b0819b62b42796f 95f5466dc4edf1d491d61ad91b0819b62b42796f 2d3b5ca4a165fe0646f366a182e93d9d100d12e1 - Diff:
-
Revision 4 (+202 -24)
Checks run (1 failed, 1 succeeded)
flake8
- Change Summary:
-
Fix flake8 issues.
- Commits:
-
Summary ID 95f5466dc4edf1d491d61ad91b0819b62b42796f 2d3b5ca4a165fe0646f366a182e93d9d100d12e1 158738ba093ee9380d001634020de30675d9ecc6 - Diff:
-
Revision 5 (+202 -28)
Checks run (2 succeeded)
- Change Summary:
-
Address feedback.
- Commits:
-
Summary ID 158738ba093ee9380d001634020de30675d9ecc6 70a42fa7cb8c3452ee7c300742c4a8ca5f8539aa - Diff:
-
Revision 6 (+198 -26)