Commit 76129fce authored by Tim Zallmann's avatar Tim Zallmann

Merge branch '9928-remove-report_approver_rules-feature-flag' into 'master'

Remove report_approver_rules feature flag

Closes #9928

See merge request gitlab-org/gitlab-ee!15087
parents a7ce47aa 2eb62937
...@@ -22,9 +22,6 @@ export default { ...@@ -22,9 +22,6 @@ export default {
...mapState({ ...mapState({
rules: state => state.approvals.rules, rules: state => state.approvals.rules,
}), }),
reportApproverRulesAreEnabled() {
return Boolean(gon && gon.features && gon.features.reportApproverRules);
},
}, },
methods: { methods: {
summaryText(rule) { summaryText(rule) {
...@@ -62,7 +59,7 @@ export default { ...@@ -62,7 +59,7 @@ export default {
); );
}, },
showVulnerabilityCheckPopover(rule) { showVulnerabilityCheckPopover(rule) {
return this.reportApproverRulesAreEnabled && rule.name === VULNERABILITY_CHECK_NAME; return rule.name === VULNERABILITY_CHECK_NAME;
}, },
}, },
}; };
......
...@@ -6,7 +6,6 @@ module EE ...@@ -6,7 +6,6 @@ module EE
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
prepended do prepended do
before_action :set_report_approver_rules_feature_flag, only: [:edit]
before_action :log_audit_event, only: [:download_export] before_action :log_audit_event, only: [:download_export]
end end
...@@ -83,10 +82,6 @@ module EE ...@@ -83,10 +82,6 @@ module EE
project&.feature_available?(:merge_pipelines) project&.feature_available?(:merge_pipelines)
end end
def set_report_approver_rules_feature_flag
push_frontend_feature_flag(:report_approver_rules, default_enabled: false)
end
def log_audit_event def log_audit_event
AuditEvents::CustomAuditEventService.new( AuditEvents::CustomAuditEventService.new(
current_user, current_user,
......
...@@ -42,7 +42,7 @@ module EE ...@@ -42,7 +42,7 @@ module EE
merge_requests_for_source_branch.each do |merge_request| merge_requests_for_source_branch.each do |merge_request|
::MergeRequests::SyncCodeOwnerApprovalRules.new(merge_request).execute if project.feature_available?(:code_owners) ::MergeRequests::SyncCodeOwnerApprovalRules.new(merge_request).execute if project.feature_available?(:code_owners)
::MergeRequests::SyncReportApproverApprovalRules.new(merge_request).execute if project.beta_feature_available?(:report_approver_rules) ::MergeRequests::SyncReportApproverApprovalRules.new(merge_request).execute if project.feature_available?(:report_approver_rules)
end end
results results
......
...@@ -7,7 +7,7 @@ module MergeRequests ...@@ -7,7 +7,7 @@ module MergeRequests
end end
def execute def execute
if merge_request.target_project.beta_feature_available?(:report_approver_rules) if merge_request.target_project.feature_available?(:report_approver_rules)
sync_rules sync_rules
end end
end end
......
---
title: Enable security report approvals by default
merge_request: 15087
author:
type: added
...@@ -109,43 +109,23 @@ describe('Approvals ProjectRules', () => { ...@@ -109,43 +109,23 @@ describe('Approvals ProjectRules', () => {
store.state.settings.allowMultiRule = true; store.state.settings.allowMultiRule = true;
}); });
describe('when the `reportApproverRules` feature flag is enabled', () => { beforeEach(() => {
beforeEach(() => { factory();
gon.features = { reportApproverRules: true }; rows = wrapper.findAll('tbody tr');
factory();
rows = wrapper.findAll('tbody tr');
});
it('should render the popover for the Vulnerability-Check group', () => {
const firstRow = rows.at(0);
const nameCell = findCell(firstRow, 'name');
expect(nameCell.find('.js-help').exists()).toBeTruthy();
});
it('should not render the popover for a standard approval group', () => {
const secondRow = rows.at(1);
const nameCell = findCell(secondRow, 'name');
expect(nameCell.find('.js-help').exists()).toBeFalsy();
});
}); });
describe('when the `reportApproverRules` feature flag is disabled', () => { it('should render the popover for the Vulnerability-Check group', () => {
beforeEach(() => { const firstRow = rows.at(0);
gon.features = { reportApproverRules: false }; const nameCell = findCell(firstRow, 'name');
factory(); expect(nameCell.find('.js-help').exists()).toBeTruthy();
rows = wrapper.findAll('tbody tr'); });
});
it('should not render the popover for the Vulnerability-Check group', () => { it('should not render the popover for a standard approval group', () => {
const firstRow = rows.at(0); const secondRow = rows.at(1);
const nameCell = findCell(firstRow, 'name'); const nameCell = findCell(secondRow, 'name');
expect(nameCell.find('.js-help').exists()).toBeFalsy(); expect(nameCell.find('.js-help').exists()).toBeFalsy();
});
}); });
}); });
}); });
...@@ -13,7 +13,7 @@ describe MergeRequests::SyncReportApproverApprovalRules do ...@@ -13,7 +13,7 @@ describe MergeRequests::SyncReportApproverApprovalRules do
let!(:regular_approval_project_rule) { create(:approval_project_rule, project: merge_request.target_project) } let!(:regular_approval_project_rule) { create(:approval_project_rule, project: merge_request.target_project) }
before do before do
stub_feature_flags(report_approver_rules: true) stub_licensed_features(report_approver_rules: true)
end end
it 'creates rule for report approvers' do it 'creates rule for report approvers' do
...@@ -43,10 +43,6 @@ describe MergeRequests::SyncReportApproverApprovalRules do ...@@ -43,10 +43,6 @@ describe MergeRequests::SyncReportApproverApprovalRules do
end end
context 'when report_approver_rules are disabled' do context 'when report_approver_rules are disabled' do
before do
stub_feature_flags(report_approver_rules: false)
end
it 'copies nothing' do it 'copies nothing' do
expect { service.execute } expect { service.execute }
.not_to change { merge_request.approval_rules.count } .not_to change { merge_request.approval_rules.count }
......
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