Commit db7cec0d authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch 'id-remove-optional-code-owners-ff' into 'master'

Remove optional_code_owners_sections FF

See merge request gitlab-org/gitlab!53227
parents d34f68d3 abb05d72
---
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
...@@ -231,6 +231,7 @@ the rules for "Groups" and "Documentation" sections: ...@@ -231,6 +231,7 @@ the rules for "Groups" and "Documentation" sections:
#### Optional Code Owners Sections **(PREMIUM)** #### 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. > - [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 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: caret `^` character. Approvals from owners listed in the section are **not** required. For example:
......
...@@ -22,8 +22,6 @@ class ApprovalWrappedCodeOwnerRule < ApprovalWrappedRule ...@@ -22,8 +22,6 @@ class ApprovalWrappedCodeOwnerRule < ApprovalWrappedRule
end end
def section_optional? 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) Gitlab::CodeOwners.optional_section?(project, merge_request.target_branch, section)
end end
end end
...@@ -10,13 +10,12 @@ RSpec.describe ApprovalWrappedCodeOwnerRule do ...@@ -10,13 +10,12 @@ RSpec.describe ApprovalWrappedCodeOwnerRule do
subject { described_class.new(merge_request, rule) } subject { described_class.new(merge_request, rule) }
describe '#approvals_required' do describe '#approvals_required' do
where(:feature_enabled, :optional_sections_enabled, :optional_section, :approver_count, :expected_required_approvals) do where(:feature_enabled, :optional_section, :approver_count, :expected_required_approvals) do
true | true | false | 0 | 0 true | false | 0 | 0
true | true | false | 2 | 1 true | false | 2 | 1
true | false | true | 2 | 1 true | true | 2 | 0
true | true | true | 2 | 0 false | false | 2 | 0
false | true | false | 2 | 0 false | false | 0 | 0
false | true | false | 0 | 0
end end
with_them do with_them do
...@@ -33,8 +32,6 @@ RSpec.describe ApprovalWrappedCodeOwnerRule do ...@@ -33,8 +32,6 @@ RSpec.describe ApprovalWrappedCodeOwnerRule do
allow(subject.project) allow(subject.project)
.to receive(:code_owner_approval_required_available?).and_return(true) .to receive(:code_owner_approval_required_available?).and_return(true)
allow(Gitlab::CodeOwners).to receive(:optional_section?).and_return(optional_section) allow(Gitlab::CodeOwners).to receive(:optional_section?).and_return(optional_section)
stub_feature_flags(optional_code_owners_sections: optional_sections_enabled)
end end
context "when the project doesn't require code owner approval on all MRs" do 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