Skip to content

Allow fetching related merge requests on a WorkItem

Mario Celi requested to merge 454137-fetch-related-mr-for-work-items into master

What does this MR do and why?

New development widget on work items GraphQL API allows fetching merge requests related to the work item

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.

How to set up and validate locally

  1. You can use the close pattern in a merge request to mention an issue. Resolves #2 for example. This will create a record in the DB we are trying to fetch. You can mention the same issue in multiple MRs to create more associated records.
  2. Then, use the following query to fetch associated merge requests for the mentioned issue
    {
       namespace(fullPath: "flightjs/flight") {
         workItem(iid: "<mentioned_issue_iid>") {
           widgets {
             type
             ... on WorkItemWidgetDevelopment {
               relatedMergeRequests {
                 nodes {
                   closesWorkItem
                   mergeRequest { id }
                 }
               }
             }
           }
         }
       }
     }

Related to #454137 (closed)

Edited by Mario Celi

Merge request reports