Reviewer roulette is not showing on MR with delete-only files
Problem
When an MR contains only deleted files (no additions or renames) Reviewer Roulette doesn't show up.
| Example |
|---|
![]() |
Example MR - gitlab-org/gitlab!198391 (closed)
This is because we discard deleted files when trying to attribute files to review categories. (Thanks @leetickett-gitlab for spotting this!)
Proposed solution
If an MR only contains deleted files use these to attribute review categories.
Implementation guide
In changes_by_category use changed and deleted files for categorization:
def changes_by_category(categories = [])
changed_and_deleted_files = all_changed_files + changes.deleted.files
changed_and_deleted_files.each_with_object(Hash.new { |h, k| h[k] = [] }) do |file, hash|
categories_for_file(file, categories).each { |category| hash[category] << file }
end
end
Edited by Anantha Vijay.M
