Add service classes for mutating AwardEmoji
Summary
Adding, destroying and toggling emoji currently lack services and are instead performed through methods called on Awardable models.
This has led to inconsistencies where relevant todos are marked as done only when emoji are awarded through our controllers, but not through the API. Todos can also be marked as done when an emoji is removed, which doesn't seem correct!
We would like to have three new services to:
- create AwardEmoji
- destroy AwardEmoji
- toggle AwardEmoji (calls create or destroy services)
Risks
The risk involves introducing errors to the parts of GitLab where emojis can be awarded (see Involved components below). We will need to make sure that each part of the app has the right test coverage to display any problems.
Behaviour changes
- Awarding emoji through the API would now mark a relevant Todo as done
- Toggling an emoji off (destroying it) through our controllers would no longer mark a relevant Todo as done
Involved components
-
ToggleAwardEmoji
concern used by:Projects::IssuesController
Projects::MergeRequestsController
Projects::NotesController
Projects::SnippetsController
SnippetsController
Snippets::NotesController
-
API::AwardEmoji
endpoints
Edited by Luke Duncalfe