Loading
Improve merged branch deletion efficiency
Contributes to https://gitlab.com/gitlab-org/gitlab/-/work_items/635885
Problem
When projects have no merged branches, deletion still queries open merge requests. Repeated jobs can also queue redundant work, and a deleted requester causes retries.
Solution
- Skip the two open merge request queries when there are no merged branches.
- Deduplicate pending jobs and return when the requesting user no longer exists.
Edited by Vasilii Iakliushin