2018-07-05 06:18:17 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-07 14:09:28 -04:00
|
|
|
# This is the original root class for service related classes,
|
|
|
|
# and due to historical reason takes a project as scope.
|
|
|
|
# Later separate base classes for different scopes will be created,
|
|
|
|
# and existing service will use these one by one.
|
|
|
|
# After all are migrated, we can remove this class.
|
|
|
|
#
|
2021-05-11 23:10:21 -04:00
|
|
|
# New services should consider inheriting from:
|
|
|
|
#
|
|
|
|
# - BaseContainerService for services scoped by container (project or group)
|
|
|
|
# - BaseProjectService for services scoped to projects
|
|
|
|
#
|
|
|
|
# or, create a new base class and update this comment.
|
2014-01-16 12:03:42 -05:00
|
|
|
class BaseService
|
2020-05-07 14:09:28 -04:00
|
|
|
include BaseServiceUtility
|
2021-06-21 17:08:33 -04:00
|
|
|
include Gitlab::Experiment::Dsl
|
2015-01-08 12:53:35 -05:00
|
|
|
|
2012-07-20 01:39:34 -04:00
|
|
|
attr_accessor :project, :current_user, :params
|
|
|
|
|
2018-06-06 12:42:18 -04:00
|
|
|
def initialize(project, user = nil, params = {})
|
2021-04-19 17:09:27 -04:00
|
|
|
@project = project
|
|
|
|
@current_user = user
|
|
|
|
@params = params.dup
|
2012-07-20 01:39:34 -04:00
|
|
|
end
|
2012-07-27 20:35:24 -04:00
|
|
|
|
2017-02-22 12:51:46 -05:00
|
|
|
delegate :repository, to: :project
|
2012-07-20 01:39:34 -04:00
|
|
|
end
|