Add Stage field to a review request
Review Request #8495 — Created Oct. 26, 2016 and discarded
This feature will add a stage field to a review request that will provide some
context as to where a review request is in its development/review lifecycle.
This field provides visual information that will aid decision making on a
review request like whether to perform an automatic code review or wait for
the author to make changes.This feature adds built-in stages which are
- ApprovedStage
- CompletedStage
- DiscardedStage
- PendingChangesStage
- PendingReviewsStage
- UnpublishedStage
- WIPStage
All tests pass
Description | From | Last Updated |
---|---|---|
This is looking pretty solid. You will probably want to move on to writing unit tests. |
brennie | |
Missing trailing commma. |
brennie | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (89 > 79 characters) |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Single quotes. |
brennie | |
Use the class itself, UnpublishedStage, instead of the instance. |
brennie | |
This should be formatted like a docstring, i.e. #: Single line summary #: #: Multi-line description should_review = False |
brennie | |
Move to builtin_stages.py |
brennie | |
MOve this to __init__.py |
brennie | |
This is unnecessary becuase of get_defaults |
brennie | |
Move to builtin_stages.py |
brennie | |
Move to builtin_stages.py |
brennie | |
Move to builtin_stages.py |
brennie | |
Move to builtin_stages.py |
brennie | |
Move to builtin_stages.py |
brennie | |
Move to builtin_stages.py |
brennie | |
Two blank lines between these. Missing a file docstring. Missing from __future__ import unicode literals. |
brennie | |
Not sure why this is here. |
brennie | |
Misisng file-level docstring. Missing from __future__ import unicode literals. |
brennie | |
Docstring. |
brennie | |
Dont need spacing between these. Same below. |
brennie | |
Docstring for all these. |
brennie | |
Misisng file-level docstring. Missing from __future__ import unicode literals. |
brennie | |
Docstring. |
brennie | |
Misisng file-level docstring. Missing from __future__ import unicode literals. |
brennie | |
Col: 38 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (87 > 79 characters) |
reviewbot | |
Args/kwargs missing. |
brennie | |
You also need a hook to add stages from extensions. See https://reviews.reviewboard.org/r/8530/ and https://reviews.reviewboard.org/r/8531/. |
brennie | |
The first import should be from __future__ import unicode_literals. |
brennie | |
Blank line between these. |
brennie | |
"""The global stage registry.""" |
brennie | |
stages Also, could you give a quick doc-comment before this (like #: ...). |
brennie | |
This needs to explain the contents of the file. |
brennie | |
Please elaborate on these docstrings, such as when they will be applied to review requests. |
brennie | |
This should be localized: from django.utils.translation import ugettext_lazy as _ # ... class UnpublishedStage(BaseReviewRequestStage): name = _('Unpublished') # ... Same … |
brennie | |
Wrong docstring. |
brennie | |
Please use proper capitilization and punctuation. |
brennie | |
Docstring. |
brennie | |
You're missing reply_published. Also, how about: ```python signals = ( (review_request_published, self._on_review_request_published), (review_request_closed, self._on_review_request_closed), (review_request_reopened, self._on_review_request_reopened), (review_published, self._on_review_published), (reply_published, self._on_reply_published), … |
brennie | |
_on_review_request_published. |
brennie | |
review_request_published will be triggered whenever the review request is published, so this may happen more than once. The first publish … |
brennie | |
Col: 38 E128 continuation line under-indented for visual indent |
reviewbot | |
This needs to explain the contents of the file. |
brennie | |
Can you explain what this is. |
brennie | |
Can you add a get_stage(stage_id) method? |
brennie | |
Missing docstring. |
brennie | |
You can just return a list here. |
brennie | |
This needs to explain the contents of the file. |
brennie | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 45 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 29 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
If review.request.stage returns None, this will raise an AttributeError. |
brennie | |
Col: 80 E501 line too long (95 > 79 characters) |
reviewbot | |
missing **kwargs in Args: |
brennie | |
Missing file level docstring. |
brennie | |
Docstring. |
brennie | |
Missing docstring. |
brennie | |
Should this perhaps compute the stage of the review request if self._stage is None? |
brennie | |
These all need translation. |
brennie | |
missing a space |
brennie | |
"completed" |
brennie | |
Docstrings here and elsewhere. |
brennie | |
No blank line |
brennie | |
Should we perhaps do this before calling self._calculate_review_request_stage? If a hook returns a stage, we throw the value computed by … |
brennie | |
('_stage',) Using a tuple requires less memory allocation. |
brennie | |
Missing period. If this is a generator this should be "Yield the registered stage classes." If this is not it … |
brennie | |
You can just return this instead of yielding. |
brennie | |
Use the full import path. |
brennie | |
Blank line between these. |
brennie | |
django.utils.safestring.SafeText |
brennie | |
No blank line. |
brennie | |
This is indented too far. And also incorrect. These are just extra arguments for the signal handler. |
brennie | |
No blank line. |
brennie | |
Two blank lines. |
brennie | |
Blank line. |
brennie | |
This should be reviewboard.reviews.stages.stages.BaseReviewRequestStage. |
brennie | |
Docstrings for all these. |
brennie | |
This is going to need many unit tests. |
brennie | |
No blank line. |
brennie | |
if not new_stage |
brennie | |
Should be :py:class:`.... Also the :py:class bit needs to be on the same line as the class bit. It is … |
brennie | |
No blank line. |
brennie | |
"for review requests." |
brennie | |
Missing Returns. |
brennie | |
Just return the tuple. |
brennie | |
Can you rename this to base.py? That's usually where we put base classes. |
brennie | |
Col: 27 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (117 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (116 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (121 > 79 characters) |
reviewbot | |
Col: 1 E303 too many blank lines (3) |
reviewbot | |
Missing a period. Docstrings should be complete sentences. |
brennie | |
Should end in a period. |
david | |
Description should go on the next line. |
david | |
Should be imperative mood ("Return" instead of "Returns"), and needs a "Returns" section. |
david | |
Needs a period. |
david | |
You don't need the u prefix on the string literals because we import unicode_literals at the top. |
david | |
Can we alphabetize these? |
david | |
Should be the imperative mood ("Return ..." instead of "Returns ...") |
david | |
In "Returns", the description doesn't need to be indented relative to the type. |
david | |
Should be capitalized and imperative mood ("Set" instead of "sets") |
david | |
In "Returns", the description doesn't need to be indented relative to the type. |
david | |
Can we use the symbols instead of the string literals? In this case, instead of 'S', use ReviewRequest.SUBMITTED. |
david | |
Same here. |
david | |
Can review_request.status be something other than S, D and P? |
ST stensby | |
Same here. |
david | |
Add a period. |
david | |
Do you need this many comments for the variables? Most of them seem very self-explanatory. |
ST stensby | |
This description is a little circular. How about "The Review Request has not yet been published"? Also, do we want … |
david | |
"Waiting on a review" is a little confusing. Maybe "The author is waiting for reviews"? |
david | |
Maybe "Waiting for the author to make requested changes"? |
david | |
Description should go on the next line. |
david | |
Description should go on the next line. |
david | |
Description should go on the next line. |
david | |
This sentence doesn't really make sense. Maybe "Whether the review request is being published for the first time"? |
david | |
This sentence doesn't really make sense. Maybe "Whether the review request is being published for the first time"? |
david | |
In "Returns" sections, you don't need to indent the description relative to the type. |
david | |
Instead of using the character to continue the statement, please wrap the whole conditional in parentheses. We can also use … |
david | |
Alphabetize? |
david | |
This should be written in the imperative mood ("Return the registered...") and include a "Returns" section. |
david | |
Same here. Also needs to end in a period. |
david | |
Needs a period. |
david | |
Alphabetize? |
david | |
In test docstrings, we don't add the normal period at the end because the test suite adds "...". Here and … |
david | |
Should be two blank lines here. |
david | |
You don't need a blank line after docstrings for methods (only the docstring for classes). |
david | |
Mind adding another blank line here? |
david | |
It looks like there's some overlap with ReviewRequestStageController.calculate_review_request_stage? |
david | |
We should move this to BaseReviewRequestDetails too. |
david | |
Add a blank line here. |
david | |
"review request" should be sentence case here. Let's also add a period to the end of all of these. |
david | |
Let's make all of these consistent in their language: "The review request ...". Here and below. |
david | |
Dedent these 4 spaces. |
david | |
Here too. |
david | |
And here, and below. |
david | |
review_request.stage should be vertically aligned with first_publish. |
david | |
These can be one statement (just return the tuple) |
david | |
Missing docs on Args. |
chipx86 | |
No indentation here for the description. |
chipx86 | |
This should check for a value more generally, rather than None, since it can be ''. if review_request.stage: ... |
chipx86 | |
Let's also include this in the list of default columns. |
chipx86 | |
Should be reviewboard.extensions.base.Extension. |
chipx86 | |
There can't be a blank line here. Also, it must be :py:class:, not py:class: |
chipx86 | |
Docstrings are only valuable when they convey something the user doesn't already know. This just says what __init__.py is, generally. … |
chipx86 | |
I would expect this to live in reviewboard/reviews/stages/controller.py, with a setter and getter (like we have for other singleton instances). |
chipx86 | |
Needs a trailing comma. |
chipx86 | |
This should remain only in ReviewRequest. |
chipx86 | |
This should remain only in ReviewRequest. |
chipx86 | |
This should be a CharField, not a TextField. The latter is meant for larger pieces of text, and won't index … |
chipx86 | |
Args is indented too far. |
chipx86 | |
`:py:class: |
chipx86 | |
This function should go away. All computation is going to happen in the controller. ReviewRequest.__init__ will check if the stage … |
chipx86 | |
:py:class: |
chipx86 | |
This file is more than just the registry. It's the whole module for working with stages. This specific file just … |
chipx86 | |
Read this as if you weren't aware of the stages work, and then see if you can think of some … |
chipx86 | |
"built-in" |
chipx86 | |
No point in setting the values if they aren't changing from the base class. Can you go through each of … |
chipx86 | |
This should include some information on how those updates are applied, and how consumers might override computation. |
chipx86 | |
We usually say something like "Handler for review request published signals." |
chipx86 | |
This is the wrong module path. Same below. |
chipx86 | |
You can combine these into one call: self._update_review_request_stage( review_request, first_publish=changedesc is None) |
chipx86 | |
Should be (bool, optional) |
chipx86 | |
Let's use keyword arguments in the call. Helps for future expansion. |
chipx86 | |
Blank line between these. |
chipx86 | |
:py:class: |
chipx86 | |
We don't use title case. This should better summarize what this class is. "A registry for tracking available stages for … |
chipx86 | |
Missing period. This should also flesh out the responsibilities of this class a bit more. Remember that, for every docstring, … |
chipx86 | |
The docstring isn't correct. This isn't returning registered stages. It's returning the default stages that the registry knows about. |
chipx86 | |
A couple things here: The description is redundant. That's implied by the type. Don't just talk return values and data … |
chipx86 | |
:py:class: |
chipx86 | |
"... registered to the provided stage ID." |
chipx86 | |
As above, this should be talking about what's truly being returned beyond just a data type. |
chipx86 | |
A tests.py file should contain unit tests. Given the simplicity of this dummy object, I don't think we should bother … |
chipx86 | |
Test docstrings should mention the classes/attribute/method/etc. being worked with. However, these tests are all testing different classes, which is often … |
chipx86 | |
I wouldn't expect this call to be necessary? That should be calculated on access. |
chipx86 | |
Col: 1 W391 blank line at end of file |
reviewbot | |
'DiscardedStage' imported but unused |
reviewbot | |
'CompletedStage' imported but unused |
reviewbot | |
'PendingReviewsStage' imported but unused |
reviewbot | |
'UnpublishedStage' imported but unused |
reviewbot | |
'WIPStage' imported but unused |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
'DiscardedStage' imported but unused |
reviewbot | |
'CompletedStage' imported but unused |
reviewbot | |
'PendingReviewsStage' imported but unused |
reviewbot | |
'UnpublishedStage' imported but unused |
reviewbot | |
'WIPStage' imported but unused |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
This should actually be None initially. |
brennie | |
You need to do: from reviewboard.reviews.stages import stage_controller # ... stage_controller.calculate_review_request_stage(self.get_review_request()) |
brennie | |
This shouldn't be here. |
brennie | |
redefinition of unused 'TestCase' from line 55 |
reviewbot |
- Change Summary:
-
fixing stage folder issues
- Diff:
-
Revision 2 (+167)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/stages/registry.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/stages/registry.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py
- Change Summary:
-
new controller chanegs and integration
- Commit:
-
cf11b3bbdb271ab902899766d1729a5ac4395687627e2b3b62ab07ae567bfd2cbcc92ffc31bbcd57
- Diff:
-
Revision 3 (+250)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/stages/registry.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/controller.py reviewboard/reviews/__init__.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py Ignored Files: reviewboard/templates/reviews/review_request_box.html Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/stages/registry.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/controller.py reviewboard/reviews/__init__.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py Ignored Files: reviewboard/templates/reviews/review_request_box.html
-
-
-
- Change Summary:
-
added UI option for stages and prilminary hook functionality
- Commit:
-
627e2b3b62ab07ae567bfd2cbcc92ffc31bbcd57b9b60eff6072801c4b24d6ef50733a4914554da5
- Diff:
-
Revision 4 (+313)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py
-
-
-
-
You also need a hook to add stages from extensions. See https://reviews.reviewboard.org/r/8530/ and https://reviews.reviewboard.org/r/8531/.
-
-
-
-
-
-
-
This should be localized:
from django.utils.translation import ugettext_lazy as _ # ... class UnpublishedStage(BaseReviewRequestStage): name = _('Unpublished') # ...
Same for all stages.
-
-
-
-
You're missing reply_published. Also, how about:
```python
signals = (
(review_request_published, self._on_review_request_published),
(review_request_closed, self._on_review_request_closed),
(review_request_reopened, self._on_review_request_reopened),
(review_published, self._on_review_published),
(reply_published, self._on_reply_published),
)for signal, handler in signals:
signal.connect(handler) -
-
review_request_published
will be triggered whenever the review request is published, so this may happen more than once. The first publish occurs whenchangedesc is None
, however. -
-
-
-
-
-
- Change Summary:
-
adding stage hooks
- Commit:
-
b9b60eff6072801c4b24d6ef50733a4914554da57fec0972c9a4c1ce3cfdf087f752f2bd2951fb9a
- Diff:
-
Revision 5 (+403)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py
-
-
-
-
- Change Summary:
-
issue fixes and adding proper hook parent class
- Commit:
-
7fec0972c9a4c1ce3cfdf087f752f2bd2951fb9ad6f3d3c4951c1b7d81a1b538f4e0174be6d2d1d5
- Diff:
-
Revision 6 (+403 -1)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Should we perhaps do this before calling
self._calculate_review_request_stage
? If a hook returns a stage, we throw the value computed by_calculate_review_request_stage
out anyway. -
-
Missing period.
If this is a generator this should be "Yield the registered stage classes."
If this is not it should be "Return the registered stage classes."
Method docstrings should be in the imperitive mood, i.e., they instruct you as to what they are doing. They should never begin with "this".
-
- Change Summary:
-
fixing issues and working on the stage implementation
- Commit:
-
d6f3d3c4951c1b7d81a1b538f4e0174be6d2d1d5f0db1821be80e2acc7c7560639eb799a8db96490
- Diff:
-
Revision 7 (+498 -3)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/stage.py reviewboard/reviews/models/base_review_request_details.py
- Change Summary:
-
Adding unit test for controller and hooks, fixing review issues
- Testing Done:
-
~ None
~ All tests pass
- Commit:
-
f0db1821be80e2acc7c7560639eb799a8db96490714b6d9c3a292bd9007e849671dc12a45bcb7fa5
- Diff:
-
Revision 8 (+692 -3)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py
-
-
-
-
-
- Change Summary:
-
fixing bot issues
- Commit:
-
714b6d9c3a292bd9007e849671dc12a45bcb7fa515fb39c6f7109375bcf7e97ce135cd4a5af81ba0
- Diff:
-
Revision 9 (+692 -3)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py
-
-
-
-
-
-
-
-
-
-
-
-
Can we use the symbols instead of the string literals? In this case, instead of
'S'
, useReviewRequest.SUBMITTED
. -
-
-
-
This description is a little circular. How about "The Review Request has not yet been published"?
Also, do we want to include periods in these strings?
-
-
-
-
-
-
This sentence doesn't really make sense. Maybe "Whether the review request is being published for the first time"?
-
This sentence doesn't really make sense. Maybe "Whether the review request is being published for the first time"?
-
-
Instead of using the character to continue the statement, please wrap the whole conditional in parentheses. We can also use the
in
operator to combine the second two clauses:if (first_publish and review_request.stage in (None, UnpublishedStage)):
-
-
This should be written in the imperative mood ("Return the registered...") and include a "Returns" section.
-
-
-
-
In test docstrings, we don't add the normal period at the end because the test suite adds "...". Here and all the other methods in here.
- Change Summary:
-
fixing review changes mostly doc string corrections
- Commit:
-
15fb39c6f7109375bcf7e97ce135cd4a5af81ba0a85a57683f91c2ff8ca30fba507b6b0847690f0c
- Diff:
-
Revision 10 (+718 -10)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py
- Change Summary:
-
updating description
- Description:
-
~ This feature will add a stage field to a review request that will
~ provide some context as to where a review request is in its ~ development/review lifecycle. ~ This feature will add a stage field to a review request that will provide some
~ context as to where a review request is in its development/review lifecycle. ~ This field provides visual information that will aid decision making on a + review request like whether to perform an automatic code review or wait for + the author to make changes. + + This feature adds built-in stages which are
+ - ApprovedStage + - CompletedStage + - DiscardedStage + - PendingChangesStage + - PendingReviewsStage + - UnpublishedStage + - WIPStage
- Change Summary:
-
fixing imports to be alphabetical
- Commit:
-
a85a57683f91c2ff8ca30fba507b6b0847690f0cf88371f498174a701d55f0e8ae8cce9ef954430b
- Diff:
-
Revision 11 (+718 -10)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py
- Change Summary:
-
fixing review issues on doc strings and a few other minor things
- Commit:
-
f88371f498174a701d55f0e8ae8cce9ef954430bb2309fc9d2a160ae16252ba0514eec15332f7728
- Diff:
-
Revision 12 (+723 -15)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/stages/tests.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py
-
-
-
-
This should check for a value more generally, rather than
None
, since it can be''
.if review_request.stage: ...
-
-
-
-
Docstrings are only valuable when they convey something the user doesn't already know. This just says what
__init__.py
is, generally. Instead, this should be explaining the purpose of this file. -
I would expect this to live in
reviewboard/reviews/stages/controller.py
, with a setter and getter (like we have for other singleton instances). -
-
-
-
This should be a
CharField
, not aTextField
. The latter is meant for larger pieces of text, and won't index as well.We also want to move this to
ReviewRequest
and toReviewRequestDraft
. The difference between the two is thatReviewRequest
's would have a default value for the Unpublished stage. This will apply to all brand new review requests (not existing ones from a legacy database). All review requests start out as Unpublished.ReviewRequestDraft
would not have a default value. The default would be set when the draft is created, based on the value on the review request. It's a copy, just like how we copy the summary, description, etc.The fields also need:
null=True
(so that we can have default, null values for existing database entries)max_length=64
(to leave room for vendor prefixes for third-party extensions)
-
-
-
This function should go away. All computation is going to happen in the controller.
ReviewRequest.__init__
will check if the stage is empty and, if so, call out to the controller to set a value.ReviewRequestDraft.__init__
will do the same check, but set its own value from the review request. -
-
This file is more than just the registry. It's the whole module for working with stages. This specific file just happens to contain the registry.
It'd be nice to have this go into a little more detail on what stages are.
-
Read this as if you weren't aware of the stages work, and then see if you can think of some ways to flesh out the docstring.
-
-
No point in setting the values if they aren't changing from the base class. Can you go through each of these and make sure flags are only set if they differ in value?
-
This should include some information on how those updates are applied, and how consumers might override computation.
-
-
-
You can combine these into one call:
self._update_review_request_stage( review_request, first_publish=changedesc is None)
-
-
-
-
-
We don't use title case. This should better summarize what this class is. "A registry for tracking available stages for a review request."
-
Missing period.
This should also flesh out the responsibilities of this class a bit more. Remember that, for every docstring, you should be trying to read this from the point of view of someone who has no idea what stages are, and the docstrings should educate on that.
-
The docstring isn't correct. This isn't returning registered stages. It's returning the default stages that the registry knows about.
-
A couple things here:
- The description is redundant. That's implied by the type. Don't just talk return values and data types. Talk about purpose. What is actually being returned?
- The data types are also wrong here. This is returning a tuple of default stages.
-
-
-
-
A
tests.py
file should contain unit tests. Given the simplicity of this dummy object, I don't think we should bother keeping a One True Dummy Object. Instead, have each test suite define their own.The reason for this is that, over time, complexity grows, and tests need to test more variations. You can run the risk of someone changing this object and accidentally impacting other tests.
If you have a One True Dummy Object, you're going to eventually need 50 True Dummy Objects, which will all end up shoved into the same place, and it just creates a maintenance nightmare.
So let's nuke this file and instead define a dummy stage in the tests/files that need them.
-
Test docstrings should mention the classes/attribute/method/etc. being worked with. However, these tests are all testing different classes, which is often a red flag.
I think overall, this test suite is trying to do too many things. From the standpoint of your project, this all feels like "stage unit tests," but from the standpoint of the codebase, you're really testing different areas of responsibility.
What I'd suggest is:
- Having any tests involving default review request stage state living in
test_review_request.py
. - Any tests involving review request draft state (copying initial values from the review request) should live in
test_review_request_draft.py
. - Tests involving the controller specifically should live in
test_review_request_stage_controller.py
.
- Having any tests involving default review request stage state living in
-
- Change Summary:
-
modifying implementation so that stage controller handles all computational logic
- Branch:
-
masterrelease-3.0.x
- Commit:
-
b2309fc9d2a160ae16252ba0514eec15332f7728172456c1321b67ad2df2eef9419d6dd9e4a16d80
- Diff:
-
Revision 13 (+895 -1)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/reviews/tests/test_stages.py reviewboard/extensions/tests.py
-
-
-
-
-
-
-
- Change Summary:
-
deleting old test stages suite
- Commit:
-
172456c1321b67ad2df2eef9419d6dd9e4a16d80f0e7f2b194e1be0fab649571510fe23eb81f6243
- Diff:
-
Revision 14 (+775 -1)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/extensions/tests.py
-
-
-
-
-
-
-
- Change Summary:
-
fising bot issues
- Commit:
-
f0e7f2b194e1be0fab649571510fe23eb81f624355d1ac517a3840532dea7ed0d6e57904b1492bc3
- Diff:
-
Revision 15 (+767 -1)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/extensions/tests.py
- Branch:
-
release-3.0.xmaster
- Commit:
-
55d1ac517a3840532dea7ed0d6e57904b1492bc3394d3093e0bb56d10b55d9c045e7191f844df72b
- Diff:
-
Revision 16 (+764 -1)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/extensions/tests.py
-
-
Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/stages/builtin_stages.py reviewboard/reviews/evolutions/add_stages.py reviewboard/reviews/tests/test_review_request.py reviewboard/reviews/tests/test_review_request_stage_controller.py reviewboard/datagrids/columns.py reviewboard/reviews/__init__.py reviewboard/reviews/evolutions/__init__.py reviewboard/reviews/stages/__init__.py reviewboard/reviews/stages/registry.py reviewboard/extensions/hooks.py reviewboard/reviews/models/review_request_draft.py reviewboard/reviews/stages/controller.py reviewboard/reviews/models/review_request.py reviewboard/reviews/builtin_fields.py reviewboard/datagrids/grids.py reviewboard/reviews/stages/base.py reviewboard/reviews/tests/test_review_request_draft.py reviewboard/reviews/models/base_review_request_details.py reviewboard/extensions/tests.py