gitops

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: BSD-3-Clause Imports: 38 Imported by: 0

Documentation

Overview

Package gitops owns GitOps synchronization, scheduling, persistence, and routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGitOpsSyncs

func RegisterGitOpsSyncs(api huma.API, syncService *GitOpsSyncService)

RegisterGitOpsSyncs registers all GitOps sync endpoints.

Types

type BrowseSyncFilesInput

type BrowseSyncFilesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	SyncID        string `path:"syncId" doc:"Sync ID"`
	Path          string `query:"path" doc:"Path to browse (optional)"`
}

type BrowseSyncFilesOutput

type BrowseSyncFilesOutput struct {
	Body base.ApiResponse[gitops.BrowseResponse]
}

type CreateGitOpsSyncInput

type CreateGitOpsSyncInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Body          gitops.CreateSyncRequest
}

type CreateGitOpsSyncOutput

type CreateGitOpsSyncOutput struct {
	Body base.ApiResponse[gitops.GitOpsSync]
}

type DeleteGitOpsSyncInput

type DeleteGitOpsSyncInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	SyncID        string `path:"syncId" doc:"Sync ID"`
}

type DeleteGitOpsSyncOutput

type DeleteGitOpsSyncOutput struct {
	Body base.ApiResponse[base.MessageResponse]
}

type GetGitOpsSyncInput

type GetGitOpsSyncInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	SyncID        string `path:"syncId" doc:"Sync ID"`
}

type GetGitOpsSyncOutput

type GetGitOpsSyncOutput struct {
	Body base.ApiResponse[gitops.GitOpsSync]
}

type GetSyncStatusInput

type GetSyncStatusInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	SyncID        string `path:"syncId" doc:"Sync ID"`
}

type GetSyncStatusOutput

type GetSyncStatusOutput struct {
	Body base.ApiResponse[gitops.SyncStatus]
}

type GitOpsSyncHandler

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

GitOpsSyncHandler handles GitOps sync management endpoints.

func (*GitOpsSyncHandler) BrowseFiles

BrowseFiles returns the file tree at the specified path in the repository.

func (*GitOpsSyncHandler) CreateSync

CreateSync creates a new GitOps sync.

func (*GitOpsSyncHandler) DeleteSync

DeleteSync deletes a GitOps sync by ID.

func (*GitOpsSyncHandler) GetStatus

GetStatus returns the current status of a GitOps sync.

func (*GitOpsSyncHandler) GetSync

GetSync returns a GitOps sync by ID.

func (*GitOpsSyncHandler) ImportSyncs

ImportSyncs imports multiple GitOps syncs.

func (*GitOpsSyncHandler) ListSyncs

ListSyncs returns a paginated list of GitOps syncs.

func (*GitOpsSyncHandler) PerformSync

func (h *GitOpsSyncHandler) PerformSync(ctx context.Context, input *PerformSyncInput) (*PerformSyncOutput, error)

PerformSync manually triggers a sync operation.

func (*GitOpsSyncHandler) UpdateSync

UpdateSync updates an existing GitOps sync.

type GitOpsSyncService

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

func NewGitOpsSyncService

func NewGitOpsSyncService(db *database.DB, repoService *gitrepo.GitRepositoryService, projectService *projectpkg.ProjectService, swarmService *swarm.SwarmService, eventService *event.EventService, settingsService *settings.SettingsService) *GitOpsSyncService

func (*GitOpsSyncService) BrowseFiles

func (s *GitOpsSyncService) BrowseFiles(ctx context.Context, environmentID, id string, path string) (*gitops.BrowseResponse, error)

func (*GitOpsSyncService) CleanupLeakedScratchDirsOnStartup

func (s *GitOpsSyncService) CleanupLeakedScratchDirsOnStartup(ctx context.Context) error

CleanupLeakedScratchDirsOnStartup removes orphaned GitOps scratch directories (.gitops-sync-stage-*, .gitops-backup-*, and the legacy "<name>.gitops-backup-<digits>" form) left in the projects directory by a crash or container restart that interrupted a sync mid-flight. These are Arcane-internal working dirs; left in place the filesystem discovery imports them as phantom projects. It is safe to run at startup because it executes before any sync job is registered, so nothing is mid-stage.

func (*GitOpsSyncService) CleanupOrphanedSyncsOnStartup

