Allow status updates to be manually run by the review request owner.
Review Request #14445 — Created May 20, 2025 and updated
Status updates can be manually run by clicking a "Run" button in the
status update entry on the review request. Review request owners should
be able to click this, but we have a bug where only admins or the owner of
the status update (aka the configured the Review Bot user) can click the
button to trigger a run. This change fixes that by allowing the review
request owner to pass the mutability check for status updates on the
review request.This change also hides the "Run" button from users who do not have
mutability permissions for the status update.Unit tests were added for these cases. We also set
data
on the
StatusUpdatesEntryMixin
object and thereview_request
on the
StatusUpdate
in unit tests, which are always set in practice but
weren't needed in our unit tests before this change.
- Ran unit tests.
- Ran a manual status update as the review request owner.
- Ran an automatic status update.
- Confirmed that the run button didn't appear for non-owners and
non-admins. - Ran multiple status updates for one review request, one manual and
one automatic. - Tested updating a review request and seeing the status updates run
again.
Summary | ID |
---|---|
2c2015e8e2881ca7d0a70e773c307cd5598484fe |
Description | From | Last Updated |
---|---|---|
While you're updating these, mind adding -> None to them? |
|
|
While here, can you add typing that includes User and AnonymousUser? That'll help ensure everything in here is safe. |
|
|
I'd reverse these changes, and also use review_request.submitter_id. The two combined will save on any lookups in the owner case. |
|
|
Can we pull out self.review_request, since we're currently accessing it 21 times? |
|