Add migration to populate section for code_owner entries
In !33121 (merged) we're adding a new index that includes section for code_owner(or rule_type = 2) rules. By default, newly created rules will have a default value of codeowners, but there exist legacy code_owner rules where this is still nil. Add a migration that finds MRs with these rules and resync
merge_request_ids.each_slice(10) do |ids|
MergeRequest.where(id: ids).each do |merge_request|
MergeRequests::SyncCodeOwnerApprovalRules.new(merge_request).execute
end
end
Note that we only really need to do this for rule_type = 2, as we're in the process of removing the parallel code_owner column, which was synced with rule_type = 2
Related to !33121 (merged)
Edited by Kerri Miller