mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] forwardport: link FP PRs to both root and source
In the case where an FP sequence is interrupted (e.g. there was a conflict during one of the intermediate steps), followups get linked to the original source but don't get linked to the "interruption" PR which is a bit confusing. Link FP PRs to both source and root if they're different.
This commit is contained in:
parent
6d4923928a
commit
446b11a28f
@ -438,7 +438,11 @@ class PullRequests(models.Model):
|
|||||||
message += '\n\n'
|
message += '\n\n'
|
||||||
else:
|
else:
|
||||||
message = ''
|
message = ''
|
||||||
message += "Forward-Port-Of: %s#%s" % (source.repository.name, source.number)
|
root = pr._get_root()
|
||||||
|
message += '\n'.join(
|
||||||
|
"Forward-Port-Of: %s#%s" % (p.repository.name, p.number)
|
||||||
|
for p in root | source
|
||||||
|
)
|
||||||
|
|
||||||
(h, out, err) = conflicts.get(pr) or (None, None, None)
|
(h, out, err) = conflicts.get(pr) or (None, None, None)
|
||||||
|
|
||||||
|
@ -379,9 +379,6 @@ a
|
|||||||
}
|
}
|
||||||
|
|
||||||
def test_conflict(env, config, make_repo):
|
def test_conflict(env, config, make_repo):
|
||||||
""" If there's a conflict when forward-porting the commit, commit the
|
|
||||||
conflict and create a draft PR.
|
|
||||||
"""
|
|
||||||
prod, other = make_basic(env, config, make_repo)
|
prod, other = make_basic(env, config, make_repo)
|
||||||
# reset b to b~1 (g=a) parent so there's no b -> c conflict
|
# reset b to b~1 (g=a) parent so there's no b -> c conflict
|
||||||
with prod:
|
with prod:
|
||||||
@ -454,6 +451,7 @@ xxx
|
|||||||
'g': 'xxx',
|
'g': 'xxx',
|
||||||
}
|
}
|
||||||
assert pr1.state == 'opened', "state should be open still"
|
assert pr1.state == 'opened', "state should be open still"
|
||||||
|
assert ('#%d' % pr.number) in pr1.message
|
||||||
|
|
||||||
# check that merging the fixed PR fixes the flow and restarts a forward
|
# check that merging the fixed PR fixes the flow and restarts a forward
|
||||||
# port process
|
# port process
|
||||||
@ -470,6 +468,10 @@ xxx
|
|||||||
env.run_crons()
|
env.run_crons()
|
||||||
|
|
||||||
*_, pr2 = env['runbot_merge.pull_requests'].search([], order='number')
|
*_, pr2 = env['runbot_merge.pull_requests'].search([], order='number')
|
||||||
|
assert ('#%d' % pr.number) in pr2.message, \
|
||||||
|
"check that source / pr0 is referenced by resume PR"
|
||||||
|
assert ('#%d' % pr1.number) in pr2.message, \
|
||||||
|
"check that parent / pr1 is referenced by resume PR"
|
||||||
assert pr2.parent_id == pr1
|
assert pr2.parent_id == pr1
|
||||||
assert pr2.source_id == pr0
|
assert pr2.source_id == pr0
|
||||||
assert re.match(
|
assert re.match(
|
||||||
|
Loading…
Reference in New Issue
Block a user