Commit adbbe982 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '287795-reporter-mr-approval-not-working' into 'master'

Fix MR approval by reporters

See merge request gitlab-org/gitlab!63153
parents d720fe92 ce0f10f6
......@@ -16,7 +16,6 @@ module EE
project = @subject.target_project
protected_branch = project
.protected_branches
.requiring_code_owner_approval
.find { |pb| pb.matches?(@subject.target_branch) }
protected_branch.present? && group_access?(protected_branch)
......
......@@ -138,7 +138,7 @@ RSpec.describe MergeRequestPolicy do
context 'for a merge request on a protected branch' do
let(:branch_name) { 'feature' }
let_it_be(:user) { create :user }
let(:protected_branch) { create(:protected_branch, project: project, name: branch_name, code_owner_approval_required: true) }
let(:protected_branch) { create(:protected_branch, project: project, name: branch_name) }
let_it_be(:approver_group) { create(:group) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project, target_branch: branch_name) }
......@@ -195,7 +195,7 @@ RSpec.describe MergeRequestPolicy do
end
context 'when the protected branch name is a wildcard' do
let(:wildcard_protected_branch) { create(:protected_branch, project: project, name: '*-stable', code_owner_approval_required: true) }
let(:wildcard_protected_branch) { create(:protected_branch, project: project, name: '*-stable') }
before do
approval_project_rule.protected_branches << wildcard_protected_branch
......
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