Introduce MergeTrain::BaseService
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !51433 (merged) should be addressed:
-
@allison.browne started a discussion: (+1 comment) If we don't pass or use
project,userorparamsI don't think it still makes sense to inherit fromBaseService. Instead we could create a newMergeTrain::BaseServiceclass orinclude BaseServiceUtilitydirectly inMergeTrains::RefreshServiceso that this perform method looks like:def perform(target_project_id, target_branch) ::MergeTrains::RefreshService .new .execute(target_project_id, target_branch) endSee the note in the base service:
# TODO: New services should consider inheriting from # BaseContainerService, or create new base class: # https://gitlab.com/gitlab-org/gitlab/-/issues/216672or alternately if we do use
BaseServicewe can passtarget_projecton initialization:::MergeTrains::RefreshService .new(target_project) .execute(target_branch)My preference would be to prefer composition over inheritance and use
include BaseServiceUtilitydirectly inMergeTrain::RefreshService.