Class: BaseService

Inherits:
Object
  • Object
show all
Includes:
BaseServiceUtility, Gitlab::Experiment::Dsl
Defined in:
app/services/base_service.rb

Overview

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.

For new services, please see docs.gitlab.com/ee/development/reusing_abstractions.html#service-classes

Direct Known Subclasses

AlertManagement::MetricImages::UploadService, ApplicationSettings::BaseService, Auth::ContainerRegistryAuthenticationService, Auth::DependencyProxyAuthenticationService, AutoMerge::BaseService, AutoMergeService, AwardEmojis::BaseService, Boards::BaseService, Branches::CreateService, Branches::DeleteMergedService, Branches::DeleteService, Branches::ValidateNewService, Ci::AfterRequeueJobService, Ci::CompareReportsBaseService, Ci::CreateDownstreamPipelineService, Ci::CreatePipelineScheduleService, Ci::CreatePipelineService, Ci::CreateWebIdeTerminalService, Ci::DestroyPipelineService, Ci::DestroySecureFileService, Ci::EnsureStageService, Ci::ExternalPullRequests::CreatePipelineService, Ci::FindExposedArtifactsService, Ci::JobArtifacts::CreateService, Ci::JobTokenScope::AddProjectService, Ci::JobTokenScope::RemoveProjectService, Ci::ListConfigVariablesService, Ci::ParseDotenvArtifactService, Ci::PipelineBridgeStatusService, Ci::PipelineScheduleService, Ci::PipelineSchedules::CalculateNextRunService, Ci::PipelineTriggerService, Ci::PlayBridgeService, Ci::PlayBuildService, Ci::PlayManualStageService, Ci::ProcessBuildService, Ci::ResourceGroups::AssignResourceFromResourceGroupService, Ci::RetryJobService, Ci::RetryPipelineService, Ci::RunScheduledBuildService, Ci::UnlockArtifactsService, Clusters::Agents::CreateService, Commits::CreateService, Commits::TagService, DependencyProxy::BaseService, Deployments::ArchiveInProjectService, DesignManagement::DesignService, Discussions::BaseService, DraftNotes::BaseService, Environments::CanaryIngress::UpdateService, Environments::ResetAutoStopService, Environments::ScheduleToDeleteReviewAppsService, Environments::StopService, ErrorTracking::CollectErrorService, FeatureFlags::BaseService, Git::BaseHooksService, Git::BranchPushService, Git::ProcessRefChangesService, Git::TagPushService, Git::WikiPushService, Gitlab::DatabaseImporters::InstanceAdministrators::CreateGroup, Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService, Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService, GoogleCloud::GcpRegionAddOrReplaceService, GoogleCloud::ServiceAccountsService, Grafana::ProxyService, Groups::BaseService, Ide::BaseConfigService, Import::BaseService, IncidentManagement::PagerDuty::CreateIncidentIssueService, IssuableLinks::CreateService, IssuableLinks::DestroyService, JiraConnectSubscriptions::BaseService, Labels::BaseService, Lfs::LockFileService, Lfs::LocksFinderService, Lfs::PushService, Lfs::UnlockFileService, Mattermost::CreateTeamService, Members::BaseService, MergeRequests::MergeOrchestrationService, MergeRequests::MergeabilityCheckService, MergeRequests::MigrateExternalDiffsService, Metrics::Dashboard::Annotations::CreateService, Metrics::Dashboard::Annotations::DeleteService, Metrics::Dashboard::BaseService, Metrics::Dashboard::CloneDashboardService, Metrics::Dashboard::UpdateDashboardService, Metrics::UsersStarredDashboards::CreateService, Metrics::UsersStarredDashboards::DeleteService, Milestones::BaseService, Notes::BaseService, Notes::BuildService, Notes::ResolveService, Packages::Conan::SearchService, Packages::CreateDependencyService, Packages::CreateEventService, Packages::CreatePackageService, Packages::Generic::CreatePackageFileService, Packages::Go::CreatePackageService, Packages::Go::SyncPackagesService, Packages::Maven::FindOrCreatePackageService, Packages::Nuget::CreateDependencyService, Packages::Nuget::SearchService, Packages::RemoveTagService, Packages::Rubygems::DependencyResolverService, Pages::DeleteService, PersonalAccessTokens::CreateService, PodLogs::BaseService, PreviewMarkdownService, Projects::AndroidTargetPlatformDetectorService, Projects::AppleTargetPlatformDetectorService, Projects::AutoDevops::DisableService, Projects::AutocompleteService, Projects::BaseMoveRelationsService, Projects::CleanupService, Projects::ContainerRepository::DeleteTagsService, Projects::ContainerRepository::DestroyService, Projects::CreateFromTemplateService, Projects::CreateService, Projects::DeployTokens::CreateService, Projects::DeployTokens::DestroyService, Projects::DestroyRollbackService, Projects::DestroyService, Projects::DetectRepositoryLanguagesService, Projects::DisableDeployKeyService, Projects::DownloadService, Projects::EnableDeployKeyService, Projects::ForkService, Projects::GitDeduplicationService, Projects::GroupLinks::CreateService, Projects::GroupLinks::DestroyService, Projects::GroupLinks::UpdateService, Projects::HashedStorage::BaseAttachmentService, Projects::HashedStorage::BaseRepositoryService, Projects::HashedStorage::MigrationService, Projects::HashedStorage::RollbackService, Projects::ImportExport::ExportService, Projects::ImportService, Projects::LfsPointers::LfsDownloadLinkListService, Projects::LfsPointers::LfsDownloadService, Projects::LfsPointers::LfsImportService, Projects::LfsPointers::LfsLinkService, Projects::LfsPointers::LfsListService, Projects::LfsPointers::LfsObjectDownloadListService, Projects::Operations::UpdateService, Projects::OverwriteProjectService, Projects::ParticipantsService, Projects::ReadmeRendererService, Projects::RecordTargetPlatformsService, Projects::RepositoryLanguagesService, Projects::TransferService, Projects::UnlinkForkService, Projects::UpdatePagesService, Projects::UpdateRemoteMirrorService, Projects::UpdateService, Projects::UpdateStatisticsService, Prometheus::CreateDefaultAlertsService, Prometheus::ProxyService, Prometheus::ProxyVariableSubstitutionService, ProtectedBranches::BaseService, ProtectedTags::CreateService, ProtectedTags::DestroyService, ProtectedTags::UpdateService, QuickActions::InterpretService, QuickActions::TargetService, Repositories::BaseService, ResetProjectCacheService, ResourceAccessTokens::CreateService, ResourceAccessTokens::RevokeService, Security::CiConfiguration::SastParserService, ServiceDeskSettings::UpdateService, Suggestions::ApplyService, Tags::CreateService, Tags::DestroyService, Terraform::RemoteStateHandler, UserPreferences::UpdateService, Users::ApproveService, Users::BannedUserBaseService, Users::BlockService, Users::BuildService, Users::CreateService, Users::RejectService, Users::SignupService, Users::UpdateHighestMemberRoleService, Users::UpdateService, Users::UpdateTodoCountCacheService, Users::UpsertCreditCardValidationService, Users::ValidateOtpService, VerifyPagesDomainService, Webauthn::AuthenticateService, Webauthn::RegisterService

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(project, user = nil, params = {}) ⇒ BaseService

Returns a new instance of BaseService.


16
17
18
19
20
# File 'app/services/base_service.rb', line 16

def initialize(project, user = nil, params = {})
  @project = project
  @current_user = user
  @params = params.dup
end

Instance Attribute Details

#current_userObject

Returns the value of attribute current_user.


14
15
16
# File 'app/services/base_service.rb', line 14

def current_user
  @current_user
end

#paramsObject

Returns the value of attribute params.


14
15
16
# File 'app/services/base_service.rb', line 14

def params
  @params
end

#projectObject

Returns the value of attribute project.


14
15
16
# File 'app/services/base_service.rb', line 14

def project
  @project
end