Commit abb05d72 authored by Igor Drozdov's avatar Igor Drozdov

Remove optional_code_owners_sections FF

optional_code_owners_sections has been introduced
in https://gitlab.com/gitlab-org/gitlab/-/issues/232995

enabled by default:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51643
parent 9991065d
---
name: optional_code_owners_sections
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51002
rollout_issue_url:
milestone: '13.8'
type: development
group: group::source code
default_enabled: true
......@@ -230,6 +230,7 @@ the rules for "Groups" and "Documentation" sections:
#### Optional Code Owners Sections **(PREMIUM)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/232995) in GitLab Premium 13.8 behind a feature flag, enabled by default.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53227) in GitLab 13.9.
To make a certain section optional, add a code owners section prepended with the
caret `^` character. Approvals from owners listed in the section are **not** required. For example:
......
......@@ -22,8 +22,6 @@ class ApprovalWrappedCodeOwnerRule < ApprovalWrappedRule
end
def section_optional?
return false unless Feature.enabled?(:optional_code_owners_sections, project, default_enabled: true)
Gitlab::CodeOwners.optional_section?(project, merge_request.target_branch, section)
end
end
......@@ -10,13 +10,12 @@ RSpec.describe ApprovalWrappedCodeOwnerRule do
subject { described_class.new(merge_request, rule) }
describe '#approvals_required' do
where(:feature_enabled, :optional_sections_enabled, :optional_section, :approver_count, :expected_required_approvals) do
true | true | false | 0 | 0
true | true | false | 2 | 1
true | false | true | 2 | 1
true | true | true | 2 | 0
false | true | false | 2 | 0
false | true | false | 0 | 0
where(:feature_enabled, :optional_section, :approver_count, :expected_required_approvals) do
true | false | 0 | 0
true | false | 2 | 1
true | true | 2 | 0
false | false | 2 | 0
false | false | 0 | 0
end
with_them do
......@@ -33,8 +32,6 @@ RSpec.describe ApprovalWrappedCodeOwnerRule do
allow(subject.project)
.to receive(:code_owner_approval_required_available?).and_return(true)
allow(Gitlab::CodeOwners).to receive(:optional_section?).and_return(optional_section)
stub_feature_flags(optional_code_owners_sections: optional_sections_enabled)
end
context "when the project doesn't require code owner approval on all MRs" do
......
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