projectssvc

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectNotFound      = projects.ErrNotFound
	ErrSlugTaken            = projects.ErrSlugTaken
	ErrPipelineBackendTaken = projects.ErrPipelineBackendTaken
)
View Source
var (
	ErrPipelineBackendDataSourceUnavailable    = xerror.Unavailable(xerror.DataSource)
	ErrPipelineBackendDataSourceTypeNotAllowed = xerror.InvalidInput(xerror.DataSource)
	ErrPipelineBackendReadOnly                 = xerror.InvalidInput(xerror.DataSource)
	ErrPipelineBackendTrackedBranchInvalid     = xerror.InvalidInput(xerror.Project)
	ErrPipelineBackendDataSourceChanged        = xerror.New(
		xerror.KindInvalidInput,
		"PROJECT_PIPELINE_BACKEND_DATA_SOURCE_CHANGED",
		"project pipeline backend data source changed",
	)
	ErrPipelineBackendReconcileFailed = xerror.New(
		xerror.KindInvalidInput,
		"PROJECT_PIPELINE_BACKEND_RECONCILE_FAILED",
		"project pipeline backend reconcile failed",
	)
)
View Source
var ErrInvalidProjectSlug = xerror.InvalidInput(xerror.Project)
View Source
var ErrRepositorySetupSourceTestRequired = xerror.New(
	xerror.KindInvalidInput,
	"PROJECT_REPOSITORY_SETUP_SOURCE_TEST_REQUIRED",
	"Test the saved repository connection successfully, then resume repository setup. Ask an organization admin if you cannot test connections.",
)

Functions

This section is empty.

Types

type Option

type Option func(*service)

Option specializes project service composition without widening the public service contract used by tests and local combined-mode development.

func WithRemotePipelineBackendExecution

func WithRemotePipelineBackendExecution(executor pipelinegit.RemoteSourceExecutor, maxBytes int64) Option

WithRemotePipelineBackendExecution routes project-backend adoption through the isolated executor instead of cloning tenant-controlled Git in-process.

type RepositorySetupService

type RepositorySetupService struct {
	// contains filtered or unexported fields
}

func NewRepositorySetupService

func NewRepositorySetupService(txm postgres.TransactionManager, repo narrowSetupRepository, projects narrowProjectsService, sources narrowDataSourceService, bootstrapper narrowGitLabBootstrapper, github repositorySetupGitHub, credentials repositorySetupCredentials, events workerproducer.EventProducer, preparationPolicy repositoryPreparationPolicy) (*RepositorySetupService, error)

func (*RepositorySetupService) Abandon

func (s *RepositorySetupService) Abandon(ctx context.Context, org, project, setup slug.Slug, preserveResources bool, actor model.EventActor) (*model.ProjectRepositorySetup, error)

func (*RepositorySetupService) CompleteGitHub

func (*RepositorySetupService) CompleteGitLab

func (s *RepositorySetupService) CompleteGitLab(ctx context.Context, org, project, setup slug.Slug, actor model.EventActor, authorization model.GitLabRepositoryAuthorization) (*model.ProjectRepositorySetup, error)

func (*RepositorySetupService) Create

func (*RepositorySetupService) Get

func (*RepositorySetupService) GetAttempt

func (s *RepositorySetupService) GetAttempt(ctx context.Context, org, project, setup slug.Slug) (*model.ProjectRepositorySetup, error)

func (*RepositorySetupService) RejectGitHubAuthorization

func (s *RepositorySetupService) RejectGitHubAuthorization(ctx context.Context, org, setup slug.Slug, actor model.EventActor, state, providerError string) (*model.ProjectRepositorySetup, error)

func (*RepositorySetupService) RejectGitLabAuthorization

func (s *RepositorySetupService) RejectGitLabAuthorization(ctx context.Context, org, project, setup slug.Slug, actor model.EventActor, state, providerError string) (*model.ProjectRepositorySetup, error)

type RepositorySourceService

RepositorySourceService retains core creation while distributions select persistence.

type Service

type Service interface {
	CreateProject(
		ctx context.Context,
		orgSlug slug.Slug,
		newProject model.NewProject,
		actor model.EventActor,
	) (*model.Project, error)
	GetProject(ctx context.Context, orgSlug, projectSlug slug.Slug) (*model.Project, error)
	ListProjects(
		ctx context.Context,
		orgSlug slug.Slug,
		req model.ListRequest,
	) (model.ListResponse[model.Project], error)
	UpdateProject(
		ctx context.Context,
		orgSlug, projectSlug slug.Slug,
		update model.UpdateProject,
		actor model.EventActor,
	) (*model.Project, error)
	SetProjectPipelineBackend(
		ctx context.Context,
		orgSlug, projectSlug slug.Slug,
		params model.SetProjectPipelineBackend,
	) (*model.Project, error)
	DeleteProject(
		ctx context.Context,
		orgSlug, projectSlug slug.Slug,
		options model.DeleteProjectOptions,
		actor model.EventActor,
	) error
}

func New

func New(
	txm postgres.TransactionManager,
	projectsRepo projects.Repository,
	orgsRepo projectBackendOrganizationRepository,
	environmentsRepo defaultProjectEnvironmentRepository,
	dataSourcesService pipelineBackendDataSourceService,
	pipelineStore projectPipelineStore,
	pipelineGitProducer workerproducer.PipelineGitProducer,
	repositoryManager pipelinegit.RepositoryManager,
	eventProducer workerproducer.EventProducer,
	options ...Option,
) Service

func NewServiceWithLogging

func NewServiceWithLogging(base Service, logger *slog.Logger) Service

NewServiceWithLogging wraps base with method completion logging.

type ServiceWithLogging

type ServiceWithLogging struct {
	// contains filtered or unexported fields
}

ServiceWithLogging implements Service with method completion logging.

func (ServiceWithLogging) CreateProject

func (_d ServiceWithLogging) CreateProject(ctx context.Context, orgSlug slug.Slug, newProject model.NewProject, actor model.EventActor) (pp1 *model.Project, err error)

CreateProject implements Service.

func (ServiceWithLogging) DeleteProject

func (_d ServiceWithLogging) DeleteProject(ctx context.Context, orgSlug slug.Slug, projectSlug slug.Slug, options model.DeleteProjectOptions, actor model.EventActor) (err error)

DeleteProject implements Service.

func (ServiceWithLogging) GetProject

func (_d ServiceWithLogging) GetProject(ctx context.Context, orgSlug slug.Slug, projectSlug slug.Slug) (pp1 *model.Project, err error)

GetProject implements Service.

func (ServiceWithLogging) ListProjects

func (_d ServiceWithLogging) ListProjects(ctx context.Context, orgSlug slug.Slug, req model.ListRequest) (p1 model.ListResponse[model.Project], err error)

ListProjects implements Service.

func (ServiceWithLogging) SetProjectPipelineBackend

func (_d ServiceWithLogging) SetProjectPipelineBackend(ctx context.Context, orgSlug slug.Slug, projectSlug slug.Slug, params model.SetProjectPipelineBackend) (pp1 *model.Project, err error)

SetProjectPipelineBackend implements Service.

func (ServiceWithLogging) UpdateProject

func (_d ServiceWithLogging) UpdateProject(ctx context.Context, orgSlug slug.Slug, projectSlug slug.Slug, update model.UpdateProject, actor model.EventActor) (pp1 *model.Project, err error)

UpdateProject implements Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL