mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[IMP] forwardport: classify FP as outstanding a week after creation
Rather than a week after *source merge*. Fixes #801
This commit is contained in:
parent
942570e60a
commit
60b84490c6
6
forwardport/changelog/2025-02/outstanding.md
Normal file
6
forwardport/changelog/2025-02/outstanding.md
Normal file
@ -0,0 +1,6 @@
|
||||
IMP: outstanding classification
|
||||
|
||||
Forward ports are now considered "outstanding" if *they* were created more than
|
||||
~a week ago, previously they would be counted as outstanding if their source was
|
||||
merged more than a week ago (so for difficult forward ports they'd all be
|
||||
considered outstanding leading to unnecessary reminders).
|
@ -45,7 +45,6 @@ class Dashboard(MergebotDashboard):
|
||||
'link': link,
|
||||
})
|
||||
|
||||
source_filter = [('merge_date', '<', datetime.datetime.now() - DEFAULT_DELTA)]
|
||||
partner_filter = []
|
||||
if partner or group:
|
||||
if partner:
|
||||
@ -56,15 +55,16 @@ class Dashboard(MergebotDashboard):
|
||||
arg = group.id
|
||||
|
||||
if authors:
|
||||
partner_filter.append([(f'author{suffix}', '=', arg)])
|
||||
partner_filter.append([(f'source_id.author{suffix}', '=', arg)])
|
||||
if reviewers:
|
||||
partner_filter.append([(f'reviewed_by{suffix}', '=', arg)])
|
||||
|
||||
source_filter.extend(expression.OR(partner_filter))
|
||||
partner_filter.append([(f'source_id.reviewed_by{suffix}', '=', arg)])
|
||||
|
||||
outstanding = PullRequests.search([
|
||||
('source_id', '!=', False),
|
||||
('blocked', '!=', False),
|
||||
('state', 'in', ['opened', 'validated', 'approved', 'ready', 'error']),
|
||||
('source_id', 'in', PullRequests._search(source_filter)),
|
||||
('create_date', '<', datetime.datetime.now() - DEFAULT_DELTA),
|
||||
*(partner_filter and expression.OR(partner_filter)),
|
||||
])
|
||||
|
||||
outstanding_per_group = collections.Counter()
|
||||
|
@ -10,12 +10,14 @@
|
||||
<xpath expr="//div[@id='alerts']" position="inside">
|
||||
<t t-if="env['runbot_merge.pull_requests'].check_access_rights('read', False)">
|
||||
<t t-set="outstanding" t-value="env['runbot_merge.pull_requests'].search_count([
|
||||
('source_id', '!=', False),
|
||||
('blocked', '!=', False),
|
||||
('state', 'in', ['opened', 'validated', 'approved', 'ready', 'error']),
|
||||
('source_id.merge_date', '<', datetime.datetime.now() - relativedelta(days=7)),
|
||||
('create_date', '<', datetime.datetime.now() - relativedelta(days=7)),
|
||||
])"/>
|
||||
<div t-if="outstanding != 0" class="alert col-md-12 alert-warning mb-0">
|
||||
<a href="/forwardport/outstanding">
|
||||
<t t-esc="outstanding"/> outstanding forward-ports (>1 week)
|
||||
<t t-out="outstanding"/> outstanding forward-ports (>1 week)
|
||||
</a>
|
||||
</div>
|
||||
</t>
|
||||
|
Loading…
Reference in New Issue
Block a user