Adding the ability for bots to make general comments
Review Request #10095 — Created July 19, 2018 and discarded
Adding the ability for bots to make general comments.
Similar to how a tool can post diff comments on a file, they can now also post general comments on the review.
This also paves the way for tools to post file and screenshot comments (but does not add this functionality)
Was able to post an automated review with/without general comments, opening issues on some comments and not on others.
Also posted an automated review with 35 general comments and 1 diff comment -> only 30 got posted, all of which were the general comments.
Likewise posted an automated review with 15 general comments and 17 diff comments -> only 30 (total) got posted, 15 general and 15 diff.
Additionally, tried using an updated Review Board server with a worker without the changes -> No errors, everything works as expected.
Description | From | Last Updated |
---|---|---|
E302 expected 2 blank lines, found 1 |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E722 do not use bare except' |
reviewbot | |
This also needs to clear out self.comments |
david | |
Can we call this InvalidFormDataError? |
david | |
Docstrings should be a single-line summary followed by zero or more paragraphs. |
david | |
Blank line between the docstring and the methods. |
david | |
This needs a docstring. |
david | |
Shouldn't this be return INVALID_FORM_DATA, e.data? |
david | |
Formatting here can be improved (or at least made more consistent with other code): raise InvalidFormData({ 'fields': { comment_type: 'Malformed … |
david | |
Same here: raise InvalidFormData({ 'fields': { comment_type: ('Element missing keys "%s"' % missing_keys), }, }) |
david | |
Can we move this code into the try/catch above? That way we only have one place that's returning INVALID_FORM_DATA. We … |
david | |
It would be slightly cleaner to have these in the try/catch above where we assign comment['filediff'] |
david | |
This needs a docstring |
david | |
Add a trailing comma |
david | |
Can we put parens around the value here? comment_type: ('Element missing keys "%s"' % missing_keys), |
david | |
Add a trailing comma |
david |
- Change Summary:
-
Appeasing the 8 gods of Flake.
- Commit:
-
73fc50f3d9a2b0839bc948d6d2cdb23cbc496d2c788ebd0731f230fbba2e4e1c1c4e1f53eebf7a52
Checks run (2 succeeded)
- Change Summary:
-
Integrated David's feedback + more testing
- Testing Done:
-
Was able to post an automated review with/without general comments, opening issues on some comments and not on others.
~ Also posted an automated review with 35 general comments -> only 30 got posted. ~ Likewise posted an automated review with 15 general comments and 17 diff comments -> only 30 (total) got posted, 15 general and 15 diff. ~ Also posted an automated review with 35 general comments and 1 diff comment -> only 30 got posted, all of which were the general comments. ~ Likewise posted an automated review with 15 general comments and 17 diff comments -> only 30 (total) got posted, 15 general and 15 diff. + Additionally, tried using an updated Review Board server with a worker without the changes -> No errors, everything works as expected. - Commit:
-
788ebd0731f230fbba2e4e1c1c4e1f53eebf7a52a48b61944225df16cf604036c9592150ba7f420c
Checks run (2 succeeded)
-
-
Can we move this code into the try/catch above? That way we only have one place that's returning INVALID_FORM_DATA.
We could also do all of the normalization before creating the Review object, which would eliminate the need for the TODO comment since we wouldn't have created anything in the db.
-
It would be slightly cleaner to have these in the try/catch above where we assign
comment['filediff']
-
-
-
Can we put parens around the value here?
comment_type: ('Element missing keys "%s"' % missing_keys),
-