Skip to content

Improve Graphql error handling when assigning issues to epics

Alexandr Tanayno requested to merge graphql-epic-error-handling into master

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:

Screenshot_2023-01-09_at_4.40.10_PM


After:

An issue belonging to a project in a different namespace from the epic being linked:

Screenshot_2023-01-09_at_4.35.32_PM

An issue that's already been linked to an epic:

Screenshot_2023-01-09_at_4.35.59_PM

A non-confidential issue linked to a confidential epic:

Screenshot_2023-01-09_at_4.36.38_PM

How to set up and validate locally

  1. Check out the feature branch
  2. Open GraphQL explorer: http://localhost:3000/-/graphql-explorer (replace the localhost:3000 with your host URI)
  3. 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.

Edited by sameer shaik

Merge request reports

Loading