mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] forwardport: a source may be unmerged
Since forever, if a PR gets added to an existing forward ported batch it will be forward ported immediately, leading to a forwardport having a source with no merge date. Since the addition of the skipmerge feature, it's even more possible than before. As a result, the `outstanding` listing should not assume the merge_date of a source is always set.
This commit is contained in:
parent
905b0e0de4
commit
b765bb8446
@ -59,11 +59,12 @@ class Dashboard(MergebotDashboard):
|
|||||||
if reviewers:
|
if reviewers:
|
||||||
partner_filter.append([(f'source_id.reviewed_by{suffix}', '=', arg)])
|
partner_filter.append([(f'source_id.reviewed_by{suffix}', '=', arg)])
|
||||||
|
|
||||||
|
now = datetime.datetime.now()
|
||||||
outstanding = PullRequests.search([
|
outstanding = PullRequests.search([
|
||||||
('source_id', '!=', False),
|
('source_id', '!=', False),
|
||||||
('blocked', '!=', False),
|
('blocked', '!=', False),
|
||||||
('state', 'in', ['opened', 'validated', 'approved', 'ready', 'error']),
|
('state', 'in', ['opened', 'validated', 'approved', 'ready', 'error']),
|
||||||
('create_date', '<', datetime.datetime.now() - DEFAULT_DELTA),
|
('create_date', '<', now - DEFAULT_DELTA),
|
||||||
*(partner_filter and expression.OR(partner_filter)),
|
*(partner_filter and expression.OR(partner_filter)),
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ class Dashboard(MergebotDashboard):
|
|||||||
outstanding_per_author = collections.Counter()
|
outstanding_per_author = collections.Counter()
|
||||||
outstanding_per_reviewer = collections.Counter()
|
outstanding_per_reviewer = collections.Counter()
|
||||||
outstandings = []
|
outstandings = []
|
||||||
for source in outstanding.mapped('source_id').sorted('merge_date'):
|
for source in outstanding.mapped('source_id').sorted(lambda s: s.merge_date or now):
|
||||||
prs = source.forwardport_ids.filtered(lambda p: p.state not in ['merged', 'closed'])
|
prs = source.forwardport_ids.filtered(lambda p: p.state not in ['merged', 'closed'])
|
||||||
outstandings.append({
|
outstandings.append({
|
||||||
'source': source,
|
'source': source,
|
||||||
|
Loading…
Reference in New Issue
Block a user