Skip to content

Fix related work item links syncing

Eugenia Grieff requested to merge eg-fix-related-work-item-links-sync into master

What does this MR do and why?

Do not call Epics::RelatedEpicLinks::CreateService when target work items don't have a synced epic. If we call this service with the param target_issuable: [] it raises an error in IssuableLinksCreateService#render_not_found_error? which rollback the transaction.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
work_item_links_before work_item_links_after

How to set up and validate locally

  1. Create a work item epic and a task
  2. Visit 127.0.0.1:3000/-/graphql-explorer and use the following mutation to link the task to the work item epic
mutation { 
    workItemAddLinkedItems(input: {id: "gid://gitlab/WorkItem/WI_EPIC_ID", workItemsIds: ["gid://gitlab/WorkItem/TASK_ID"]}) {
    errors
    workItem {
      title
      widgets {
        ... on WorkItemWidgetLinkedItems {
          type
          linkedItems {
            edges {
              node {
                workItem {
                  title
                }
              }
            }
          }
        }
      }
    }
  }
}
  1. Verify that no error is present.
Edited by Eugenia Grieff

Merge request reports