mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot_merge: add support for draft check
1cea247e6c
missed the update of the
`draft` flag, add support for it.
Fixes #753
This commit is contained in:
parent
048ae0c5ff
commit
e14616b2fb
@ -143,10 +143,17 @@ All substitutions are tentatively applied sequentially to the input.
|
|||||||
},
|
},
|
||||||
'sender': {'login': self.project_id.github_prefix},
|
'sender': {'login': self.project_id.github_prefix},
|
||||||
})
|
})
|
||||||
|
edit2 = ''
|
||||||
|
if pr_id.draft != pr['draft']:
|
||||||
|
edit2 = controllers.handle_pr(self.env, {
|
||||||
|
'action': 'converted_to_draft' if pr['draft'] else 'ready_for_review',
|
||||||
|
'pull_request': pr,
|
||||||
|
'sender': {'login': self.project_id.github_prefix}
|
||||||
|
}) + '. '
|
||||||
feedback({
|
feedback({
|
||||||
'repository': pr_id.repository.id,
|
'repository': pr_id.repository.id,
|
||||||
'pull_request': number,
|
'pull_request': number,
|
||||||
'message': f"{edit}. {sync}.",
|
'message': f"{edit}. {edit2}{sync}.",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -2520,6 +2520,7 @@ Please check and re-approve.
|
|||||||
'state': 'ready',
|
'state': 'ready',
|
||||||
'message': "Something else",
|
'message': "Something else",
|
||||||
'target': other.id,
|
'target': other.id,
|
||||||
|
'draft': True,
|
||||||
})
|
})
|
||||||
with repo:
|
with repo:
|
||||||
pr.post_comment('hansen check')
|
pr.post_comment('hansen check')
|
||||||
@ -2528,7 +2529,11 @@ Please check and re-approve.
|
|||||||
assert pr_id.head == c2
|
assert pr_id.head == c2
|
||||||
assert pr_id.message == 'title\n\nbody' # the commit's message was used for the PR
|
assert pr_id.message == 'title\n\nbody' # the commit's message was used for the PR
|
||||||
assert pr_id.target.name == 'master'
|
assert pr_id.target.name == 'master'
|
||||||
assert pr.comments[-1] == (users['user'], f"Updated target, squash, message. Updated to {c2}.")
|
assert not pr_id.draft
|
||||||
|
assert pr.comments[-1] == (
|
||||||
|
users['user'],
|
||||||
|
f"Updated target, squash, message. Updated {pr_id.display_name} to ready. Updated to {c2}."
|
||||||
|
)
|
||||||
|
|
||||||
def test_update_closed(self, env, repo):
|
def test_update_closed(self, env, repo):
|
||||||
with repo:
|
with repo:
|
||||||
|
Loading…
Reference in New Issue
Block a user