From 187f7f642948811c2f6e9d5b0c884de44e56e758 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 10 Jun 2024 15:17:11 +0200 Subject: [PATCH] [CHG] runbot_merge: allow pr author to approve all fw - trigger FW section on all forward ports, not just attached ones - allow author of original PR to approve any fwport --- runbot_merge/models/pull_requests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index a40db2d8..e1a957c6 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -665,7 +665,7 @@ class PullRequests(models.Model): match command: case commands.Approve() if self.draft: msg = "draft PRs can not be approved." - case commands.Approve() if self.parent_id: + case commands.Approve() if self.source_id: # rules are a touch different for forwardport PRs: valid = lambda _: True if command.ids is None else lambda n: n in command.ids _, source_reviewer, source_author = self.source_id._pr_acl(author) @@ -674,6 +674,10 @@ class PullRequests(models.Model): # - reviewers on the original can approve any forward port if source_reviewer: approveable = ancestors + elif source_author: + # give full review rights on all forwardports (attached + # or not) to original author + approveable = ancestors else: # between the first merged ancestor and self mergeors = list(itertools.dropwhile(