[IMP] *: note to merge using mergebot in conflict message

The message has a lot of info, but left the merging bit
unwritten. Correct this issue.

Fixes #765
This commit is contained in:
Xavier Morel 2023-08-30 12:10:46 +02:00
parent 69f5cac2d7
commit 65ed7c51bc
3 changed files with 31 additions and 1 deletions

View File

@ -50,6 +50,7 @@ def test_conflict(env, config, make_repo, users):
assert prc_id.state == 'opened'
p = prod.commit(p_0)
prc = prod.get_pr(prc_id.number)
c = prod.commit(prc_id.head)
assert c.author == p.author
# ignore date as we're specifically not keeping the original's
@ -66,6 +67,33 @@ xxx
>>>\x3e>>> [\da-f]{7,}.*
'''),
}
assert prc.comments == [
seen(env, prc, users),
(users['user'], re_matches(
fr'''@{users['user']} @{users['reviewer']} cherrypicking of pull request {pra_id.display_name} failed\.
stdout:
```
Auto-merging h
CONFLICT \(add/add\): Merge conflict in h
```
stderr:
```
.*
```
Either perform the forward-port manually \(and push to this branch, proceeding as usual\) or close this PR \(maybe\?\)\.
In the former case, you may want to edit this PR message as well\.
:warning: after resolving this conflict, you will need to merge it via @{project.github_prefix}\.
More info at https://github\.com/odoo/odoo/wiki/Mergebot#forward-port
''', re.DOTALL))
]
prb = prod.get_pr(prb_id.number)
assert prb.comments == [
seen(env, prb, users),

View File

@ -50,7 +50,7 @@ class re_matches:
return self._r.match(text)
def __repr__(self):
return self._r.pattern + '...'
return repr(self._r.pattern)
def seen(env, pr, users):
return users['user'], f'[Pull request status dashboard]({to_pr(env, pr).url}).'

View File

@ -143,6 +143,8 @@ runbot_merge.forwardport.failure,"{pr.ping}cherrypicking of pull request {pr.sou
Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).
In the former case, you may want to edit this PR message as well.
:warning: after resolving this conflict, you will need to merge it via @{pr.repository.project_id.github_prefix}.
{footer}","Comment when a forward-port failed.
pr: the new pr (in failure)

1 id template help
143
144
145
146
147
148
149
150