Commit d94ffb92 authored by Samantha Ming's avatar Samantha Ming

Hide behind feature flag

Add reviewer_approval_rules FF
parent 3bf38888
......@@ -831,7 +831,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) {
};
UsersSelect.prototype.renderApprovalRules = function(elsClassName, approvalRules = []) {
if (!elsClassName?.includes('reviewer')) {
if (!gon.features?.reviewerApprovalRules || !elsClassName?.includes('reviewer')) {
return '';
}
const count = approvalRules.length;
......
......@@ -14,6 +14,7 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
before_action do
push_frontend_feature_flag(:merge_request_reviewers, @project)
push_frontend_feature_flag(:mr_collapsed_approval_rules, @project)
push_frontend_feature_flag(:reviewer_approval_rules, @project)
end
def new
......
......@@ -53,6 +53,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:vue_issuable_sidebar, @project.group)
push_frontend_feature_flag(:merge_request_reviewers, @project)
push_frontend_feature_flag(:mr_collapsed_approval_rules, @project)
push_frontend_feature_flag(:reviewer_approval_rules, @project)
end
around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions]
......
---
name: reviewer_approval_rules
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46738
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/293742
milestone: '13.7'
type: development
group: group::code review
default_enabled: false
......@@ -13,7 +13,6 @@ RSpec.describe 'Merge request > User edits MR with multiple reviewers' do
context 'user approval rules', :js do
let(:rule_name) { 'some-custom-rule' }
let(:user) { create(:admin) }
let!(:mr_rule) { create(:approval_merge_request_rule, merge_request: merge_request, users: [user], name: rule_name, approvals_required: 1 )}
it 'is not shown in assignee dropdown' do
......@@ -34,4 +33,22 @@ RSpec.describe 'Merge request > User edits MR with multiple reviewers' do
end
end
end
context 'when reviewer_approval_rules feature flag off' do
let(:rule_name) { 'some-custom-rule' }
let!(:mr_rule) { create(:approval_merge_request_rule, merge_request: merge_request, users: [user], name: rule_name, approvals_required: 1 )}
before do
stub_feature_flags(reviewer_approval_rules: false)
end
it 'is not shown in reviewer dropdown' do
find('.js-reviewer-search').click
wait_for_requests
page.within '.dropdown-menu-reviewer' do
expect(page).not_to have_content(rule_name)
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