Allow status updates to be manually run by the review request owner.

Review Request #14445 — Created May 20, 2025 and updated

Information

Review Board
release-7.x

Reviewers

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 the review_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
Allow status updates to be manually run by the review request owner.
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 the `review_request` on the `StatusUpdate` in unit tests, which are always set in practice but weren't needed in our unit tests before this change.
2c2015e8e2881ca7d0a70e773c307cd5598484fe
Description From Last Updated

While you're updating these, mind adding -> None to them?

daviddavid

While here, can you add typing that includes User and AnonymousUser? That'll help ensure everything in here is safe.

chipx86chipx86

I'd reverse these changes, and also use review_request.submitter_id. The two combined will save on any lookups in the owner case.

chipx86chipx86

Can we pull out self.review_request, since we're currently accessing it 21 times?

chipx86chipx86
david
  1. 
      
  2. Show all issues

    While you're updating these, mind adding -> None to them?

  3. 
      
maubin
Review request changed
Commits:
Summary ID
Allow status updates to be manually run by the review request owner.
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 the `review_request` on the `StatusUpdate` in unit tests, which are always set in practice but weren't needed in our unit tests before this change.
7986aa0e428d6ab67de3cd621eb3fcdc1f5bd39b
Allow status updates to be manually run by the review request owner.
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 the `review_request` on the `StatusUpdate` in unit tests, which are always set in practice but weren't needed in our unit tests before this change.
2c2015e8e2881ca7d0a70e773c307cd5598484fe

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    While here, can you add typing that includes User and AnonymousUser? That'll help ensure everything in here is safe.

  3. reviewboard/reviews/models/status_update.py (Diff revision 2)
     
     
     
     
    Show all issues

    I'd reverse these changes, and also use review_request.submitter_id. The two combined will save on any lookups in the owner case.

  4. Show all issues

    Can we pull out self.review_request, since we're currently accessing it 21 times?

  5.