From 286c1fdaee12bce073c28a48e4e415e843de545f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 25 Jun 2024 13:27:16 +0200 Subject: [PATCH] [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. --- runbot_merge/models/pull_requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index a0a44ebc..76bc6a9f 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -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