Commit 3e64c76b authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'revert_feature_flag_superseding_push_code_owners' into 'master'

Reintroduce the feature flag for superseding code owner rule

See merge request gitlab-org/gitlab!47897
parents 6ad18d36 77e76971
---
name: push_rules_supersede_code_owners
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44126
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/262019
type: development
group: group::source code
default_enabled: true
......@@ -20,7 +20,8 @@ module EE
end
def validate_code_owners?
return false if updated_from_web? || user_access.can_push_to_branch?(branch_name)
return false if updated_from_web?
return false if ::Feature.enabled?(:push_rules_supersede_code_owners, project, default_enabled: true) && user_access.can_push_to_branch?(branch_name)
project.branch_requires_code_owner_approval?(branch_name)
end
......
......@@ -60,6 +60,18 @@ RSpec.describe Gitlab::Checks::DiffCheck do
it 'returns false' do
expect(validate_code_owners).to eq(false)
end
context 'when push_rules_supersede_code_owners is disabled' do
before do
stub_feature_flags(push_rules_supersede_code_owners: false)
end
it 'returns branch_requires_code_owner_approval?' do
expect(project).to receive(:branch_requires_code_owner_approval?).and_return(true)
expect(validate_code_owners).to eq(true)
end
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