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
Show 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,7 +3,6 @@
...
@@ -3,7 +3,6 @@
module
Gitlab
module
Gitlab
module
IncidentManagement
module
IncidentManagement
def
self
.
oncall_schedules_available?
(
project
)
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
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
...
@@ -55,18 +55,6 @@ RSpec.describe Projects::IncidentManagement::OncallSchedulesController do
end
end
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
context
'with unavailable feature'
do
before
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
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
...
@@ -39,14 +39,6 @@ RSpec.describe IncidentManagement::OncallRotationsFinder do
end
end
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
context
'schedule is nil'
do
let
(
:oncall_schedule
)
{
nil
}
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
...
@@ -34,14 +34,6 @@ RSpec.describe IncidentManagement::OncallSchedulesFinder do
is_expected
.
to
contain_exactly
(
oncall_schedule
)
is_expected
.
to
contain_exactly
(
oncall_schedule
)
end
end
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
end
context
'when user has no permissions'
do
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
...
@@ -10,19 +10,10 @@ RSpec.describe Gitlab::IncidentManagement do
before
do
before
do
stub_licensed_features
(
oncall_schedules:
true
)
stub_licensed_features
(
oncall_schedules:
true
)
stub_feature_flags
(
oncall_schedules_mvc:
project
)
end
end
it
{
is_expected
.
to
be_truthy
}
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
context
'when there is no license'
do
before
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
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
...
@@ -11,7 +11,6 @@ RSpec.describe IncidentManagement::OncallRotationPolicy do
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_rotation
)
}
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_rotation
)
}
before
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_licensed_features
(
oncall_schedules:
true
)
stub_licensed_features
(
oncall_schedules:
true
)
end
end
...
...
ee/spec/policies/incident_management/oncall_schedule_policy_spec.rb
View file @
8bdfa060
...
@@ -10,7 +10,6 @@ RSpec.describe IncidentManagement::OncallSchedulePolicy do
...
@@ -10,7 +10,6 @@ RSpec.describe IncidentManagement::OncallSchedulePolicy do
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_schedule
)
}
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_schedule
)
}
before
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_licensed_features
(
oncall_schedules:
true
)
stub_licensed_features
(
oncall_schedules:
true
)
end
end
...
...
ee/spec/policies/incident_management/oncall_shift_policy_spec.rb
View file @
8bdfa060
...
@@ -10,7 +10,6 @@ RSpec.describe IncidentManagement::OncallShiftPolicy do
...
@@ -10,7 +10,6 @@ RSpec.describe IncidentManagement::OncallShiftPolicy do
subject
(
:policy
)
{
described_class
.
new
(
user
,
shift
)
}
subject
(
:policy
)
{
described_class
.
new
(
user
,
shift
)
}
before
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_licensed_features
(
oncall_schedules:
true
)
stub_licensed_features
(
oncall_schedules:
true
)
end
end
...
...
ee/spec/policies/project_policy_spec.rb
View file @
8bdfa060
...
@@ -1547,14 +1547,6 @@ RSpec.describe ProjectPolicy do
...
@@ -1547,14 +1547,6 @@ RSpec.describe ProjectPolicy do
it
{
is_expected
.
to
(
allowed
?
be_allowed
(
policy
)
:
be_disallowed
(
policy
))
}
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
context
'with unavailable license'
do
before
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
stub_licensed_features
(
oncall_schedules:
false
)
...
@@ -1588,14 +1580,6 @@ RSpec.describe ProjectPolicy do
...
@@ -1588,14 +1580,6 @@ RSpec.describe ProjectPolicy do
it
{
is_expected
.
to
(
allowed
?
be_allowed
(
policy
)
:
be_disallowed
(
policy
))
}
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
context
'with unavailable license'
do
before
do
before
do
stub_licensed_features
(
oncall_schedules:
false
)
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
...
@@ -62,14 +62,6 @@ RSpec.describe IncidentManagement::OncallRotations::CreateService do
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
end
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
context
'when an on-call rotation already exists'
do
let!
(
:oncall_rotation
)
{
create
(
:incident_management_oncall_rotation
,
schedule:
schedule
,
name:
'On-call rotation'
)
}
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
...
@@ -48,14 +48,6 @@ RSpec.describe IncidentManagement::OncallRotations::DestroyService do
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
end
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
context
'when an error occurs during removal'
do
before
do
before
do
allow
(
oncall_rotation
).
to
receive
(
:destroy
).
and_return
(
false
)
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
...
@@ -46,14 +46,6 @@ RSpec.describe IncidentManagement::OncallSchedules::CreateService do
it_behaves_like
'error response'
,
'Your license does not support on-call schedules'
it_behaves_like
'error response'
,
'Your license does not support on-call schedules'
end
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
context
'when an on-call schedule already exists'
do
let!
(
:oncall_schedule
)
{
create
(
:incident_management_oncall_schedule
,
project:
project
,
name:
'On-call schedule'
)
}
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
...
@@ -47,14 +47,6 @@ RSpec.describe IncidentManagement::OncallSchedules::DestroyService do
it_behaves_like
'error response'
,
'Your license does not support on-call schedules'
it_behaves_like
'error response'
,
'Your license does not support on-call schedules'
end
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
context
'when an error occurs during removal'
do
before
do
before
do
allow
(
oncall_schedule
).
to
receive
(
:destroy
).
and_return
(
false
)
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
...
@@ -47,14 +47,6 @@ RSpec.describe IncidentManagement::OncallSchedules::UpdateService do
it_behaves_like
'error response'
,
'Your license does not support on-call schedules'
it_behaves_like
'error response'
,
'Your license does not support on-call schedules'
end
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
context
'when an on-call schedule witht the same name already exists'
do
before
do
before
do
create
(
:incident_management_oncall_schedule
,
project:
project
,
name:
params
[
:name
])
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
...
@@ -72,14 +72,6 @@ RSpec.describe ::IncidentManagement::OncallShifts::ReadService do
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
it_behaves_like
'error response'
,
'Your license does not support on-call rotations'
end
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
context
'when the start time is after the end time'
do
let
(
:end_time
)
{
1
.
day
.
before
(
start_time
)
}
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
...
@@ -120,16 +120,6 @@ RSpec.describe IncidentManagement::OncallRotations::PersistShiftsJob do
travel_to
(
existing_shift
.
ends_at
+
(
3
*
rotation
.
shift_cycle_duration
))
{
example
.
run
}
travel_to
(
existing_shift
.
ends_at
+
(
3
*
rotation
.
shift_cycle_duration
))
{
example
.
run
}
end
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
it
'creates multiple shifts'
do
expect
{
perform
}.
to
change
{
rotation
.
shifts
.
count
}.
by
(
3
)
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