Commit bf2cb880 authored by Igor Drozdov's avatar Igor Drozdov

Sync code owners rules on MR update

That will help us to show correct code owners rules when
target branch is updated
parent 594b072d
......@@ -42,6 +42,13 @@ module EE
private
override :after_update
def after_update(merge_request)
super
::MergeRequests::SyncCodeOwnerApprovalRules.new(merge_request).execute
end
override :create_branch_change_note
def create_branch_change_note(merge_request, branch_type, old_branch, new_branch)
super
......
---
title: Sync code owners rules on MR update
merge_request: 1003
author:
type: security
......@@ -322,5 +322,13 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
it_behaves_like 'undeletable existing approval rules'
end
end
it 'updates code owner approval rules' do
expect_next_instance_of(::MergeRequests::SyncCodeOwnerApprovalRules) do |instance|
expect(instance).to receive(:execute)
end
update_merge_request(title: 'Title')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment