Separate Member::CreateService into Member::AddService and Member::CreateService
Initially started in gitlab-ce!18893.
Something to note with this approach is that I have renamed the
Member::CreateService
toMember::AddService
. My issue with the create service is that is wasn't actually creating anything, and instead delegating it to something else. This is different to what the other create services I looked at did.I then moved
add_user
from the member model into the create service.This will require the EE version to be changed as it makes use of the after_execute in the
Members::CreateService
. If we go with the rename, it would need to be renamed in the EE version as well.
The EE version has an
after_execute
to log information. This is called from the oldMembers::CreateService
The current workflow is that we have this create service, which calls
add_user
on the source type.It is interesting to note that the api does not go through the create service, rather it calls the sources
add_user
method directly. This results in the api bypassing the logging in the after_execute.Is this expected behaviour?
/cc @marcshaw