Commit b7cf298e authored by Vitali Tatarintev's avatar Vitali Tatarintev

Hide on-call schedules behind a feature flag

Add an `oncall_schedules_ff` feature flag
parent d5539749
......@@ -19,6 +19,7 @@ module IncidentManagement
attr_reader :current_user, :project, :params
def available?
Feature.enabled?(:oncall_schedules_mvc, project) &&
project.feature_available?(:oncall_schedules)
end
......
......@@ -31,6 +31,7 @@ module IncidentManagement
end
def available?
Feature.enabled?(:oncall_schedules_mvc, project) &&
project.feature_available?(:oncall_schedules)
end
......
---
name: oncall_schedules_mvc
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47407
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/283914
milestone: '13.7'
type: development
group: group::monitor
default_enabled: false
......@@ -24,6 +24,14 @@ RSpec.describe IncidentManagement::OncallSchedulesFinder do
it 'returns project on-call schedules' do
is_expected.to contain_exactly(oncall_schedule)
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(oncall_schedules_mvc: false)
end
it { is_expected.to eq(IncidentManagement::OncallSchedule.none) }
end
end
context 'when user has no permissions' do
......
......@@ -46,6 +46,14 @@ RSpec.describe IncidentManagement::OncallSchedules::CreateService do
it_behaves_like 'error response', 'Your license does not support on-call schedules'
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(oncall_schedules_mvc: false)
end
it_behaves_like 'error response', 'Your license does not support on-call schedules'
end
context 'when an on-call schedule already exists' do
let!(:oncall_schedule) { create(:incident_management_oncall_schedule, project: project, name: 'On-call schedule') }
......
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