Documentation
¶
Index ¶
- Variables
- type CompleteRunParams
- type CreateRunParams
- type InterruptedRun
- type PipelineRun
- type Repository
- type RepositoryWithLogging
- func (_d RepositoryWithLogging) BindWorkerJob(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, ...) (err error)
- func (_d RepositoryWithLogging) CompleteRun(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (pp1 *PipelineRun, err error)
- func (_d RepositoryWithLogging) CreateRun(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (pp1 *PipelineRun, err error)
- func (_d RepositoryWithLogging) FindLatestRunByPipelineSlug(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (pp1 *PipelineRun, err error)
- func (_d RepositoryWithLogging) FindRunBySlug(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (pp1 *PipelineRun, err error)
- func (_d RepositoryWithLogging) InspectLogicalRun(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, ...) (pp1 *model.PipelineRunCompletion, err error)
- func (_d RepositoryWithLogging) ListCompletionDecisions(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, ...) (pa1 []model.PipelineCompletionDecision, err error)
- func (_d RepositoryWithLogging) ListInterruptedForSystem(ctx context.Context, d1 postgres.DBTX, t1 time.Time) (ia1 []InterruptedRun, err error)
- func (_d RepositoryWithLogging) ListRuns(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (ppa1 []*PipelineRun, err error)
- func (_d RepositoryWithLogging) LockRecoveryFence(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, ...) (err error)
- func (_d RepositoryWithLogging) MarkRunRunning(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (pp1 *PipelineRun, err error)
- func (_d RepositoryWithLogging) PreviousSuccess(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, ...) (sp1 *pipelineruntime.SuccessfulRun, err error)
- func (_d RepositoryWithLogging) UpdateRunSourceEvent(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (err error)
- type RunListFilters
Constants ¶
This section is empty.
Variables ¶
var ( ErrOrganizationNotFound = xerror.NotFound(xerror.Organization) ErrRunNotFound = xerror.NotFound(xerror.PipelineRun) ErrRunAlreadyExists = xerror.AlreadyExists(xerror.PipelineRun) )
Functions ¶
This section is empty.
Types ¶
type CompleteRunParams ¶
type CompleteRunParams struct {
PipelineVersionID int64
DeploymentID, DeploymentRevision *int64
DeploymentResolutionDigest *string
PipelineSlug string
Status string
DurationMs int64
StepCount int32
StepSlug string
ErrorSummary *string
FailureKind *string
FailureSide *string
StartedAt time.Time
EndedAt *time.Time
ReplayOfRunSlug *string
ReplayFromStep *string
Timeline json.RawMessage
Incremental pipelinerun.IncrementalRunSummary
IncrementalDiagnostics json.RawMessage
}
CompleteRunParams contains terminal execution fields for an accepted run.
type CreateRunParams ¶
type CreateRunParams struct {
WorkerJobID *int64
DeploymentID *int64
DeploymentRevision *int64
DeploymentResolutionDigest *string
PipelineVersionID int64
APIVersion string
PipelineSlug string
RunSlug string
Source pipelinerun.RunSourceSummary
RequestID *string
Status string
DurationMs int64
StepCount int32
StepSlug string
ErrorSummary *string
FailureKind *string
FailureSide *string
StartedAt time.Time
EndedAt *time.Time
ReplayOfRunSlug *string
ReplayFromStep *string
Timeline json.RawMessage
Incremental pipelinerun.IncrementalRunSummary
IncrementalDiagnostics json.RawMessage
}
CreateRunParams contains required fields to persist a pipeline run.
type InterruptedRun ¶
type InterruptedRun struct {
OrgSlug, ProjectSlug, EnvironmentSlug slug.Slug
RunSlug, JobState string
}
InterruptedRun is a bounded maintenance reference; it carries no queue payload.
type PipelineRun ¶
type PipelineRun struct {
WorkerJobID *int64
DeploymentID *int64
DeploymentRevision *int64
DeploymentResolutionDigest *string
PipelineVersionID int64
PipelineVersionSpecHash string
EnvironmentSlug string
APIVersion string
PipelineSlug string
RunSlug string
Source pipelinerun.RunSourceSummary
RequestID *string
Status string
DurationMs int64
StepCount int32
StepSlug string
ErrorSummary *string
FailureKind *string
FailureSide *string
StartedAt time.Time
EndedAt *time.Time
ReplayOfRunSlug *string
ReplayFromStep *string
Timeline json.RawMessage
Incremental pipelinerun.IncrementalRunSummary
IncrementalDiagnostics pipelinerun.IncrementalRunDiagnostics
CreatedAt time.Time
}
PipelineRun represents a persisted pipeline execution record.
type Repository ¶
type Repository interface {
BindWorkerJob(context.Context, postgres.DBTX, slug.Slug, slug.Slug, slug.Slug, string, int64) error
ListInterruptedForSystem(context.Context, postgres.DBTX, time.Time) ([]InterruptedRun, error)
LockRecoveryFence(context.Context, postgres.DBTX, slug.Slug, slug.Slug, slug.Slug, string) error
InspectLogicalRun(context.Context, postgres.DBTX, slug.Slug, slug.Slug, slug.Slug, slug.Slug) (*model.PipelineRunCompletion, error)
ListCompletionDecisions(context.Context, postgres.DBTX, slug.Slug, slug.Slug, slug.Slug, slug.Slug) ([]model.PipelineCompletionDecision, error)
PreviousSuccess(context.Context, postgres.DBTX, slug.Slug, slug.Slug, slug.Slug, slug.Slug, int64, time.Time) (*pipelineruntime.SuccessfulRun, error)
CreateRun(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
params *CreateRunParams,
) (*PipelineRun, error)
MarkRunRunning(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
pipelineSlug slug.Slug,
runSlug string,
startedAt time.Time,
timeline json.RawMessage,
) (*PipelineRun, error)
CompleteRun(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
runSlug string,
params *CompleteRunParams,
) (*PipelineRun, error)
FindRunBySlug(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
runSlug string,
) (*PipelineRun, error)
ListRuns(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
filters *RunListFilters,
req model.ListRequest,
) ([]*PipelineRun, error)
UpdateRunSourceEvent(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
runSlug string,
sourceEventSlug slug.Slug,
) error
FindLatestRunByPipelineSlug(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug, pipelineSlug slug.Slug,
) (*PipelineRun, error)
}
Repository provides pipeline run persistence operations.
func NewRepositoryWithLogging ¶
func NewRepositoryWithLogging(base Repository, logger *slog.Logger) Repository
NewRepositoryWithLogging wraps base with method completion logging.
type RepositoryWithLogging ¶
type RepositoryWithLogging struct {
// contains filtered or unexported fields
}
RepositoryWithLogging implements Repository with method completion logging.
func (RepositoryWithLogging) BindWorkerJob ¶
func (_d RepositoryWithLogging) BindWorkerJob(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, s3 slug.Slug, s4 string, i1 int64) (err error)
BindWorkerJob implements Repository.
func (RepositoryWithLogging) CompleteRun ¶
func (_d RepositoryWithLogging) CompleteRun(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, runSlug string, params *CompleteRunParams) (pp1 *PipelineRun, err error)
CompleteRun implements Repository.
func (RepositoryWithLogging) CreateRun ¶
func (_d RepositoryWithLogging) CreateRun(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, params *CreateRunParams) (pp1 *PipelineRun, err error)
CreateRun implements Repository.
func (RepositoryWithLogging) FindLatestRunByPipelineSlug ¶
func (_d RepositoryWithLogging) FindLatestRunByPipelineSlug(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, pipelineSlug slug.Slug) (pp1 *PipelineRun, err error)
FindLatestRunByPipelineSlug implements Repository.
func (RepositoryWithLogging) FindRunBySlug ¶
func (_d RepositoryWithLogging) FindRunBySlug(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, runSlug string) (pp1 *PipelineRun, err error)
FindRunBySlug implements Repository.
func (RepositoryWithLogging) InspectLogicalRun ¶
func (_d RepositoryWithLogging) InspectLogicalRun(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, s3 slug.Slug, s4 slug.Slug) (pp1 *model.PipelineRunCompletion, err error)
InspectLogicalRun implements Repository.
func (RepositoryWithLogging) ListCompletionDecisions ¶
func (_d RepositoryWithLogging) ListCompletionDecisions(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, s3 slug.Slug, s4 slug.Slug) (pa1 []model.PipelineCompletionDecision, err error)
ListCompletionDecisions implements Repository.
func (RepositoryWithLogging) ListInterruptedForSystem ¶
func (_d RepositoryWithLogging) ListInterruptedForSystem(ctx context.Context, d1 postgres.DBTX, t1 time.Time) (ia1 []InterruptedRun, err error)
ListInterruptedForSystem implements Repository.
func (RepositoryWithLogging) ListRuns ¶
func (_d RepositoryWithLogging) ListRuns(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, filters *RunListFilters, req model.ListRequest) (ppa1 []*PipelineRun, err error)
ListRuns implements Repository.
func (RepositoryWithLogging) LockRecoveryFence ¶
func (_d RepositoryWithLogging) LockRecoveryFence(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, s3 slug.Slug, s4 string) (err error)
LockRecoveryFence implements Repository.
func (RepositoryWithLogging) MarkRunRunning ¶
func (_d RepositoryWithLogging) MarkRunRunning(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, pipelineSlug slug.Slug, runSlug string, startedAt time.Time, timeline json.RawMessage) (pp1 *PipelineRun, err error)
MarkRunRunning implements Repository.
func (RepositoryWithLogging) PreviousSuccess ¶
func (_d RepositoryWithLogging) PreviousSuccess(ctx context.Context, d1 postgres.DBTX, s1 slug.Slug, s2 slug.Slug, s3 slug.Slug, s4 slug.Slug, i1 int64, t1 time.Time) (sp1 *pipelineruntime.SuccessfulRun, err error)
PreviousSuccess implements Repository.
func (RepositoryWithLogging) UpdateRunSourceEvent ¶
func (_d RepositoryWithLogging) UpdateRunSourceEvent(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, runSlug string, sourceEventSlug slug.Slug) (err error)
UpdateRunSourceEvent implements Repository.