orchestrate

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoStacksEnqueued = errors.New("no stacks enqueued")

ErrNoStacksEnqueued is returned when all stacks were skipped or failed to enqueue.

Functions

This section is empty.

Types

type EnqueueStacksResult

type EnqueueStacksResult struct {
	StackIDs []string
	Errors   []string
}

EnqueueStacksResult holds the outcome of an enqueue operation.

type ScanOrchestrator

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

ScanOrchestrator handles the full lifecycle of starting a scan: acquiring the project lock, cloning the workspace, discovering stacks, detecting versions, and spawning the lock renewal goroutine.

func New

func New(cfg *config.Config, q *queue.Queue) *ScanOrchestrator

func (*ScanOrchestrator) EnqueueStacks

func (o *ScanOrchestrator) EnqueueStacks(ctx context.Context, scan *queue.Scan, projectCfg *config.ProjectConfig, stacks []string, trigger, commit, actor string) (*EnqueueStacksResult, error)

EnqueueStacks sets the scan total, batch-enqueues stack scans, and adjusts scan counters for any skips or failures. Returns ErrNoStacksEnqueued if nothing was successfully enqueued (scan is auto-cancelled in that case).

func (*ScanOrchestrator) StartAndEnqueue

func (o *ScanOrchestrator) StartAndEnqueue(ctx context.Context, projectCfg *config.ProjectConfig, trigger, commit, actor string) (*queue.Scan, *EnqueueStacksResult, error)

StartAndEnqueue starts a scan and enqueues all discovered stacks.

func (*ScanOrchestrator) StartAndEnqueueStacks

func (o *ScanOrchestrator) StartAndEnqueueStacks(ctx context.Context, projectCfg *config.ProjectConfig, stacks []string, trigger, commit, actor string) (*queue.Scan, *EnqueueStacksResult, error)

StartAndEnqueueStacks starts a scan and enqueues a specific stack list.

func (*ScanOrchestrator) StartScan

func (o *ScanOrchestrator) StartScan(ctx context.Context, projectCfg *config.ProjectConfig, trigger, commit, actor string) (*queue.Scan, []string, error)

StartScan acquires a project lock (cancelling an in-flight scan if allowed), clones the workspace, discovers stacks, detects versions, and spawns a background lock renewal goroutine. On any failure, the scan is marked failed.

func (*ScanOrchestrator) Stop

func (o *ScanOrchestrator) Stop()

Stop cancels all in-flight lock renewal goroutines and waits for them to exit.

Jump to

Keyboard shortcuts

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