Document usage of BaseContainerService vs. BaseProjectService
Item number 3 from the following discussion from !59182 (merged) should be addressed:
-
@.luke started a discussion: (+1 comment) Suggestion (not blocking)
This new base class makes a lot of sense. When I search through the codebase I notice some service classes that are inheriting from
BaseContainerService
, likePackages::Maven::Metadata::SyncService
as one example, that aliascontainer
toproject
which suggests that for a period of time people have been doing without thisBaseProjectService
and we find a new inconsistency between those services and services that do inherit from this new base class.I wonder if we can pre-empt some of the confusion about this:
- Update the comment on
BaseService
to say something like:
# 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.
-
Possibly also additionally update the comment on
BaseContainerService
to recommend choosing the more specificBaseProjectService
unless they need be container agnostic. -
We should probably spin off a separate docs change to add this advice to https://docs.gitlab.com/ee/development/reusing_abstractions.html#service-classes too.
- Update the comment on