Add a "Last Updated By" column to the dashboard.
Review Request #12018 — Created Jan. 28, 2022 and updated
These changes add a new column to the review request dashboard called "Last Updated By" which displays the user that made the last update to each review request. Similar to the existing "Last Updated" column, which shows the time that the last update was made, this column is updated whenever a review request is created, edited, receives a review, is closed, or reopened.
Changes
"Last Updated By" column
- Added a "Last Updated By" column
- Added information about the new column to manual
- Added tests for the new column
ReviewRequest
last activity info functions
ReviewRequest.get_last_activity_info()
also returns the user that last updated the review request- Review requests cache their last activity info (last updated object, changedesc, and user) in
ReviewRequest.extra_data
- Added
ReviewRequest.set_last_activity_info(timestamp, updated_object, changedesc, user)
- Modified existing uses of
ReviewRequest.get_last_activity_info()
to take advantage of the user field - Added and modified existing tests of
ReviewRequest.get_last_activity_info()
Other
- Made the WebAPI
ReviewRequestLastUpdateResource
return the correct user now thatReviewRequest.get_last_activity_info()
includes it
- Added tests for the column itself as well as the new last activity-related functions.
- Ran all backend tests and observed that all passed.
- Performed manual testing of the functionality of the column by creating, editing, reviewing, closing, and reopening review requests and observing how the column changes.
Summary | ID |
---|---|
2886dc701a7582abb5ab763c2d9c1fe7ba1d542b | |
347e5aa8a529bc8b6aaea55d331475446f4d3b63 | |
bba4df2b0cd2f382bb4eb2d88dd5a20cb92f9b22 | |
9eead2a3139e9cec4e82a13c376d33fc558582f7 | |
19d8bb48e3e7a2ae0536196102556e00918acf96 | |
f568b695db1d1f7372b8dc53e5eee94aca606785 | |
3a44a50bec97041c994a6b7b342998c9c6f942f2 | |
410e1b643422b85781aa59d6a59f005b1c898c71 | |
b076ce9a7ead039ffb03c6e1f27b6775a31c712d | |
9dfd7179ef9462d8463a230e0769f7fa3b4e7dcb | |
caf3389617783d8d0d40393f750381fba7424f8f | |
d1b2f75efb0be1df4e8ba081ed3b5616be574067 | |
c3bd1a09f5a1ac7359cf7f89628067d86cd74a70 | |
bb22a4b741f7ff917b1c4b1dce19afca681c5e95 | |
2d5599330ffb81e6e5c02fc28c17c91ff6e88487 | |
cdb0cfc28c3f678a77d1f779daa05da483a6915c | |
3120d9fe3af41f0467404c49716457599d42ac3b | |
e606ba6247e22f74d4d40b1e28cc8d34de4549e8 |
Description | From | Last Updated |
---|---|---|
E501 line too long (94 > 79 characters) |
reviewbot | |
F401 'reviewboard.diffviewer.models.diffset.DiffSet' imported but unused |
reviewbot | |
F401 'reviewboard.reviews.models.review.Review' imported but unused |
reviewbot | |
E501 line too long (82 > 79 characters) |
reviewbot | |
E501 line too long (94 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
We need to document the new sortable arg in here. |
david | |
This needs an "Args" section. |
david | |
This needs an "Args" section. |
david | |
We can use a set comprehension here: ids = { review_request.get_last_activity_user_id() for review_request in object_list } |
david | |
You're using this for every test case, so you can just add a class attribute: class LastUpdatedByColumnTests(BaseColumnTestCase): ... fixtures = … |
david | |
Let's wrap this a little differently. Here and in the other test cases below: review_requests = [ self.create_review_request( summary='Test %d' … |
david | |
If Review is used multiple times, wouldn't it be better to move this import statement to the global import at … |
sheenaNg | |
This should be in the imperative mood ("Set" instead of "Sets") |
david | |
Double backticks aren't necessary around the argument names here. |
david | |
The first line of the docstring should be only one line, and should be in the imperative mood. If you … |
david | |
This should be in the imperative mood ("Return" instead of "Returns"). This docstring also needs a "Returns" section. |
david | |
id is a built-in for python. Can we use a different variable name? |
david | |
Add a blank line between these two |
david | |
We generally avoid the python ternary syntax because it's awkward and confusing. Please just use an if/else here. |
david |
- Commits:
-
Summary ID 7b33e37cb1dee88ab6e52169fa3be925b5050343 a3f74baa4fbd1a4bd1e3d51f95ca92855beaef4e 14eafbbed32f57921e82e8ef7b1edd031c768e72
- Commits:
-
Summary ID a3f74baa4fbd1a4bd1e3d51f95ca92855beaef4e 14eafbbed32f57921e82e8ef7b1edd031c768e72 a3f74baa4fbd1a4bd1e3d51f95ca92855beaef4e 264aece4fe399538a090f733f6e9cc37308a1801
Checks run (2 succeeded)
- Change Summary:
-
Continue work on last_activity_info caching
- Commits:
-
Summary ID a3f74baa4fbd1a4bd1e3d51f95ca92855beaef4e 264aece4fe399538a090f733f6e9cc37308a1801 018e55ee518b108bc942d575ff68b1acdaebb2a4 705951a269741bc11d2dea018f3743311ea6232f 721be5b7d6c6ad3460166e9bf34b2889a4dbc3cb
- Change Summary:
-
Fetch users in Last Updated By column in one query
- Commits:
-
Summary ID 018e55ee518b108bc942d575ff68b1acdaebb2a4 705951a269741bc11d2dea018f3743311ea6232f 721be5b7d6c6ad3460166e9bf34b2889a4dbc3cb 018e55ee518b108bc942d575ff68b1acdaebb2a4 705951a269741bc11d2dea018f3743311ea6232f f0a4ae54f5632724b76515de21cbadf3850aaafe a8a16bd362d07de0b8da9ff23fc4df731372f80a a7b023a845d7abefe3b1be56668e3588e64f8590 1bcdbc1d41a3667d119b58bb4bc75952cbecdecb 1feee9b8fb362481298237575816743d3d429014
Checks run (2 succeeded)
- Commits:
-
Summary ID 018e55ee518b108bc942d575ff68b1acdaebb2a4 705951a269741bc11d2dea018f3743311ea6232f f0a4ae54f5632724b76515de21cbadf3850aaafe a8a16bd362d07de0b8da9ff23fc4df731372f80a a7b023a845d7abefe3b1be56668e3588e64f8590 1bcdbc1d41a3667d119b58bb4bc75952cbecdecb 1feee9b8fb362481298237575816743d3d429014 62015796cb54bef579f56a6a08bb97239883f4d4 84239ac84985eed852ecde343ffc61615a9e8cd7 46f16c0bb32a46cc1e4fa7fddb9d1a7c8e8945fb 0db77dfb14e2e4093e3f9643fc579adacc69ed45 981da047d01ea23faa3cfadca804b7f48e452689 ddf8a9844dc4a2e35d1587b3a475cff2b497dc28 24b6b3f6c9bcbf7a20712a62330a02f6f53d798e
Checks run (2 succeeded)
- Change Summary:
-
Add tests for LastUpdatedByColumn
- Commits:
-
Summary ID 62015796cb54bef579f56a6a08bb97239883f4d4 84239ac84985eed852ecde343ffc61615a9e8cd7 46f16c0bb32a46cc1e4fa7fddb9d1a7c8e8945fb 0db77dfb14e2e4093e3f9643fc579adacc69ed45 981da047d01ea23faa3cfadca804b7f48e452689 ddf8a9844dc4a2e35d1587b3a475cff2b497dc28 24b6b3f6c9bcbf7a20712a62330a02f6f53d798e 71393e085fd0c90ad31dfaac0cc93c90c985041f 7f0126e01d9bee3253d4432c103e2909e33d4aa9 bcdd60cabd6578cee6ff30077e459bc250a65188 58b1f375667443f05860b22b5f2afda7123cbd04 7d9e2b839e96e255740cad767042891a5a4417a9 13fb9d7c4f0f91b1998a2d39496ecc1d0b1c2bb8 c1db2c4bffc2e659dc82a9d89bbf96f4dc7205fe 4cab6083d6dcb64f820f7f5682efe8833f9af438
- Commits:
-
Summary ID 71393e085fd0c90ad31dfaac0cc93c90c985041f 7f0126e01d9bee3253d4432c103e2909e33d4aa9 bcdd60cabd6578cee6ff30077e459bc250a65188 58b1f375667443f05860b22b5f2afda7123cbd04 7d9e2b839e96e255740cad767042891a5a4417a9 13fb9d7c4f0f91b1998a2d39496ecc1d0b1c2bb8 c1db2c4bffc2e659dc82a9d89bbf96f4dc7205fe 4cab6083d6dcb64f820f7f5682efe8833f9af438 71393e085fd0c90ad31dfaac0cc93c90c985041f 7f0126e01d9bee3253d4432c103e2909e33d4aa9 bcdd60cabd6578cee6ff30077e459bc250a65188 58b1f375667443f05860b22b5f2afda7123cbd04 7d9e2b839e96e255740cad767042891a5a4417a9 13fb9d7c4f0f91b1998a2d39496ecc1d0b1c2bb8 c1db2c4bffc2e659dc82a9d89bbf96f4dc7205fe 8f88d26b9b1c4523a447ac51b7cddb649cd1426b e97d9260bcc3a251bd94d65678092dd6d2ed38c2
- Commits:
-
Summary ID 71393e085fd0c90ad31dfaac0cc93c90c985041f 7f0126e01d9bee3253d4432c103e2909e33d4aa9 bcdd60cabd6578cee6ff30077e459bc250a65188 58b1f375667443f05860b22b5f2afda7123cbd04 7d9e2b839e96e255740cad767042891a5a4417a9 13fb9d7c4f0f91b1998a2d39496ecc1d0b1c2bb8 c1db2c4bffc2e659dc82a9d89bbf96f4dc7205fe 8f88d26b9b1c4523a447ac51b7cddb649cd1426b e97d9260bcc3a251bd94d65678092dd6d2ed38c2 71393e085fd0c90ad31dfaac0cc93c90c985041f 7f0126e01d9bee3253d4432c103e2909e33d4aa9 bcdd60cabd6578cee6ff30077e459bc250a65188 58b1f375667443f05860b22b5f2afda7123cbd04 7d9e2b839e96e255740cad767042891a5a4417a9 13fb9d7c4f0f91b1998a2d39496ecc1d0b1c2bb8 c1db2c4bffc2e659dc82a9d89bbf96f4dc7205fe d63b0cb09eff6b57e1aab2b90cb97e0334e4f50f e0c044f9e83a7ec12d2cb09b625607f8dfd3ecd2
Checks run (2 succeeded)
- Commits:
-
Summary ID 71393e085fd0c90ad31dfaac0cc93c90c985041f 7f0126e01d9bee3253d4432c103e2909e33d4aa9 bcdd60cabd6578cee6ff30077e459bc250a65188 58b1f375667443f05860b22b5f2afda7123cbd04 7d9e2b839e96e255740cad767042891a5a4417a9 13fb9d7c4f0f91b1998a2d39496ecc1d0b1c2bb8 c1db2c4bffc2e659dc82a9d89bbf96f4dc7205fe d63b0cb09eff6b57e1aab2b90cb97e0334e4f50f e0c044f9e83a7ec12d2cb09b625607f8dfd3ecd2 f7c7567d9f20248d691f65a8e94edd189b1f3200 40da9f926ee453e05b0180eca91fe60bf8151de4 be47138600a9f3e1a4a1e18d23a11b209b06e966 02e15a8667009fe55e34b6a5aedb89018834ea79 0b876b73b67af22d4a626a55ebd87bc49075901b 15e9bde5ab377603c975258f1a886bf216973375 7e1408701ae874c3431ca3c197141ea6b43825a9 8544cae54cebf3d0f3ddced2278089ec4ee289d6 abd7f7822a3c75fcd41a9530308e2e64d085cf21 9295795a19b1c7231bf9c17f5c50badf2f0df1b3 d18bc17ba4262150c34d046d0ff2ab690a7231dc - Diff:
-
Revision 10 (+792 -98)
Checks run (2 succeeded)
- Change Summary:
-
Finished
- Summary:
-
[WIP] Add a "Last Updated By" column to the dashboardAdd a "Last Updated By" column to the dashboard.
- Description:
-
~ [WIP] Add a "Last Updated By" column to the dashboard
~ These changes add a new column to the review request dashboard called "Last Updated By" which displays the user that made the last update to each review request.
+ + Changes
+ + "Last Updated By" column
+ + - Added a "Last Updated By" column
+ - Added information about the new column to manual
+ - Added tests for the new column
+ + ReviewRequest
last activity info functions+ + ReviewRequest.get_last_activity_info()
also returns the user that last updated the review request
+ - Review requests cache their last activity info (last updated object, changedesc, and user) in
ReviewRequest.extra_data
+ - Added
ReviewRequest.set_last_activity_info(timestamp, updated_object, changedesc, user)
+ - Modified existing uses of
ReviewRequest.get_last_activity_info()
to take advantage of the user field
+ - Added and modified existing tests of
ReviewRequest.get_last_activity_info()
+ + Other
+ + - Made the WebAPI
ReviewRequestLastUpdateResource
return the correct user now thatReviewRequest.get_last_activity_info()
includes it
- Testing Done:
-
+ - Added tests for the column itself as well as the new last activity-related functions.
+ - Ran all backend tests and observed that all passed.
+ - Performed manual testing of the functionality of the column by creating, editing, reviewing, closing, and reopening review requests and observing how the column changes.
- Commits:
-
Summary ID f7c7567d9f20248d691f65a8e94edd189b1f3200 40da9f926ee453e05b0180eca91fe60bf8151de4 be47138600a9f3e1a4a1e18d23a11b209b06e966 02e15a8667009fe55e34b6a5aedb89018834ea79 0b876b73b67af22d4a626a55ebd87bc49075901b 15e9bde5ab377603c975258f1a886bf216973375 7e1408701ae874c3431ca3c197141ea6b43825a9 8544cae54cebf3d0f3ddced2278089ec4ee289d6 abd7f7822a3c75fcd41a9530308e2e64d085cf21 9295795a19b1c7231bf9c17f5c50badf2f0df1b3 d18bc17ba4262150c34d046d0ff2ab690a7231dc 1b53d5340a46a599c2d22eb0fa9c440d53848c4c 6fecbb77249f2b9222955ab73179d1fa1e61cf06 5e23fb0645c4d5680e8251e164307e700fc04545 8453864ec2337dfd1ddd6dd81b60616632a954dc b8165390960fa8a5505f64a17cc2bac16179dadc d1343d9d645200ee6343726f80e582df8acc2522 3024bc2c126ed04f27863acfd8a29d5b93542544 e803fd9d8d43b0df5975ee87eae5a9b0313b0952 94152736a6a625bc40f7c33b9e285b8b4039e4ba 818d1b480f7a7eec2732fd85b34ce621c6b895b4 f448b444d7d5ef763f763febc926b338f8c6431a 9efd28e73068f8e72b0a23ee095f359f5ba92c50 86f3d157dc1370bc0d65b5077ef61866f18c9a3c d431747bf9234be4e183845fe9621e4b8450ae2a 8342473afeb4756f0e0d6593b17a0a4400d5e1f0 d92dc7159c6cf44137a3773cf038c9939eb699c7 80734ad6b2c671547724941c9357a9c85916701c - Diff:
-
Revision 11 (+871 -155)
Checks run (2 succeeded)
- Description:
-
~ These changes add a new column to the review request dashboard called "Last Updated By" which displays the user that made the last update to each review request.
~ These changes add a new column to the review request dashboard called "Last Updated By" which displays the user that made the last update to each review request. Similar to the existing "Last Updated" column, which shows the time that the last update was made, this column is updated whenever a review request is created, edited, receives a review, is closed, or reopened.
Changes
"Last Updated By" column
- Added a "Last Updated By" column
- Added information about the new column to manual
- Added tests for the new column
ReviewRequest
last activity info functionsReviewRequest.get_last_activity_info()
also returns the user that last updated the review request
- Review requests cache their last activity info (last updated object, changedesc, and user) in
ReviewRequest.extra_data
- Added
ReviewRequest.set_last_activity_info(timestamp, updated_object, changedesc, user)
- Modified existing uses of
ReviewRequest.get_last_activity_info()
to take advantage of the user field
- Added and modified existing tests of
ReviewRequest.get_last_activity_info()
Other
- Made the WebAPI
ReviewRequestLastUpdateResource
return the correct user now thatReviewRequest.get_last_activity_info()
includes it
-
-
-
-
-
We can use a set comprehension here:
ids = { review_request.get_last_activity_user_id() for review_request in object_list }
-
You're using this for every test case, so you can just add a class attribute:
class LastUpdatedByColumnTests(BaseColumnTestCase): ... fixtures = ['test_site'] ... def test_render(self):
-
Let's wrap this a little differently. Here and in the other test cases below:
review_requests = [ self.create_review_request( summary='Test %d' % index, publish=True, submitter=username) for (index, username) in enumerate(usernames) ]
In fact, since it looks like you are doing that for all the test methods, perhaps move this into a helper function?
-
-
-
The first line of the docstring should be only one line, and should be in the imperative mood. If you need more detail for completenes, add additional paragraphs.
-
This should be in the imperative mood ("Return" instead of "Returns"). This docstring also needs a "Returns" section.
-
-
-
We generally avoid the python ternary syntax because it's awkward and confusing. Please just use an if/else here.
- Change Summary:
-
Make changes to address feedback
- Commits:
-
Summary ID 1b53d5340a46a599c2d22eb0fa9c440d53848c4c 6fecbb77249f2b9222955ab73179d1fa1e61cf06 5e23fb0645c4d5680e8251e164307e700fc04545 8453864ec2337dfd1ddd6dd81b60616632a954dc b8165390960fa8a5505f64a17cc2bac16179dadc d1343d9d645200ee6343726f80e582df8acc2522 3024bc2c126ed04f27863acfd8a29d5b93542544 e803fd9d8d43b0df5975ee87eae5a9b0313b0952 94152736a6a625bc40f7c33b9e285b8b4039e4ba 818d1b480f7a7eec2732fd85b34ce621c6b895b4 f448b444d7d5ef763f763febc926b338f8c6431a 9efd28e73068f8e72b0a23ee095f359f5ba92c50 86f3d157dc1370bc0d65b5077ef61866f18c9a3c d431747bf9234be4e183845fe9621e4b8450ae2a 8342473afeb4756f0e0d6593b17a0a4400d5e1f0 d92dc7159c6cf44137a3773cf038c9939eb699c7 80734ad6b2c671547724941c9357a9c85916701c 2886dc701a7582abb5ab763c2d9c1fe7ba1d542b 347e5aa8a529bc8b6aaea55d331475446f4d3b63 bba4df2b0cd2f382bb4eb2d88dd5a20cb92f9b22 9eead2a3139e9cec4e82a13c376d33fc558582f7 19d8bb48e3e7a2ae0536196102556e00918acf96 f568b695db1d1f7372b8dc53e5eee94aca606785 3a44a50bec97041c994a6b7b342998c9c6f942f2 410e1b643422b85781aa59d6a59f005b1c898c71 b076ce9a7ead039ffb03c6e1f27b6775a31c712d 9dfd7179ef9462d8463a230e0769f7fa3b4e7dcb caf3389617783d8d0d40393f750381fba7424f8f d1b2f75efb0be1df4e8ba081ed3b5616be574067 c3bd1a09f5a1ac7359cf7f89628067d86cd74a70 bb22a4b741f7ff917b1c4b1dce19afca681c5e95 2d5599330ffb81e6e5c02fc28c17c91ff6e88487 cdb0cfc28c3f678a77d1f779daa05da483a6915c 3120d9fe3af41f0467404c49716457599d42ac3b e606ba6247e22f74d4d40b1e28cc8d34de4549e8 - Diff:
-
Revision 12 (+952 -186)