Fix fetching notes widget for group work items
What does this MR do and why?
Small policy change required to allow fetching notes created on a group level work item
How to set up and validate locally
- Enable the feature flag in Rails console
Feature.enable(:namespace_level_work_items)
- 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 } } }
- 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 } } } }
- fetch notes for the newly created work item
{ workItem(id: "<id_from_the_first_step>") { id title archived project { id } widgets { ... on WorkItemWidgetNotes { discussions { nodes { notes { nodes { body } } } } } } } }
This should return the note you created on step 2. Before this change, the last query would always return an empty array of discussions
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #428853 (closed)
Edited by Mario Celi