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 … |
mderose | |
E501 line too long (88 > 79 characters) |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
F841 local variable 'review' is assigned to but never used |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
F841 local variable 'diffset' is assigned to but never used |
reviewbot | |
F841 local variable 'review' is assigned to but never used |
reviewbot | |
F841 local variable 'diffset' is assigned to but never used |
reviewbot | |
Docstrings need to conform to our documentation guidelines. Look for other functions like get_user and make sure you're following that … |
chipx86 | |
All variables in our Python code use snake_case pattern, rather than camelCase. |
chipx86 | |
This is being set and then overridden below. Doesn't seem like this needs to be set here, because of that. |
chipx86 | |
Something important to note here is that we can't necessarily assume that the review request's owner is the user that … |
chipx86 | |
This can cause problems down the road if we introduce more types of objects and one of them isn't owner. … |
chipx86 | |
Imports should always be in alphabetical order. |
chipx86 | |
The last parameter of a function call shouldn't have a trailing comma. The ) should be on the same line … |
chipx86 | |
This doesn't seem to be related to your change, so it should be reverted. |
chipx86 | |
This will also need to be in alphabetical order. |
chipx86 | |
This from .. import .. also needs to be in alphabetical order within the list of all imports. |
chipx86 | |
This is only used if the column is testing with a LocalSite. None of these are, from what I can … |
chipx86 | |
The trailing """ must be on its own line when it's a multi-line docstring. Also, this docstring doesn't say what … |
chipx86 | |
Several of our test objects use the same usernames, which can create false-positives in username-based tests. Your code should explicitly … |
chipx86 | |
We're not testing get_last_activity_info(). This could would be better served testing get_user() on the column. |
chipx86 | |
For each of these, these usernames very well may be the correct ones, but there's nothing currently indicating that we … |
chipx86 | |
These are probably wrapping prematurely. Same with the other unit tests. |
chipx86 | |
W291 trailing whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
F401 'reviewboard.diffviewer.models.DiffSet' imported but unused |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot |
- Change Summary:
-
Fixed the get_user method in LastUpdatedByColumn that grabs the user that is responsible for the last update.
- Testing Done:
-
+ - On the UI, activate the new Last Updated By column by selecting it.
+ - It should show the user (linkable to the user's profile) that is
responsible for the last update.
- Commits:
-
Summary ID e60cd70e746869ff2df39e3a61702b515cf203c2 261c36450af4b30741d28e082be47c4c15ca0a98 04668ba55ef7e0adf33dbcaaa8bfdc1c01ed2b13 623e6b8ce884bfa10a5377e515f59f867bc07829 5b1b960f398a77975c526d35356b6737b30282fd e60cd70e746869ff2df39e3a61702b515cf203c2 261c36450af4b30741d28e082be47c4c15ca0a98 04668ba55ef7e0adf33dbcaaa8bfdc1c01ed2b13 623e6b8ce884bfa10a5377e515f59f867bc07829 5b1b960f398a77975c526d35356b6737b30282fd 79ea1a797f559c2e4cf501709ca9c884f56c8522 - Groups:
-
- Diff:
Revision 2 (+128 -46)
Checks run (2 succeeded)
flake8 passed.JSHint passed.
- Summary:
-
[WIP] Add a "Last Updated By" column to ReviewBoard dashboardAdd a "Last Updated By" column to ReviewBoard dashboard
- Testing Done:
-
~ - On the UI, activate the new Last Updated By column by selecting it.
~ - It should show the user (linkable to the user's profile) that is
responsible for the last update.
~ 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. + + Automated unit testing:
+ 1. Run ./tests/runtests.py reviewboard.datagrids.tests 115 118 119. - Commits:
-
Summary ID e60cd70e746869ff2df39e3a61702b515cf203c2 261c36450af4b30741d28e082be47c4c15ca0a98 04668ba55ef7e0adf33dbcaaa8bfdc1c01ed2b13 623e6b8ce884bfa10a5377e515f59f867bc07829 5b1b960f398a77975c526d35356b6737b30282fd 79ea1a797f559c2e4cf501709ca9c884f56c8522 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086
Checks run (1 failed, 1 succeeded)
flake8
- Commits:
-
Summary ID 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 1b6a908d77f50b5187a88cbf4ed9bfd95d73315e
- Testing Done:
-
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. ~ responsible for the last update. + Tested on Safari, Chrome, and Firefox. Automated unit testing:
1. Run ./tests/runtests.py reviewboard.datagrids.tests 115 118 119. - Commits:
-
Summary ID 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 1b6a908d77f50b5187a88cbf4ed9bfd95d73315e 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 1b6a908d77f50b5187a88cbf4ed9bfd95d73315e 4e8b1bee638b480283a3e914d9db44a967809691
Checks run (2 succeeded)
-
-
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. -
-
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 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
. -
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). -
-
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. -
-
-
-
This is only used if the column is testing with a
LocalSite
. None of these are, from what I can see. -
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.
-
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.
-
We're not testing
get_last_activity_info()
. This could would be better served testingget_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 know for sure. The code isn't tying these to the objects the usernames are coming from. We should explicitly use those.
-
- Testing Done:
-
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 115 118 119. ~ 1. Run ./tests/runtests.py reviewboard.datagrids.tests. - Commits:
-
Summary ID 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 1b6a908d77f50b5187a88cbf4ed9bfd95d73315e 4e8b1bee638b480283a3e914d9db44a967809691 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 1b6a908d77f50b5187a88cbf4ed9bfd95d73315e 4e8b1bee638b480283a3e914d9db44a967809691 bf1ba709d8cf9b4592948efccdac617ae7bc2958
- Commits:
-
Summary ID 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 1b6a908d77f50b5187a88cbf4ed9bfd95d73315e 4e8b1bee638b480283a3e914d9db44a967809691 bf1ba709d8cf9b4592948efccdac617ae7bc2958 255db9e04b1a4928e07e6a3ead76f8c82335f85b b205836025ceaa6c0edbb9b2ed8cab2c7543968f 68529a8640bbaa2834f8a1a14d8d71104a6ca934 8d6e529f89548a65a743e88b31ef35457204bf81 d8b52f1fbfa369a6d746aac5602f1f5b86d67175 c9db8baabca7b96a0104deba3f039798225d2335 0266cd3020c961dda57562506c34a0eb21017086 1b6a908d77f50b5187a88cbf4ed9bfd95d73315e 4e8b1bee638b480283a3e914d9db44a967809691 bf1ba709d8cf9b4592948efccdac617ae7bc2958 445fe015a763bd92edce046b460b2c6ed7623b31