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
730d2533
Commit
730d2533
authored
Dec 21, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add project not found error
parent
1c030867
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb
...l/mutations/incident_management/oncall_rotation/create.rb
+6
-0
ee/spec/graphql/mutations/incident_management/oncall_rotation/create_spec.rb
...ations/incident_management/oncall_rotation/create_spec.rb
+10
-0
No files found.
ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb
View file @
730d2533
...
...
@@ -39,6 +39,8 @@ module Mutations
def
resolve
(
iid
:,
project_path
:,
participants
:,
**
args
)
project
=
Project
.
find_by_full_path
(
project_path
)
raise_project_not_found
unless
project
schedule
=
::
IncidentManagement
::
OncallSchedulesFinder
.
new
(
current_user
,
project
,
iid:
iid
)
.
execute
.
first
...
...
@@ -91,6 +93,10 @@ module Mutations
user_array
.
map
.
with_index
{
|
param
,
i
|
param
.
to_h
.
merge
(
user:
matched_users
[
i
])
}
end
def
raise_project_not_found
raise
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'The project could not be found'
end
def
raise_schedule_not_found
raise
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'The schedule could not be found'
end
...
...
ee/spec/graphql/mutations/incident_management/oncall_rotation/create_spec.rb
View file @
730d2533
...
...
@@ -90,6 +90,16 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
end
end
context
'project path incorrect'
do
before
do
args
[
:project_path
]
=
"something/incorrect"
end
it
'raises an error'
do
expect
{
resolve
}.
to
raise_error
(
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'The project could not be found'
)
end
end
context
'duplicate participants'
do
before
do
args
[
:participants
]
<<
args
[
:participants
].
first
...
...
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