Status API
Review Request #7961 — Created Feb. 14, 2016 and discarded
Basic GET/POST/PUT request handlers are done. The basic statuses has type Success(represented as "S"), Failure("F") and Pending("P").
Unit tests are written for new features.
UI for displaying statuses are created.A demo for latest version can be viewed at:
https://drive.google.com/file/d/0B9f_D8xqWtODX01NMTFiZ2hfOG8/view?usp=sharingWhat to be done next:
Statuses are referenced by internally generated status id. Should change to a unique client ID.
Work with ReviewBot on grouping reviews of latest statuses.
Add filter to whether the statuses are current for the latest change (should probably default to only showing for the latest change)It's best to start looking at webapi/resources/status.py and reviews/models/status.py for implementation.
Some sample requests to be made are:
Get all statuses on a review request:
curl host/api/review-requests/1/statuss/GET request with some filter options:
curl host/api/review-requests/1/statuss/?status_type=P
curl host/api/review-requests/1/statuss/?time=YYYY-MM-DD-HH-MM-SSPOST request (need authorization info):
curl -X POST host/api/review-requests/1/statuss/ -d "context=Travis%20CI&label=Failed&progress=F&url=continuous-integration/travis&url_label=Build%20log" -A application/jsonPUT request (need authorization info):
curl -X PUT host/api/review-requests/1/statuss/1/ -d "context=Unit%20Testing&label=Success&progress=S" -A application/json
Description | From | Last Updated |
---|---|---|
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 63 W291 trailing whitespace |
reviewbot | |
Col: 60 W291 trailing whitespace |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 33 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 62 W291 trailing whitespace |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 54 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 56 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 64 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 18 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 20 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 53 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 24 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 26 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 56 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 58 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 74 W291 trailing whitespace |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 59 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 63 W291 trailing whitespace |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 33 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 62 W291 trailing whitespace |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 58 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 60 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 22 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 24 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 65 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 67 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 26 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 28 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
'ObjectDoesNotExist' imported but unused |
reviewbot | |
'Q' imported but unused |
reviewbot | |
'webapi_response_errors' imported but unused |
reviewbot | |
'webapi_request_fields' imported but unused |
reviewbot | |
'webapi_login_required' imported but unused |
reviewbot | |
'resources' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 59 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 63 W291 trailing whitespace |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 33 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 62 W291 trailing whitespace |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 58 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 60 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 22 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 24 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 65 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 67 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 26 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 28 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
'webapi_check_local_site' imported but unused |
reviewbot | |
undefined name 'review' |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 63 W291 trailing whitespace |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 33 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 62 W291 trailing whitespace |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
'randint' imported but unused |
reviewbot | |
Col: 78 W291 trailing whitespace |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 W291 trailing whitespace |
reviewbot | |
Col: 77 W291 trailing whitespace |
reviewbot | |
Col: 41 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 39 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 25 E128 continuation line under-indented for visual indent |
reviewbot | |
'webapi_check_local_site' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 48 W291 trailing whitespace |
reviewbot | |
Col: 71 E502 the backslash is redundant between brackets |
reviewbot | |
Col: 71 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 28 E131 continuation line unaligned for hanging indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 59 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
undefined name 'PublishError' |
reviewbot | |
'mail' imported but unused |
reviewbot | |
'add_fixtures' imported but unused |
reviewbot | |
'PERMISSION_DENIED' imported but unused |
reviewbot | |
'DOES_NOT_EXIST' imported but unused |
reviewbot | |
'NOT_LOGGED_IN' imported but unused |
reviewbot | |
'ReviewRequestChildItemMixin' imported but unused |
reviewbot | |
'get_status_item_url' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 63 W291 trailing whitespace |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 33 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 62 W291 trailing whitespace |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 37 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
'randint' imported but unused |
reviewbot | |
Col: 78 W291 trailing whitespace |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 W291 trailing whitespace |
reviewbot | |
Col: 77 W291 trailing whitespace |
reviewbot | |
Col: 25 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 39 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 41 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 48 W291 trailing whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 71 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 71 E502 the backslash is redundant between brackets |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 28 E131 continuation line unaligned for hanging indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
undefined name 'PublishError' |
reviewbot | |
'mail' imported but unused |
reviewbot | |
'add_fixtures' imported but unused |
reviewbot | |
'NOT_LOGGED_IN' imported but unused |
reviewbot | |
'DOES_NOT_EXIST' imported but unused |
reviewbot | |
'ChangeDescription' imported but unused |
reviewbot | |
'PUBLISH_ERROR' imported but unused |
reviewbot | |
Col: 28 E131 continuation line unaligned for hanging indent |
reviewbot | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 65 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 65 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 72 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 75 W291 trailing whitespace |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Col: 68 E502 the backslash is redundant between brackets |
reviewbot | |
Col: 68 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 68 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Since this is a status, do we really need "status label", "status progress" and "status description"? I imagine it should … |
mike_conley | |
We tend to use underscores in our variable names to break up multiple words. This should probably be num_failures. Also, … |
mike_conley | |
Maybe use count() here instead, unless there's a good reason not to (the only reason we might want len(), as … |
mike_conley | |
Nit - one space indentation for the HTML in templates. Same goes for the rest of your templates. |
mike_conley | |
If we can, we should probably avoid inline styling and put this in the CSS for review details instead. |
mike_conley | |
This needs to be a translatable string - see the "Change Summary:" translation being done on line 42. |
mike_conley | |
Same as above, re: inline styling. We can use either a class or an attribute to set the state, and … |
mike_conley | |
Please don't use inline styling if it can be avoided. |
mike_conley | |
Translate this too, please. |
mike_conley | |
These <br>'s can probably be avoided here and on line 44 with some margin CSS. |
mike_conley | |
More inline styles to switch to CSS. |
mike_conley | |
Can you add a comment about why we're skipping rendering this if there's at least one ChangeDescription? Is this because … |
mike_conley | |
I don't think this is going out in 2.6. This should probably be 3.0 or 4.0. Maybe ask Christian. |
mike_conley | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 65 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 65 E502 the backslash is redundant between brackets |
reviewbot | |
Col: 65 E251 unexpected spaces around keyword / parameter equals |
reviewbot |
- Description:
-
~ Try adding status into UI
~ Try adding status into UI;
+ Start creating status API web resource. - Diff:
-
Revision 2 (+240 -2)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/evolutions/status_url_label.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py Ignored Files: reviewboard/templates/reviews/boxes/review.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/evolutions/status_url_label.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py Ignored Files: reviewboard/templates/reviews/boxes/review.html WARNING: Number of comments exceeded maximum, showing 30 of 42.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Description:
-
~ Try adding status into UI;
~ Added handler for GET request.
- Start creating status API web resource. - Diff:
-
Revision 3 (+334 -2)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/evolutions/status_url_label.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py Ignored Files: reviewboard/templates/reviews/boxes/review.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/evolutions/status_url_label.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py Ignored Files: reviewboard/templates/reviews/boxes/review.html WARNING: Number of comments exceeded maximum, showing 30 of 44.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Description:
-
~ Added handler for GET request.
~ Implemented request handlers and added simple test cases
- Diff:
-
Revision 4 (+541 -3)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/webapi/resources/review_request.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/boxes/review.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/webapi/resources/review_request.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/boxes/review.html WARNING: Number of comments exceeded maximum, showing 30 of 38.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Diff:
-
Revision 5 (+708 -3)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/webapi/resources/review_request.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/boxes/review.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/webapi/resources/review_request.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/boxes/review.html WARNING: Number of comments exceeded maximum, showing 30 of 52.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Description:
-
~ Implemented request handlers and added simple test cases
~ Fixed filter bug and added filter features.
+ Fixed relation between Review and Status, and corresponding creations/update. - Diff:
-
Revision 6 (+736 -4)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/boxes/review.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/boxes/review.html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Summary:
-
[WIP] Status APIStatus API
- Description:
-
~ Fixed filter bug and added filter features.
~ Fixed relation between Review and Status, and corresponding creations/update. ~ Basic GET/POST/PUT request handlers are done.
~ Unit tests are written for new features. + Basic UI is created. - Diff:
-
Revision 7 (+799 -4)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html
-
Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html
-
-
-
-
- Diff:
-
Revision 8 (+794 -4)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html
-
-
-
- Diff:
-
Revision 9 (+791 -4)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html
-
Very good stuff in here, Shuai. I have a few questions - see below.
-
Since this is a status, do we really need "status label", "status progress" and "status description"? I imagine it should be inferred that the "label" is for the Status itself.
-
We tend to use underscores in our variable names to break up multiple words. This should probably be
num_failures
.Also, maybe we should use
.count()
instead oflen()
here.Maybe I missed some context with you and ChipX86, but isn't there a ForeignKey relationship here we could take advantage of, via
changedesc.statuses
? -
Maybe use
count()
here instead, unless there's a good reason not to (the only reason we might wantlen()
, as far as I can tell, is because it might be able to avoid a second SQL query since we already retrieved all of the Status models for this review request). -
-
If we can, we should probably avoid inline styling and put this in the CSS for review details instead.
-
This needs to be a translatable string - see the "Change Summary:" translation being done on line 42.
-
Same as above, re: inline styling.
We can use either a class or an attribute to set the state, and then apply colours and styling for that state in the CSS.
-
-
-
-
-
Can you add a comment about why we're skipping rendering this if there's at least one ChangeDescription? Is this because we'll just end up making the status part of the latest ChangeDescription?
Was it ever a design goal to display the most recent Status closer to the top of the review details page?
-
- Diff:
-
Revision 10 (+803 -4)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html
-
- Diff:
-
Revision 11 (+804 -4)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html
-
-
- Diff:
-
Revision 12 (+804 -4)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_status.py reviewboard/reviews/models/__init__.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/resources/status.py reviewboard/reviews/models/status.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/tests/urls.py Ignored Files: reviewboard/templates/reviews/review_detail.html reviewboard/templates/reviews/boxes/status.html reviewboard/templates/reviews/boxes/change.html
-
- Description:
-
~ Basic GET/POST/PUT request handlers are done.
~ Basic GET/POST/PUT request handlers are done. The basic statuses has type Success(represented as "S"), Failure("F") and Pending("P").
Unit tests are written for new features. ~ Basic UI is created. ~ UI for displaying statuses are created. + + A demo for latest version can be viewed at:
+ https://drive.google.com/file/d/0B9f_D8xqWtODX01NMTFiZ2hfOG8/view?usp=sharing + + What to be done next:
+ Statuses are referenced by internally generated status id. Should change to a unique client ID. + Work with ReviewBot on grouping reviews of latest statuses. + Add filter to whether the statuses are current for the latest change (should probably default to only showing for the latest change) + + It's best to start looking at webapi/resources/status.py and reviews/models/status.py for implementation.
+ + Some sample requests to be made are:
+ Get all statuses on a review request: + curl host/api/review-requests/1/statuss/ + + GET request with some filter options:
+ curl host/api/review-requests/1/statuss/?status_type=P + curl host/api/review-requests/1/statuss/?time=YYYY-MM-DD-HH-MM-SS + + POST request (need authorization info):
+ curl -X POST host/api/review-requests/1/statuss/ -d "context=Travis%20CI&label=Failed&progress=F&url=continuous-integration/travis&url_label=Build%20log" -A application/json + + PUT request (need authorization info):
+ curl -X PUT host/api/review-requests/1/statuss/1/ -d "context=Unit%20Testing&label=Success&progress=S" -A application/json