mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[REM] runbot_merge: support for squash+/squash-
AL thinks it's not useful and it's better to always squash/rebase a single commit & merge multiple. Mark tests as xfail'd instead of removing them. Also mark test_edit_retarget_managed as skipped explicitly
This commit is contained in:
parent
b30bb09319
commit
df2d19302b
@ -43,7 +43,7 @@ class Project(models.Model):
|
|||||||
required=True,
|
required=True,
|
||||||
default="hanson", # mergebot du bot du bot du~
|
default="hanson", # mergebot du bot du bot du~
|
||||||
help="Prefix (~bot name) used when sending commands from PR "
|
help="Prefix (~bot name) used when sending commands from PR "
|
||||||
"comments e.g. [hanson retry] or [hanson r+ p=1 squash+]"
|
"comments e.g. [hanson retry] or [hanson r+ p=1]"
|
||||||
)
|
)
|
||||||
|
|
||||||
batch_limit = fields.Integer(
|
batch_limit = fields.Integer(
|
||||||
@ -407,11 +407,6 @@ class PullRequests(models.Model):
|
|||||||
return ('review', True)
|
return ('review', True)
|
||||||
elif flag == '-':
|
elif flag == '-':
|
||||||
return ('review', False)
|
return ('review', False)
|
||||||
elif name == 'squash':
|
|
||||||
if flag == '+':
|
|
||||||
return ('squash', True)
|
|
||||||
elif flag == '-':
|
|
||||||
return ('squash', False)
|
|
||||||
elif name == 'delegate':
|
elif name == 'delegate':
|
||||||
if flag == '+':
|
if flag == '+':
|
||||||
return ('delegate', True)
|
return ('delegate', True)
|
||||||
@ -432,9 +427,6 @@ class PullRequests(models.Model):
|
|||||||
resets a PR in error mode to ready for staging
|
resets a PR in error mode to ready for staging
|
||||||
r(eview)+/-
|
r(eview)+/-
|
||||||
approves or disapproves a PR (disapproving just cancels an approval)
|
approves or disapproves a PR (disapproving just cancels an approval)
|
||||||
squash+/squash-
|
|
||||||
marks the PR as squash or merge, can override squash inference or a
|
|
||||||
previous squash command
|
|
||||||
delegate+/delegate=<users>
|
delegate+/delegate=<users>
|
||||||
adds either PR author or the specified (github) users as
|
adds either PR author or the specified (github) users as
|
||||||
authorised reviewers for this PR. ``<users>`` is a
|
authorised reviewers for this PR. ``<users>`` is a
|
||||||
@ -495,11 +487,6 @@ class PullRequests(models.Model):
|
|||||||
'github_login': login,
|
'github_login': login,
|
||||||
})
|
})
|
||||||
delegates.write({'delegate_reviewer': [(4, self.id, 0)]})
|
delegates.write({'delegate_reviewer': [(4, self.id, 0)]})
|
||||||
|
|
||||||
elif command == 'squash':
|
|
||||||
if is_admin:
|
|
||||||
ok = True
|
|
||||||
self.squash = param
|
|
||||||
elif command == 'priority':
|
elif command == 'priority':
|
||||||
if is_admin:
|
if is_admin:
|
||||||
ok = True
|
ok = True
|
||||||
|
@ -330,6 +330,7 @@ def test_edit(env, repo):
|
|||||||
('number', '=', prx.number)
|
('number', '=', prx.number)
|
||||||
]).target == branch_1
|
]).target == branch_1
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="what do?")
|
||||||
def test_edit_retarget_managed(env, repo):
|
def test_edit_retarget_managed(env, repo):
|
||||||
""" A PR targeted to an un-managed branch is ignored but if the PR
|
""" A PR targeted to an un-managed branch is ignored but if the PR
|
||||||
is re-targeted to a managed branch it should be managed
|
is re-targeted to a managed branch it should be managed
|
||||||
@ -493,10 +494,8 @@ class TestRetry:
|
|||||||
|
|
||||||
class TestSquashing(object):
|
class TestSquashing(object):
|
||||||
"""
|
"""
|
||||||
* if event['pull_request']['commits'] == 1 and not disabled,
|
if event['pull_request']['commits'] == 1, "squash" (/rebase); otherwise
|
||||||
squash-merge during staging (using sole commit's message) instead
|
regular merge
|
||||||
of regular merge (using PR info)
|
|
||||||
* if 1+ commit but enabled, squash using PR info
|
|
||||||
"""
|
"""
|
||||||
def test_staging_merge_squash(self, repo, env):
|
def test_staging_merge_squash(self, repo, env):
|
||||||
m = repo.make_commit(None, 'initial', None, tree={'m': 'm'})
|
m = repo.make_commit(None, 'initial', None, tree={'m': 'm'})
|
||||||
@ -537,6 +536,7 @@ class TestSquashing(object):
|
|||||||
]).state == 'merged'
|
]).state == 'merged'
|
||||||
assert prx.state == 'closed'
|
assert prx.state == 'closed'
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="removed support for squash+ command")
|
||||||
def test_force_squash_merge(self, repo, env):
|
def test_force_squash_merge(self, repo, env):
|
||||||
m = repo.make_commit(None, 'initial', None, tree={'m': 'm'})
|
m = repo.make_commit(None, 'initial', None, tree={'m': 'm'})
|
||||||
m2 = repo.make_commit(m, 'second', None, tree={'m': 'm', 'm2': 'm2'})
|
m2 = repo.make_commit(m, 'second', None, tree={'m': 'm', 'm2': 'm2'})
|
||||||
@ -577,6 +577,7 @@ class TestSquashing(object):
|
|||||||
]).state == 'merged'
|
]).state == 'merged'
|
||||||
assert prx.state == 'closed'
|
assert prx.state == 'closed'
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="removed support for squash- command")
|
||||||
def test_disable_squash_merge(self, repo, env):
|
def test_disable_squash_merge(self, repo, env):
|
||||||
m = repo.make_commit(None, 'initial', None, tree={'m': 'm'})
|
m = repo.make_commit(None, 'initial', None, tree={'m': 'm'})
|
||||||
m2 = repo.make_commit(m, 'second', None, tree={'m': 'm', 'm2': 'm2'})
|
m2 = repo.make_commit(m, 'second', None, tree={'m': 'm', 'm2': 'm2'})
|
||||||
|
Loading…
Reference in New Issue
Block a user