[TASK] implement autorebase before merge (RT-2870)