Skip to content

Create a system note for the cc command

Mário requested to merge marionzualo/gitlab-ce:cc-slash-command into master

What does this MR do?

This MR creates a system note for the cc slash command. It is a first step in implementing the ideas discussed in https://gitlab.com/gitlab-org/gitlab-ce/issues/24615.

Are there points in the code the reviewer needs to double check?

I am not 100% sure of the names of the methods. I settled on cc_user for now. The issue is that the action "to cc" sounds odd when compared with other actions (e.g "to subscribe/mention").

I settled on placing cc_user in IssuableBaseService#update because that way it could be used by both Issues::UpdateService and MergeRequests#UpdateService. Additionally I placed it close to other methods that reply on attributes present in params which need to be removed before the #update_issuable method. Let me know if there is a more appropriate location for the logic.

With this PR a system note is added but the referenced users aren't added as participants to the issue/MR or notified of that. Therefore, this probably can't be merged before the /cc slash command gets that behaviour in order to avoid confusion to users.

I added a couple of tests. Let me know if there is any layer of testing missing.

Why was this MR needed?

To turn a common idiom in Gitlab, "cc the_user_handle", into a first class citizen. More details can be found at: https://gitlab.com/gitlab-org/gitlab-ce/issues/24615

Screenshots (if relevant)

N/A

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

24615

Merge request reports