Skip to content

Fix linked_work_items_feature_flag_enabled? FF check

Mario Celi requested to merge 425501-fix-feature-flag-check into master

What does this MR do and why?

Making the feature flag check account for work items that belong directly to a group and not a project

How to set up and validate locally

  1. Enable the feature flag in Rails console Feature.enable(:namespace_level_work_items)
  2. Create a group level work item with the following query at http://127.0.0.1:3000/-/graphql-explorer so you can fetch a work item in the next query
    mutation {
       workItemCreate(input: {namespacePath: "flightjs", title: "test group level work item", workItemTypeId: "gid://gitlab/WorkItems::Type/1"}) {
         errors
         workItem {
           id
           iid
         }
       }
     }
  3. Fetch a wok item by IID and request the WorkItemWidgetLinkedItems field
    {
       group(fullPath: "flightjs") {
         name
         workItem(iid: "<iid_returned_in_previus_mutation>") {
           id
           iid
           widgets {
             type
             ... on WorkItemWidgetLinkedItems {
               blocked
               blockedByCount
               blockingCount
               linkedItems {
                 nodes {
                   linkId
                   linkType
                   linkCreatedAt
                   linkUpdatedAt
                   workItem {
                     id
                   }
                 }
               }
             }
           }
         }
       }
     }
    Before this change, you will get and undefined method for nil error
  4. Use the workItemAddLinkedItems mutation
    mutation {
      workItemAddLinkedItems(input: { id: "<global ID returned in the initial mutation>", workItemsIds: ["<another work item global ID>"] }) {
        errors
      }
    }
    

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #425501 (closed)

Edited by Mario Celi

Merge request reports