[CHG] runbot_merge: don't reset cancel_staging on r-

Also send skipchecks removal to the PR being r-'d, as sending it to a
random PR of the batch doesn't really make sense?
This commit is contained in:
Xavier Morel 2024-02-12 08:46:44 +01:00
parent c66451a8c7
commit fa2bba3cb9
2 changed files with 3 additions and 12 deletions

View File

@ -700,8 +700,6 @@ class PullRequests(models.Model):
else:
msg = self._approve(author, login)
case commands.Reject() if is_author:
if self.batch_id.cancel_staging:
self.batch_id.cancel_staging = False
if self.batch_id.skipchecks or self.reviewed_by:
if self.error:
self.error = False
@ -712,7 +710,7 @@ class PullRequests(models.Model):
self.env.ref("runbot_merge.command.unapprove.p0")._send(
repository=self.repository,
pull_request=self.number,
format_args={'user': login, 'pr': self.batch_id.prs[:1]},
format_args={'user': login, 'pr': self},
)
self.unstage("unreviewed (r-) by %s", login)
else:

View File

@ -2880,17 +2880,10 @@ class TestBatching(object):
assert p_01.state == 'opened'
assert p_01.priority == 'alone'
assert p_01.skipchecks == False
assert p_01.cancel_staging == False
assert p_01.cancel_staging == True
p_01.batch_id.cancel_staging = True
# FIXME: cancel_staging should only cancel when the PR is or
# transitions to ready
# assert staging_4.active
# re-staging, should not be necessary
env.run_crons()
assert staging_4.active, "staging should not be disabled"
staging_5 = ensure_one(sm_all.staging_id)
assert staging_5.active
# cause the PR to become ready the normal way
with repo:
pr01.post_comment("hansen r+", config['role_reviewer']['token'])