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
43184bc8
Commit
43184bc8
authored
Dec 04, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add changelog file
parent
c3196212
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
changelogs/unreleased/262857-creation-rotation-graphql.yml
changelogs/unreleased/262857-creation-rotation-graphql.yml
+5
-0
ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb
...l/mutations/incident_management/oncall_rotation/create.rb
+1
-1
ee/spec/graphql/mutations/incident_management/oncall_rotation/create_spec.rb
...ations/incident_management/oncall_rotation/create_spec.rb
+2
-2
ee/spec/graphql/types/incident_management/oncall_rotation_type_spec.rb
...ql/types/incident_management/oncall_rotation_type_spec.rb
+2
-2
No files found.
changelogs/unreleased/262857-creation-rotation-graphql.yml
0 → 100644
View file @
43184bc8
---
title
:
Add create On-call rotations GraphQL mutation
merge_request
:
49206
author
:
type
:
added
ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb
View file @
43184bc8
...
@@ -39,7 +39,7 @@ module Mutations
...
@@ -39,7 +39,7 @@ module Mutations
def
resolve
(
iid
:,
project_path
:,
participants
:,
**
args
)
def
resolve
(
iid
:,
project_path
:,
participants
:,
**
args
)
project
=
authorized_find!
(
full_path:
project_path
)
project
=
authorized_find!
(
full_path:
project_path
)
schedule
=
::
IncidentManagement
::
OncallSchedulesFinder
.
new
(
current_user
,
project
,
iid
s
:
iid
)
schedule
=
::
IncidentManagement
::
OncallSchedulesFinder
.
new
(
current_user
,
project
,
iid:
iid
)
.
execute
.
execute
.
first
.
first
...
...
ee/spec/graphql/mutations/incident_management/oncall_rotation/create_spec.rb
View file @
43184bc8
...
@@ -14,7 +14,7 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
...
@@ -14,7 +14,7 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
starts_at:
"2020-01-10 09:00"
.
in_time_zone
(
schedule
.
timezone
),
starts_at:
"2020-01-10 09:00"
.
in_time_zone
(
schedule
.
timezone
),
rotation_length:
{
rotation_length:
{
length:
1
,
length:
1
,
unit:
::
IncidentManagement
::
OncallRotation
.
rotation_
length_units
[
:days
]
unit:
::
IncidentManagement
::
OncallRotation
.
length_units
[
:days
]
},
},
participants:
[
participants:
[
{
{
...
@@ -87,7 +87,7 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
...
@@ -87,7 +87,7 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
end
end
it
'raises an error'
do
it
'raises an error'
do
expect
{
resolve
}.
to
raise_error
(
ActiveRecord
::
RecordInvalid
,
/
p
articipant does not have access to the project/
)
expect
{
resolve
}.
to
raise_error
(
ActiveRecord
::
RecordInvalid
,
/
P
articipant does not have access to the project/
)
end
end
end
end
...
...
ee/spec/graphql/types/incident_management/oncall_rotation_type_spec.rb
View file @
43184bc8
...
@@ -12,8 +12,8 @@ RSpec.describe GitlabSchema.types['IncidentManagementOncallRotation'] do
...
@@ -12,8 +12,8 @@ RSpec.describe GitlabSchema.types['IncidentManagementOncallRotation'] do
id
id
name
name
starts_at
starts_at
rotation_
length
length
rotation_
length_unit
length_unit
participants
participants
]
]
...
...
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