Fix creating notes for group level work items
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
- 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 } } } }
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #426473 (closed)
Edited by Mario Celi