Improve Graphql error handling when assigning issues to epics
What does this MR do and why?
This MR is related to the issue #381182 (closed).
The mutation epicAddIssue returns a internal server error in multiple scenarios as listed in the issue description. This MR slightly changed the object returned by the resolver based on the state(success/failure) of the service execution.
It fixes unclear internal server error for all the cases listed below and replaces it with a valid descriptive error.
- A non-confidential issue linked to a confidential epic.
- An issue that's already been linked to an epic.
- An issue belonging to a project in a different namespace from the epic being linked.
Screenshots or screen recordings
In all 3 cases the mutation returns Internal server error
.
Before:
After:
An issue belonging to a project in a different namespace from the epic being linked:
An issue that's already been linked to an epic:
A non-confidential issue linked to a confidential epic:
How to set up and validate locally
- Check out the feature branch
- Open GraphQL explorer: http://localhost:3000/-/graphql-explorer (replace the
localhost:3000
with your host URI) - Execute the queries for all the following cases by following the instructions mentioned here: Steps to reproduce
- A non-confidential issue linked to a confidential epic.
- An issue that's already been linked to an epic.
- An issue belonging to a project in a different namespace from the epic being linked.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.