Add a "Last Updated By" column to ReviewBoard dashboard
Review Request #11524 — Created March 14, 2021 and updated
Currently, the last updated column only shows the timestamp
of last activity that has occurred. It is desireable to show
the user who is responsible for the last activity as well.
Therefore, we need to add another column "Last Updated By" to
the dashboard.
Manual testing:
1. On the UI, activate the new Last Updated By column by selecting it.
2. It should show the user (linkable to the user's profile) that is
responsible for the last update.
Tested on Safari, Chrome, and Firefox.Automated unit testing:
1. Run ./tests/runtests.py reviewboard.datagrids.tests.
Summary | ID |
---|---|
255db9e04b1a4928e07e6a3ead76f8c82335f85b | |
b205836025ceaa6c0edbb9b2ed8cab2c7543968f | |
68529a8640bbaa2834f8a1a14d8d71104a6ca934 | |
8d6e529f89548a65a743e88b31ef35457204bf81 | |
d8b52f1fbfa369a6d746aac5602f1f5b86d67175 | |
c9db8baabca7b96a0104deba3f039798225d2335 | |
0266cd3020c961dda57562506c34a0eb21017086 | |
1b6a908d77f50b5187a88cbf4ed9bfd95d73315e | |
4e8b1bee638b480283a3e914d9db44a967809691 | |
bf1ba709d8cf9b4592948efccdac617ae7bc2958 | |
445fe015a763bd92edce046b460b2c6ed7623b31 |
Description | From | Last Updated |
---|---|---|
I'm a bit confused what the difference is between Review, Review Request and Review Request Draft. Would you mind clarifying … |
|
|
E501 line too long (88 > 79 characters) |
![]() |
|
W293 blank line contains whitespace |
![]() |
|
E501 line too long (80 > 79 characters) |
![]() |
|
F841 local variable 'review' is assigned to but never used |
![]() |
|
W293 blank line contains whitespace |
![]() |
|
E501 line too long (81 > 79 characters) |
![]() |
|
F841 local variable 'diffset' is assigned to but never used |
![]() |
|
F841 local variable 'review' is assigned to but never used |
![]() |
|
F841 local variable 'diffset' is assigned to but never used |
![]() |
|
Docstrings need to conform to our documentation guidelines. Look for other functions like get_user and make sure you're following that … |
|
|
All variables in our Python code use snake_case pattern, rather than camelCase. |
|
|
This is being set and then overridden below. Doesn't seem like this needs to be set here, because of that. |
|
|
Something important to note here is that we can't necessarily assume that the review request's owner is the user that … |
|
|
This can cause problems down the road if we introduce more types of objects and one of them isn't owner. … |
|
|
Imports should always be in alphabetical order. |
|
|
The last parameter of a function call shouldn't have a trailing comma. The ) should be on the same line … |
|
|
This doesn't seem to be related to your change, so it should be reverted. |
|
|
This will also need to be in alphabetical order. |
|
|
This from .. import .. also needs to be in alphabetical order within the list of all imports. |
|
|
This is only used if the column is testing with a LocalSite. None of these are, from what I can … |
|
|
The trailing """ must be on its own line when it's a multi-line docstring. Also, this docstring doesn't say what … |
|
|
Several of our test objects use the same usernames, which can create false-positives in username-based tests. Your code should explicitly … |
|
|
We're not testing get_last_activity_info(). This could would be better served testing get_user() on the column. |
|
|
For each of these, these usernames very well may be the correct ones, but there's nothing currently indicating that we … |
|
|
These are probably wrapping prematurely. Same with the other unit tests. |
|
|
W291 trailing whitespace |
![]() |
|
W291 trailing whitespace |
![]() |
|
F401 'reviewboard.diffviewer.models.DiffSet' imported but unused |
![]() |
|
W291 trailing whitespace |
![]() |
|
W291 trailing whitespace |
![]() |
|
W291 trailing whitespace |
![]() |
Change Summary:
Fixed the get_user method in LastUpdatedByColumn that grabs the user that is responsible for the last update.
Testing Done: |
|
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
|||||||||||||||||||||||||
Groups: |
|
|||||||||||||||||||||||||
Diff: |
Revision 2 (+128 -46) |
Checks run (2 succeeded)
-
-
reviewboard/datagrids/columns.py (Diff revision 2) I'm a bit confused what the difference is between Review, Review Request and Review Request Draft. Would you mind clarifying this please?
Summary: |
|
|||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||
Commits: |
|
|||||||||||||||||||||||||||||
Diff: |
Revision 3 (+236 -50) |
Checks run (1 failed, 1 succeeded)
flake8
-
-
-
-
reviewboard/datagrids/tests.py (Diff revision 3) F841 local variable 'review' is assigned to but never used
-
-
-
reviewboard/datagrids/tests.py (Diff revision 3) F841 local variable 'diffset' is assigned to but never used
Commits: |
|
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+247 -55) |
Checks run (1 failed, 1 succeeded)
flake8
-
reviewboard/datagrids/tests.py (Diff revision 4) F841 local variable 'review' is assigned to but never used
-
reviewboard/datagrids/tests.py (Diff revision 4) F841 local variable 'diffset' is assigned to but never used
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
|||||||||||||||||||||||||||||||||||||
Diff: |
Revision 5 (+249 -57) |
Checks run (2 succeeded)
-
-
reviewboard/datagrids/columns.py (Diff revision 5) Docstrings need to conform to our documentation guidelines. Look for other functions like
get_user
and make sure you're following that pattern. This needs to haveArgs
andReturns
sections.A function's summary should succintly describe its purpose. The description is used for additional details. Keep this high-level: The fact that it's using
get_last_activity_info()
is an implementation detail that' best left to the code. The reader doesn't care. They care about hte purpose of the function. -
reviewboard/datagrids/columns.py (Diff revision 5) All variables in our Python code use
snake_case
pattern, rather thancamelCase
. -
reviewboard/datagrids/columns.py (Diff revision 5) This is being set and then overridden below. Doesn't seem like this needs to be set here, because of that.
-
reviewboard/datagrids/columns.py (Diff revision 5) Something important to note here is that we can't necessarily assume that the review request's
owner
is the user that performed the update. For review requests, thechangedesc
object is also returned. This is the "Review request changed" box. An administrator, or special users, can make changes on a review request on another user's behalf, and the user that did that is inchangedesc.user
. -
reviewboard/datagrids/columns.py (Diff revision 5) This can cause problems down the road if we introduce more types of objects and one of them isn't
owner
. Each check should be very explicit about what object we're working with, and anyelse:
should probably raise anAssertionError
if the user isn't an expected type (with a useful message). -
-
reviewboard/datagrids/grids.py (Diff revision 5) The last parameter of a function call shouldn't have a trailing comma. The
)
should be on the same line as the last parameter, as well. Note the other columns in this class. -
reviewboard/datagrids/grids.py (Diff revision 5) This doesn't seem to be related to your change, so it should be reverted.
-
-
reviewboard/datagrids/tests.py (Diff revision 5) This
from .. import ..
also needs to be in alphabetical order within the list of all imports. -
reviewboard/datagrids/tests.py (Diff revision 5) This is only used if the column is testing with a
LocalSite
. None of these are, from what I can see. -
reviewboard/datagrids/tests.py (Diff revision 5) The trailing
"""
must be on its own line when it's a multi-line docstring.Also, this docstring doesn't say what is being tested. This should explicitly list the column name. Look at other unit tests in this file.
-
reviewboard/datagrids/tests.py (Diff revision 5) Several of our test objects use the same usernames, which can create false-positives in username-based tests. Your code should explicitly create a user for each test that we want to check for, make sure the right object is being created with that user, and then use that user for any checks.
-
reviewboard/datagrids/tests.py (Diff revision 5) We're not testing
get_last_activity_info()
. This could would be better served testingget_user()
on the column. -
reviewboard/datagrids/tests.py (Diff revision 5) For each of these, these usernames very well may be the correct ones, but there's nothing currently indicating that we know for sure. The code isn't tying these to the objects the usernames are coming from. We should explicitly use those.
-
reviewboard/datagrids/tests.py (Diff revision 5) These are probably wrapping prematurely.
Same with the other unit tests.
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
|||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 6 (+337 -107) |
Checks run (1 failed, 1 succeeded)
flake8
-
-
-
reviewboard/datagrids/tests.py (Diff revision 6) F401 'reviewboard.diffviewer.models.DiffSet' imported but unused
-
-
-
Commits: |
|
|||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 7 (+341 -113) |