mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[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
This commit is contained in:
parent
e403593799
commit
187f7f6429
@ -665,7 +665,7 @@ class PullRequests(models.Model):
|
|||||||
match command:
|
match command:
|
||||||
case commands.Approve() if self.draft:
|
case commands.Approve() if self.draft:
|
||||||
msg = "draft PRs can not be approved."
|
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:
|
# rules are a touch different for forwardport PRs:
|
||||||
valid = lambda _: True if command.ids is None else lambda n: n in command.ids
|
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)
|
_, 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
|
# - reviewers on the original can approve any forward port
|
||||||
if source_reviewer:
|
if source_reviewer:
|
||||||
approveable = ancestors
|
approveable = ancestors
|
||||||
|
elif source_author:
|
||||||
|
# give full review rights on all forwardports (attached
|
||||||
|
# or not) to original author
|
||||||
|
approveable = ancestors
|
||||||
else:
|
else:
|
||||||
# between the first merged ancestor and self
|
# between the first merged ancestor and self
|
||||||
mergeors = list(itertools.dropwhile(
|
mergeors = list(itertools.dropwhile(
|
||||||
|
Loading…
Reference in New Issue
Block a user