Class: BaseService

Inherits:
Object
  • Object
show all
Includes:
BaseServiceUtility
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.

TODO: New services should consider inheriting from

BaseContainerService, or create new base class:
https://gitlab.com/gitlab-org/gitlab/-/issues/216672

Direct Known Subclasses

AlertManagement::ProcessPrometheusAlertService, ApplicationSettings::BaseService, Auth::ContainerRegistryAuthenticationService, AuthorizedProjectUpdate::ProjectCreateService, AuthorizedProjectUpdate::ProjectGroupLinkCreateService, AutoMerge::BaseService, AutoMergeService, AwardEmojis::BaseService, Boards::BaseService, Branches::CreateService, Branches::DeleteMergedService, Branches::DeleteService, Branches::ValidateNewService, Ci::CompareReportsBaseService, Ci::CreateDownstreamPipelineService, Ci::CreateJobArtifactsService, Ci::CreatePipelineScheduleService, Ci::CreatePipelineService, Ci::CreateWebIdeTerminalService, Ci::DestroyPipelineService, Ci::EnsureStageService, Ci::ExternalPullRequests::CreatePipelineService, Ci::ExtractSectionsFromBuildTraceService, Ci::FindExposedArtifactsService, Ci::ParseDotenvArtifactService, Ci::PipelineBridgeStatusService, Ci::PipelineScheduleService, Ci::PipelineTriggerService, Ci::PlayBuildService, Ci::PlayManualStageService, Ci::ProcessBuildService, Ci::ResourceGroups::AssignResourceFromResourceGroupService, Ci::RetryBuildService, Ci::RetryPipelineService, Ci::RunScheduledBuildService, Ci::StopEnvironmentsService, Ci::UnlockArtifactsService, Ci::WebIdeConfigService, Clusters::ParseClusterApplicationsArtifactService, Commits::CreateService, Commits::TagService, ContainerExpirationPolicyService, DesignManagement::DesignService, Discussions::BaseService, DraftNotes::BaseService, Environments::ResetAutoStopService, ErrorTracking::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, Grafana::ProxyService, Groups::BaseService, Import::BaseService, IncidentManagement::CreateIncidentLabelService, IncidentManagement::Incidents::CreateService, IncidentManagement::PagerDuty::CreateIncidentIssueService, IncidentManagement::PagerDuty::ProcessWebhookService, Issuable::CommonSystemNotesService, IssuableBaseService, IssuableLinks::CreateService, IssuableLinks::DestroyService, JiraConnectSubscriptions::BaseService, Labels::BaseService, Lfs::LockFileService, Lfs::LocksFinderService, Lfs::UnlockFileService, Mattermost::CreateTeamService, Members::BaseService, MergeRequests::LinkLfsObjectsService, 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::CreatePackageService, Packages::Maven::FindOrCreatePackageService, Packages::Nuget::CreateDependencyService, Packages::Nuget::SearchService, Packages::RemoveTagService, Pages::DeleteService, PersonalAccessTokens::CreateService, PodLogs::BaseService, PreviewMarkdownService, Projects::Alerting::NotifyService, Projects::AutoDevops::DisableService, Projects::AutocompleteService, Projects::BaseMoveRelationsService, Projects::CleanupService, Projects::ContainerRepository::CleanupTagsService, 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::HousekeepingService, 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::Prometheus::Alerts::CreateService, Projects::Prometheus::Alerts::DestroyService, Projects::Prometheus::Alerts::NotifyService, Projects::Prometheus::Alerts::UpdateService, Projects::RepositoryLanguagesService, Projects::TransferService, Projects::UnlinkForkService, Projects::UpdatePagesConfigurationService, Projects::UpdatePagesService, Projects::UpdateRemoteMirrorService, Projects::UpdateService, Projects::UpdateStatisticsService, Prometheus::CreateDefaultAlertsService, Prometheus::ProxyService, Prometheus::ProxyVariableSubstitutionService, ProtectedBranches::ApiService, ProtectedBranches::CreateService, ProtectedBranches::DestroyService, ProtectedBranches::LegacyApiCreateService, ProtectedBranches::LegacyApiUpdateService, ProtectedBranches::UpdateService, ProtectedTags::CreateService, ProtectedTags::DestroyService, ProtectedTags::UpdateService, QuickActions::InterpretService, QuickActions::TargetService, Releases::CreateService, Releases::DestroyService, Releases::UpdateService, Repositories::BaseService, ResetProjectCacheService, ResourceAccessTokens::CreateService, ResourceAccessTokens::RevokeService, ServiceDeskSettings::UpdateService, Snippets::BaseService, Suggestions::ApplyService, Tags::CreateService, Tags::DestroyService, Terraform::RemoteStateHandler, Users::BlockService, Users::BuildService, Users::CreateService, Users::SignupService, Users::UpdateHighestMemberRoleService, Users::UpdateService, 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.


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

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

Instance Attribute Details

#current_userObject

Returns the value of attribute current_user


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

def current_user
  @current_user
end

#paramsObject

Returns the value of attribute params


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

def params
  @params
end

#projectObject

Returns the value of attribute project


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

def project
  @project
end