[FIX] runbot_merge: allow source author to r- forward ports

Noticed that while writing up the docs on the wiki, seems like an
unnecessary restriction, and an inconvenient one to boot: the author
could r+, then realize they forgot to do an update they needed to do
on the fw, so they should be able to cancel the staging without
needing a reviewer.
This commit is contained in:
Xavier Morel 2024-06-25 13:27:16 +02:00
parent 0a839a4857
commit 286c1fdaee

View File

@ -652,7 +652,7 @@ class PullRequests(models.Model):
commands.Help,
(self.source_id and (source_author or source_reviewer) or is_reviewer) and not self.reviewed_by and commands.Approve,
is_author and self.reviewed_by and commands.Reject,
(is_author or source_author) and self.reviewed_by and commands.Reject,
(is_author or source_author) and self.error and commands.Retry,
is_author and not self.source_id and commands.FW,
@ -783,7 +783,7 @@ For your own safety I've ignored *everything in your entire comment*.
msg = f"tried to approve PRs {command.ids} but the current PR is {self.number}"
else:
msg = self._approve(author, login)
case commands.Reject() if is_author:
case commands.Reject() if is_author or source_author:
if self.batch_id.skipchecks or self.reviewed_by:
if self.error:
self.error = False