func (s *GitOpsSyncService) CleanupOrphanedSyncsOnStartup(ctx context.Context) error

func (*GitOpsSyncService) CreateSync

func (s *GitOpsSyncService) CreateSync(ctx context.Context, environmentID string, req gitops.CreateSyncRequest, actor common.User) (*projectpkg.GitOpsSync, error)

func (*GitOpsSyncService) DeleteSync

func (s *GitOpsSyncService) DeleteSync(ctx context.Context, environmentID, id string, actor common.User) error

func (*GitOpsSyncService) GetSyncByID

func (s *GitOpsSyncService) GetSyncByID(ctx context.Context, environmentID, id string) (*projectpkg.GitOpsSync, error)

func (*GitOpsSyncService) GetSyncStatus

func (s *GitOpsSyncService) GetSyncStatus(ctx context.Context, environmentID, id string) (*gitops.SyncStatus, error)

func (*GitOpsSyncService) GetSyncsPaginated

func (s *GitOpsSyncService) GetSyncsPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]gitops.GitOpsSync, pagination.Response, gitops.SyncCounts, error)

func (*GitOpsSyncService) ImportSyncs

func (*GitOpsSyncService) PerformSync

func (s *GitOpsSyncService) PerformSync(ctx context.Context, environmentID, id string, actor common.User) (*gitops.SyncResult, error)

func (*GitOpsSyncService) ReconcileDirectorySyncProjectsOnStartup

func (s *GitOpsSyncService) ReconcileDirectorySyncProjectsOnStartup(ctx context.Context) error

func (*GitOpsSyncService) RegisterAutoSyncJobsOnStartup

func (s *GitOpsSyncService) RegisterAutoSyncJobsOnStartup(ctx context.Context)

RegisterAutoSyncJobsOnStartup registers a dynamic job for every auto-sync-enabled sync and kicks an immediate run for any that are overdue. This replaces the old global polling job so existing syncs keep running after upgrade.

func (*GitOpsSyncService) SetScheduler

func (s *GitOpsSyncService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, admissionGate *actors.Gate[actors.AdmissionKey]) error

SetScheduler injects the job scheduler and the app lifecycle context. It must be called during bootstrap (after the service graph is built) before any per-sync jobs are registered. The lifecycle context is used for background sync kicks so they outlive the request/bootstrap goroutine that triggered them.

func (*GitOpsSyncService) UpdateSync

func (s *GitOpsSyncService) UpdateSync(ctx context.Context, environmentID, id string, req gitops.UpdateSyncRequest, actor common.User) (*projectpkg.GitOpsSync, error)

type ImportGitOpsSyncsInput

type ImportGitOpsSyncsInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Body          []gitops.ImportGitOpsSyncRequest
}

type ImportGitOpsSyncsOutput

type ImportGitOpsSyncsOutput struct {
	Body base.ApiResponse[gitops.ImportGitOpsSyncResponse]
}

type ListGitOpsSyncsInput

type ListGitOpsSyncsInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Search        string `query:"search" doc:"Search query"`
	Sort          string `query:"sort" doc:"Column to sort by"`
	Order         string `query:"order" default:"asc" doc:"Sort direction"`
	Start         int    `query:"start" default:"0" doc:"Start index"`
	Limit         int    `query:"limit" default:"20" doc:"Items per page"`
}

type ListGitOpsSyncsOutput

type ListGitOpsSyncsOutput struct {
	Body base.PaginatedWithCounts[gitops.GitOpsSync, gitops.SyncCounts]
}

type Module

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

func New

func New(service *GitOpsSyncService) *Module

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(api huma.API)

func (*Module) Service

func (m *Module) Service() *GitOpsSyncService

type PerformSyncInput

type PerformSyncInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	SyncID        string `path:"syncId" doc:"Sync ID"`
}

type PerformSyncOutput

type PerformSyncOutput struct {
	Body base.ApiResponse[gitops.SyncResult]
}

type UpdateGitOpsSyncInput

type UpdateGitOpsSyncInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	SyncID        string `path:"syncId" doc:"Sync ID"`
	Body          gitops.UpdateSyncRequest
}

type UpdateGitOpsSyncOutput

type UpdateGitOpsSyncOutput struct {
	Body base.ApiResponse[gitops.GitOpsSync]
}

Jump to

Keyboard shortcuts

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