mirror of
https://github.com/odoo/runbot.git
synced 2025-03-16 16:05:42 +07:00

- only remind weekly initially (not daily) - root reminders on the forward port's creation, not the source's merge date - cap reminder interval at 4 weeks (instead of doubling every time) - track reminders on forward ports, don't share between siblings - remove `forwardport_updated_before` from the testing system, it's now possible to just update `reminder_next` to a past date and see if it gets triggered (it should to nothing on sources, or on forward port in a state which does not warrant concern) Fixes #801
28 lines
1.0 KiB
Python
28 lines
1.0 KiB
Python
def migrate(cr, version):
|
|
"""
|
|
before: source PR has a `reminder_backoff_factor`, specifies the
|
|
power-of-two number of days between the source's merge date and the
|
|
next reminder(s)
|
|
after: forward ports have a `reminder_next` which is the date for sending
|
|
the next reminder, needs to be at least 7 days after the forward
|
|
port's creation, if more than that just send a reminder the next
|
|
time we can (?)
|
|
|
|
We don't actually care about the source's anything (technically we could
|
|
e.g. if we just sent a reminder via the backoff factor then don't send a
|
|
new one but...)
|
|
"""
|
|
cr.execute("""
|
|
ALTER TABLE runbot_merge_pull_requests
|
|
ADD COLUMN reminder_next varchar;
|
|
|
|
UPDATE runbot_merge_pull_requests
|
|
SET reminder_next = greatest(
|
|
now(),
|
|
create_date::timestamp + interval '7 days'
|
|
)
|
|
WHERE source_id IS NOT NULL
|
|
AND state IN ('opened', 'validated', 'approved', 'ready', 'error')
|
|
AND blocked IS NOT NULL;
|
|
""")
|