Skip to content

Commit

Permalink
feat: [CDE-192]: modularize gitspace services (harness#2396)
Browse files Browse the repository at this point in the history
* feat: [CDE-192]: modularize gitspace services
* feat: [CDE-192]: modularize gitspace services
  • Loading branch information
n00bitax authored and Harness committed Aug 5, 2024
1 parent 34a07f4 commit 6338af6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 55 deletions.
98 changes: 46 additions & 52 deletions app/api/controller/space/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,28 @@ func (s SpaceOutput) MarshalJSON() ([]byte, error) {
type Controller struct {
nestedSpacesEnabled bool

tx dbtx.Transactor
urlProvider url.Provider
sseStreamer sse.Streamer
identifierCheck check.SpaceIdentifier
authorizer authz.Authorizer
spacePathStore store.SpacePathStore
pipelineStore store.PipelineStore
secretStore store.SecretStore
connectorStore store.ConnectorStore
templateStore store.TemplateStore
spaceStore store.SpaceStore
repoStore store.RepoStore
principalStore store.PrincipalStore
repoCtrl *repo.Controller
membershipStore store.MembershipStore
importer *importer.Repository
exporter *exporter.Repository
resourceLimiter limiter.ResourceLimiter
publicAccess publicaccess.Service
auditService audit.Service
gitspaceSvc *gitspace.Service
gitspaceConfigStore store.GitspaceConfigStore
gitspaceInstanceStore store.GitspaceInstanceStore
labelSvc *label.Service
tx dbtx.Transactor
urlProvider url.Provider
sseStreamer sse.Streamer
identifierCheck check.SpaceIdentifier
authorizer authz.Authorizer
spacePathStore store.SpacePathStore
pipelineStore store.PipelineStore
secretStore store.SecretStore
connectorStore store.ConnectorStore
templateStore store.TemplateStore
spaceStore store.SpaceStore
repoStore store.RepoStore
principalStore store.PrincipalStore
repoCtrl *repo.Controller
membershipStore store.MembershipStore
importer *importer.Repository
exporter *exporter.Repository
resourceLimiter limiter.ResourceLimiter
publicAccess publicaccess.Service
auditService audit.Service
gitspaceSvc *gitspace.Service
labelSvc *label.Service
}

func NewController(config *types.Config, tx dbtx.Transactor, urlProvider url.Provider,
Expand All @@ -96,35 +94,31 @@ func NewController(config *types.Config, tx dbtx.Transactor, urlProvider url.Pro
repoStore store.RepoStore, principalStore store.PrincipalStore, repoCtrl *repo.Controller,
membershipStore store.MembershipStore, importer *importer.Repository, exporter *exporter.Repository,
limiter limiter.ResourceLimiter, publicAccess publicaccess.Service, auditService audit.Service,
gitspaceSvc *gitspace.Service,
gitspaceStore store.GitspaceConfigStore, gitspaceInstanceStore store.GitspaceInstanceStore,
labelSvc *label.Service,
gitspaceSvc *gitspace.Service, labelSvc *label.Service,
) *Controller {
return &Controller{
nestedSpacesEnabled: config.NestedSpacesEnabled,
tx: tx,
urlProvider: urlProvider,
sseStreamer: sseStreamer,
identifierCheck: identifierCheck,
authorizer: authorizer,
spacePathStore: spacePathStore,
pipelineStore: pipelineStore,
secretStore: secretStore,
connectorStore: connectorStore,
templateStore: templateStore,
spaceStore: spaceStore,
repoStore: repoStore,
principalStore: principalStore,
repoCtrl: repoCtrl,
membershipStore: membershipStore,
importer: importer,
exporter: exporter,
resourceLimiter: limiter,
publicAccess: publicAccess,
auditService: auditService,
gitspaceSvc: gitspaceSvc,
gitspaceConfigStore: gitspaceStore,
gitspaceInstanceStore: gitspaceInstanceStore,
labelSvc: labelSvc,
nestedSpacesEnabled: config.NestedSpacesEnabled,
tx: tx,
urlProvider: urlProvider,
sseStreamer: sseStreamer,
identifierCheck: identifierCheck,
authorizer: authorizer,
spacePathStore: spacePathStore,
pipelineStore: pipelineStore,
secretStore: secretStore,
connectorStore: connectorStore,
templateStore: templateStore,
spaceStore: spaceStore,
repoStore: repoStore,
principalStore: principalStore,
repoCtrl: repoCtrl,
membershipStore: membershipStore,
importer: importer,
exporter: exporter,
resourceLimiter: limiter,
publicAccess: publicAccess,
auditService: auditService,
gitspaceSvc: gitspaceSvc,
labelSvc: labelSvc,
}
}
2 changes: 0 additions & 2 deletions app/api/controller/space/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func ProvideController(config *types.Config, tx dbtx.Transactor, urlProvider url
repoCtrl *repo.Controller, membershipStore store.MembershipStore, importer *importer.Repository,
exporter *exporter.Repository, limiter limiter.ResourceLimiter, publicAccess publicaccess.Service,
auditService audit.Service, gitspaceService *gitspace.Service,
gitspaceConfigStore store.GitspaceConfigStore, instanceStore store.GitspaceInstanceStore,
labelSvc *label.Service,
) *Controller {
return NewController(config, tx, urlProvider, sseStreamer, identifierCheck, authorizer,
Expand All @@ -57,6 +56,5 @@ func ProvideController(config *types.Config, tx dbtx.Transactor, urlProvider url
repoCtrl, membershipStore, importer,
exporter, limiter, publicAccess,
auditService, gitspaceService,
gitspaceConfigStore, instanceStore,
labelSvc)
}
2 changes: 1 addition & 1 deletion cmd/gitness/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6338af6

Please sign in to comment.