Skip to content

Fix creating notes for group level work items

Mario Celi requested to merge 426473-create-work-item-note-group-level-fix into master

What does this MR do and why?

Now that we can have work items directly associated with a group and not only a project, we need to enable creating notes for group level work items

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 use it 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. create a note on the newly created work item
     mutation {
       createNote(input:{noteableId: "<id_from_the_previous_step>", body: "testing note"}) {
         errors
         note {
           body
           authorIsContributor
           project {
             id
           }
         }
       }
     }
    Before this change, you will get an error. With this change a new note should be created on the work item

Important

While working on this, I realized that fetching notes for a group level work item was also broken, but to keep MRs smaller, I created !134464 (merged) to fix that. This mutation can be tested on it's own as described above or checking for the newly created note on the rails console

This feature is still behind a feature flag so no changelog required

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 #426473 (closed)

Edited by Mario Celi

Merge request reports

Loading