Remove `store_mentions` in `Snippets::CreateService`
The following discussion from !28851 (merged) should be addressed:
-
@fjsanpedro started a discussion: (+7 comments) It seems, due to all the reactors, at some point we lost
store_mentions!
, but we need them. I added some specs to ensure we don't lose them again.
Basically, we have and after_save
callback to store the snippet_mentions
. Therefore, we can remove it from https://gitlab.com/gitlab-org/gitlab/blob/master/app/services/snippets/create_service.rb#L42.
Testing Activity
- Ensure mention is still created when snippet is saved (@lulalala )
- Check that we have existing tests for the after_save callback and we store mentions when the snippet is created. Otherwise, create them (@fjsanpedro )
- CreateService should still store mentions after removing explicit call to method (due to the callback) (@a_luna)
MR Breakdown
@vij:
- 1 MR to remove the store_mentions call
- It seems that we already have an after_save callback that will store automatically mentions when the snippet is created/update. We don't need to store them manually in the
Snippets::CreateService
.- 1 MR to remove the manual call to
store_mentions!
and check/add the needed specs
- 1 MR to remove the manual call to
Edited by Sashi