Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8bdfa060
Commit
8bdfa060
authored
Mar 16, 2021
by
David O'Regan
Committed by
Peter Leitzen
Mar 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature flag] Enable Incident Management On-call Schedules [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
e79dffe7
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
6 additions
and
124 deletions
+6
-124
ee/changelogs/unreleased/oncall_schedule_feature_flag_removal.yml
...elogs/unreleased/oncall_schedule_feature_flag_removal.yml
+5
-0
ee/config/feature_flags/development/oncall_schedules_mvc.yml
ee/config/feature_flags/development/oncall_schedules_mvc.yml
+0
-8
ee/lib/gitlab/incident_management.rb
ee/lib/gitlab/incident_management.rb
+1
-2
ee/spec/controllers/projects/incident_management/oncall_schedules_controller_spec.rb
...s/incident_management/oncall_schedules_controller_spec.rb
+0
-12
ee/spec/finders/incident_management/oncall_rotations_finder_spec.rb
...nders/incident_management/oncall_rotations_finder_spec.rb
+0
-8
ee/spec/finders/incident_management/oncall_schedules_finder_spec.rb
...nders/incident_management/oncall_schedules_finder_spec.rb
+0
-8
ee/spec/lib/gitlab/incident_management_spec.rb
ee/spec/lib/gitlab/incident_management_spec.rb
+0
-9
ee/spec/policies/incident_management/oncall_rotation_policy_spec.rb
...licies/incident_management/oncall_rotation_policy_spec.rb
+0
-1
ee/spec/policies/incident_management/oncall_schedule_policy_spec.rb
...licies/incident_management/oncall_schedule_policy_spec.rb
+0
-1
ee/spec/policies/incident_management/oncall_shift_policy_spec.rb
.../policies/incident_management/oncall_shift_policy_spec.rb
+0
-1
ee/spec/policies/project_policy_spec.rb
ee/spec/policies/project_policy_spec.rb
+0
-16
ee/spec/services/incident_management/oncall_rotations/create_service_spec.rb
...cident_management/oncall_rotations/create_service_spec.rb
+0
-8
ee/spec/services/incident_management/oncall_rotations/destroy_service_spec.rb
...ident_management/oncall_rotations/destroy_service_spec.rb
+0
-8
ee/spec/services/incident_management/oncall_schedules/create_service_spec.rb
...cident_management/oncall_schedules/create_service_spec.rb
+0
-8
ee/spec/services/incident_management/oncall_schedules/destroy_service_spec.rb
...ident_management/oncall_schedules/destroy_service_spec.rb
+0
-8
ee/spec/services/incident_management/oncall_schedules/update_service_spec.rb
...cident_management/oncall_schedules/update_service_spec.rb
+0
-8
ee/spec/services/incident_management/oncall_shifts/read_service_spec.rb
...es/incident_management/oncall_shifts/read_service_spec.rb
+0
-8
ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb
...nt_management/oncall_rotations/persist_shifts_job_spec.rb
+0
-10
No files found.
ee/changelogs/unreleased/oncall_schedule_feature_flag_removal.yml
0 → 100644
View file @
8bdfa060
---
title
:
Incident Management On-call Schedules
merge_request
:
56263
author
:
type
:
added
ee/config/feature_flags/development/oncall_schedules_mvc.yml
deleted
100644 → 0
View file @
e79dffe7
---
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
ee/lib/gitlab/incident_management.rb
View file @
8bdfa060
...
...
@@ -3,8 +3,7 @@
module
Gitlab
module
IncidentManagement
def
self
.
oncall_schedules_available?
(
project
)
::
Feature
.
enabled?
(
:oncall_schedules_mvc
,
project
)
&&
project
.
feature_available?
(
:oncall_schedules
)
project
.
feature_available?
(
:oncall_schedules
)
end
end
end
ee/spec/controllers/projects/incident_management/oncall_schedules_controller_spec.rb
View file @
8bdfa060
...
...
@@ -55,18 +55,6 @@ RSpec.describe Projects::IncidentManagement::OncallSchedulesController do
end
end
context
'with feature flag off'
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
false
)
end
it
'responds with 404'
do
request
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'with unavailable feature'
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
...
...
ee/spec/finders/incident_management/oncall_rotations_finder_spec.rb
View file @
8bdfa060
...
...
@@ -39,14 +39,6 @@ RSpec.describe IncidentManagement::OncallRotationsFinder do
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
false
)
end
it
{
is_expected
.
to
eq
(
IncidentManagement
::
OncallRotation
.
none
)
}
end
context
'schedule is nil'
do
let
(
:oncall_schedule
)
{
nil
}
...
...
ee/spec/finders/incident_management/oncall_schedules_finder_spec.rb
View file @
8bdfa060
...
...
@@ -34,14 +34,6 @@ RSpec.describe IncidentManagement::OncallSchedulesFinder do
is_expected
.
to
contain_exactly
(
oncall_schedule
)
end
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
...
...
ee/spec/lib/gitlab/incident_management_spec.rb
View file @
8bdfa060
...
...
@@ -10,19 +10,10 @@ RSpec.describe Gitlab::IncidentManagement do
before
do
stub_licensed_features
(
oncall_schedules:
true
)
stub_feature_flags
(
oncall_schedules_mvc:
project
)
end
it
{
is_expected
.
to
be_truthy
}
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
false
)
end
it
{
is_expected
.
to
be_falsey
}
end
context
'when there is no license'
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
...
...
ee/spec/policies/incident_management/oncall_rotation_policy_spec.rb
View file @
8bdfa060
...
...
@@ -11,7 +11,6 @@ RSpec.describe IncidentManagement::OncallRotationPolicy do
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_rotation
)
}
before
do
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_licensed_features
(
oncall_schedules:
true
)
end
...
...
ee/spec/policies/incident_management/oncall_schedule_policy_spec.rb
View file @
8bdfa060
...
...
@@ -10,7 +10,6 @@ RSpec.describe IncidentManagement::OncallSchedulePolicy do
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_schedule
)
}
before
do
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_licensed_features
(
oncall_schedules:
true
)
end
...
...
ee/spec/policies/incident_management/oncall_shift_policy_spec.rb
View file @
8bdfa060
...
...
@@ -10,7 +10,6 @@ RSpec.describe IncidentManagement::OncallShiftPolicy do
subject
(
:policy
)
{
described_class
.
new
(
user
,
shift
)
}
before
do
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_licensed_features
(
oncall_schedules:
true
)
end
...
...
ee/spec/policies/project_policy_spec.rb
View file @
8bdfa060
...
...
@@ -1547,14 +1547,6 @@ RSpec.describe ProjectPolicy do
it
{
is_expected
.
to
(
allowed
?
be_allowed
(
policy
)
:
be_disallowed
(
policy
))
}
context
'with disabled feature flag'
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
false
)
end
it
{
is_expected
.
to
(
be_disallowed
(
policy
))
}
end
context
'with unavailable license'
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
...
...
@@ -1588,14 +1580,6 @@ RSpec.describe ProjectPolicy do
it
{
is_expected
.
to
(
allowed
?
be_allowed
(
policy
)
:
be_disallowed
(
policy
))
}
context
'with disabled feature flag'
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
false
)
end
it
{
is_expected
.
to
(
be_disallowed
(
policy
))
}
end
context
'with unavailable license'
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
...
...
ee/spec/services/incident_management/oncall_rotations/create_service_spec.rb
View file @
8bdfa060
...
...
@@ -62,14 +62,6 @@ RSpec.describe IncidentManagement::OncallRotations::CreateService do
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
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 rotations'
end
context
'when an on-call rotation already exists'
do
let!
(
:oncall_rotation
)
{
create
(
:incident_management_oncall_rotation
,
schedule:
schedule
,
name:
'On-call rotation'
)
}
...
...
ee/spec/services/incident_management/oncall_rotations/destroy_service_spec.rb
View file @
8bdfa060
...
...
@@ -48,14 +48,6 @@ RSpec.describe IncidentManagement::OncallRotations::DestroyService do
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
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 rotations'
end
context
'when an error occurs during removal'
do
before
do
allow
(
oncall_rotation
).
to
receive
(
:destroy
).
and_return
(
false
)
...
...
ee/spec/services/incident_management/oncall_schedules/create_service_spec.rb
View file @
8bdfa060
...
...
@@ -46,14 +46,6 @@ 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'
)
}
...
...
ee/spec/services/incident_management/oncall_schedules/destroy_service_spec.rb
View file @
8bdfa060
...
...
@@ -47,14 +47,6 @@ RSpec.describe IncidentManagement::OncallSchedules::DestroyService 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 error occurs during removal'
do
before
do
allow
(
oncall_schedule
).
to
receive
(
:destroy
).
and_return
(
false
)
...
...
ee/spec/services/incident_management/oncall_schedules/update_service_spec.rb
View file @
8bdfa060
...
...
@@ -47,14 +47,6 @@ RSpec.describe IncidentManagement::OncallSchedules::UpdateService 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 witht the same name already exists'
do
before
do
create
(
:incident_management_oncall_schedule
,
project:
project
,
name:
params
[
:name
])
...
...
ee/spec/services/incident_management/oncall_shifts/read_service_spec.rb
View file @
8bdfa060
...
...
@@ -72,14 +72,6 @@ RSpec.describe ::IncidentManagement::OncallShifts::ReadService do
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
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 rotations'
end
context
'when the start time is after the end time'
do
let
(
:end_time
)
{
1
.
day
.
before
(
start_time
)
}
...
...
ee/spec/workers/incident_management/oncall_rotations/persist_shifts_job_spec.rb
View file @
8bdfa060
...
...
@@ -120,16 +120,6 @@ RSpec.describe IncidentManagement::OncallRotations::PersistShiftsJob do
travel_to
(
existing_shift
.
ends_at
+
(
3
*
rotation
.
shift_cycle_duration
))
{
example
.
run
}
end
context
'when feature flag is not enabled'
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
false
)
end
it
'does not create shifts'
do
expect
{
perform
}.
not_to
change
{
IncidentManagement
::
OncallShift
.
count
}
end
end
it
'creates multiple shifts'
do
expect
{
perform
}.
to
change
{
rotation
.
shifts
.
count
}.
by
(
3
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment