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
cca7f0c5
Commit
cca7f0c5
authored
Oct 05, 2020
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return specfic error message when moving an issue
parent
1e5ef1a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
ee/app/graphql/ee/mutations/boards/issues/issue_move_list.rb
ee/app/graphql/ee/mutations/boards/issues/issue_move_list.rb
+3
-4
ee/changelogs/unreleased/epic-errmsg.yml
ee/changelogs/unreleased/epic-errmsg.yml
+5
-0
ee/spec/requests/api/graphql/mutations/boards/issues/issue_move_list_spec.rb
...i/graphql/mutations/boards/issues/issue_move_list_spec.rb
+2
-2
No files found.
ee/app/graphql/ee/mutations/boards/issues/issue_move_list.rb
View file @
cca7f0c5
...
...
@@ -21,10 +21,9 @@ module EE
super
rescue
::
Issues
::
BaseService
::
EpicAssignmentError
=>
e
issue
.
errors
.
add
(
:epic_issue
,
e
.
message
)
# because we can't be sure if these exceptions were raised because of epic
# we return just a generic error here for now
# https://gitlab.com/gitlab-org/gitlab/-/issues/247096
rescue
::
Gitlab
::
Access
::
AccessDeniedError
,
ActiveRecord
::
RecordNotFound
rescue
::
Gitlab
::
Access
::
AccessDeniedError
issue
.
errors
.
add
(
:base
,
'You are not allowed to move the issue'
)
rescue
ActiveRecord
::
RecordNotFound
issue
.
errors
.
add
(
:base
,
'Resource not found'
)
end
...
...
ee/changelogs/unreleased/epic-errmsg.yml
0 → 100644
View file @
cca7f0c5
---
title
:
Return more specific error message when moving issue in GraphQL API
merge_request
:
44296
author
:
type
:
changed
ee/spec/requests/api/graphql/mutations/boards/issues/issue_move_list_spec.rb
View file @
cca7f0c5
...
...
@@ -36,7 +36,7 @@ RSpec.describe 'Reposition and move issue within board lists' do
project
.
add_maintainer
(
user
)
end
context
'when user
has access to the
epic'
do
context
'when user
can admin
epic'
do
before
do
group
.
add_maintainer
(
user
)
end
...
...
@@ -81,7 +81,7 @@ RSpec.describe 'Reposition and move issue within board lists' do
post_graphql_mutation
(
mutation
(
params
),
current_user:
user
)
mutation_response
=
graphql_mutation_response
(
:issue_move_list
)
expect
(
mutation_response
[
'errors'
]).
to
eq
([
'
Resource not found
'
])
expect
(
mutation_response
[
'errors'
]).
to
eq
([
'
You are not allowed to move the issue
'
])
expect
(
mutation_response
[
'issue'
][
'epic'
]).
to
eq
(
nil
)
expect
(
mutation_response
[
'issue'
][
'relativePosition'
]).
to
eq
(
3
)
end
...
...
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