mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot_merge: set status on skipchecks & use that
- rather than enumerate states, forward-porting should just check if
the statuses are successful on a PR
- for the same consistency reasons explained in
f97502e503
, `skipchecks` should force
the status of a PR to `success`: it very odd that a PR would be
ready without being validated...
This commit is contained in:
parent
fe7cd8e1f0
commit
851656bec0
@ -432,7 +432,7 @@ class Batch(models.Model):
|
|||||||
_logger.info('-> no parent %s (%s)', batch, prs)
|
_logger.info('-> no parent %s (%s)', batch, prs)
|
||||||
continue
|
continue
|
||||||
if not force_fw and batch.source.fw_policy != 'skipci' \
|
if not force_fw and batch.source.fw_policy != 'skipci' \
|
||||||
and (invalid := batch.prs.filtered(lambda p: p.state not in ['validated', 'ready'])):
|
and (invalid := batch.prs.filtered(lambda p: p.status != 'success')):
|
||||||
_logger.info(
|
_logger.info(
|
||||||
'-> wrong state %s (%s)',
|
'-> wrong state %s (%s)',
|
||||||
batch,
|
batch,
|
||||||
|
@ -1163,7 +1163,7 @@ For your own safety I've ignored *everything in your entire comment*.
|
|||||||
super().modified(fnames, create, before)
|
super().modified(fnames, create, before)
|
||||||
|
|
||||||
@api.depends(
|
@api.depends(
|
||||||
'statuses', 'overrides', 'target', 'parent_id',
|
'statuses', 'overrides', 'target', 'parent_id', 'skipchecks',
|
||||||
'repository.status_ids.context',
|
'repository.status_ids.context',
|
||||||
'repository.status_ids.branch_filter',
|
'repository.status_ids.branch_filter',
|
||||||
'repository.status_ids.prs',
|
'repository.status_ids.prs',
|
||||||
@ -1173,6 +1173,9 @@ For your own safety I've ignored *everything in your entire comment*.
|
|||||||
statuses = {**json.loads(pr.statuses), **pr._get_overrides()}
|
statuses = {**json.loads(pr.statuses), **pr._get_overrides()}
|
||||||
|
|
||||||
pr.statuses_full = json.dumps(statuses, indent=4)
|
pr.statuses_full = json.dumps(statuses, indent=4)
|
||||||
|
if pr.skipchecks:
|
||||||
|
pr.status = 'success'
|
||||||
|
continue
|
||||||
|
|
||||||
st = 'success'
|
st = 'success'
|
||||||
for ci in pr.repository.status_ids._for_pr(pr):
|
for ci in pr.repository.status_ids._for_pr(pr):
|
||||||
|
@ -260,7 +260,7 @@ def test_force_ready(env, repo, config):
|
|||||||
pr_id.skipchecks = True
|
pr_id.skipchecks = True
|
||||||
|
|
||||||
assert pr_id.state == 'ready'
|
assert pr_id.state == 'ready'
|
||||||
assert pr_id.status == 'pending'
|
assert pr_id.status == 'success'
|
||||||
reviewer = env['res.users'].browse([env._uid]).partner_id
|
reviewer = env['res.users'].browse([env._uid]).partner_id
|
||||||
assert pr_id.reviewed_by == reviewer
|
assert pr_id.reviewed_by == reviewer
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user