Documentation
¶
Overview ¶
Package store provides SQLite-backed persistence for git-ci.
Index ¶
- Constants
- func EnvironmentAllowsRef(environment Environment, ref string) bool
- type AcquireEnvironmentLeaseParams
- type AcquireEnvironmentLeaseResult
- type AcquireExecutionConcurrencyParams
- type AcquireExecutionConcurrencyResult
- type AnnotationLevel
- type AppendLogLineParams
- type AppendStepAnnotationParams
- type Artifact
- type AuditBucket
- type AuditEvent
- type AuditFacets
- type AuditFilter
- type AuditReport
- type CacheEntry
- type CreateArtifactParams
- type CreateDeploymentParams
- type CreateProjectParams
- type CreateTestReportParams
- type CreateWebhookEndpointParams
- type CreateWorkflowScheduleParams
- type DecideEnvironmentApprovalParams
- type Deployment
- type DeploymentEvent
- type DeploymentTarget
- type DeploymentTier
- type EnqueueJob
- type EnqueueReplayParams
- type EnqueueRollbackParams
- type EnqueueRunLineage
- type EnqueueRunParams
- type EnqueueStep
- type Environment
- type EnvironmentAccess
- type EnvironmentApprovalDecision
- type EnvironmentApprovalRequest
- type EnvironmentApprovalStatus
- type EnvironmentApprovalSummary
- type EnvironmentConcurrencyMode
- type EnvironmentLease
- type EnvironmentSecret
- type EnvironmentSecretEnvelope
- type ErrConflict
- type ErrInvalidStatusTransition
- type ErrManualJobPlay
- type ErrNotFound
- type ErrReplayEligibility
- type ErrRollbackEligibility
- type ExecutionConcurrencyLease
- type ExecutionConcurrencyScope
- type FinishJobAttemptParams
- type FinishStepLogSectionParams
- type Job
- type JobAttempt
- type JobGraph
- type JobWait
- type JobWaitReason
- type ListEnvironmentApprovalsParams
- type LogLine
- type LogSectionProvider
- type LogStream
- type ManualJobPlay
- type ManualJobPlayResult
- type ManualJobState
- type PauseJobParams
- type PauseManualJobParams
- type PlayManualJobParams
- type Project
- type ProjectCommitTrigger
- type PutCacheEntryParams
- type RecordWebhookDeliveryParams
- type RecordedWebhookDelivery
- type RecoveryResult
- type ReplayEligibility
- type ReplayJobOptions
- type RequestEnvironmentApprovalParams
- type RollbackEligibility
- type RollbackTarget
- type RollbackTargetView
- type Run
- type RunCancellation
- type RunGraph
- type RunLineage
- type RunLineageKind
- type RunReplayOptions
- type ScheduleClaim
- type Secret
- type SecretEnvelope
- type StartStepLogSectionParams
- type Status
- type Step
- type StepAnnotation
- type StepLogSection
- type Store
- func (s *Store) AcquireEnvironmentLease(ctx context.Context, params AcquireEnvironmentLeaseParams) (AcquireEnvironmentLeaseResult, error)
- func (s *Store) AcquireExecutionConcurrency(ctx context.Context, params AcquireExecutionConcurrencyParams) (AcquireExecutionConcurrencyResult, error)
- func (s *Store) AppendLogLine(ctx context.Context, params AppendLogLineParams) (LogLine, error)
- func (s *Store) AppendStepAnnotation(ctx context.Context, params AppendStepAnnotationParams) (StepAnnotation, error)
- func (s *Store) ClaimDueWorkflowSchedules(ctx context.Context, dueBefore time.Time, limit int) ([]ScheduleClaim, error)
- func (s *Store) ClaimNextQueuedRun(ctx context.Context, workerID string) (*Run, error)
- func (s *Store) Close() error
- func (s *Store) CommitTriggeredRunExists(ctx context.Context, workflowID, commitSHA string) (bool, error)
- func (s *Store) CreateArtifact(ctx context.Context, params CreateArtifactParams) (Artifact, error)
- func (s *Store) CreateDeployment(ctx context.Context, params CreateDeploymentParams) (Deployment, error)
- func (s *Store) CreateProject(ctx context.Context, params CreateProjectParams) (Project, error)
- func (s *Store) CreateTestReport(ctx context.Context, params CreateTestReportParams) (TestReport, error)
- func (s *Store) CreateWebhookEndpoint(ctx context.Context, params CreateWebhookEndpointParams) (WebhookEndpoint, error)
- func (s *Store) CreateWorkflowSchedule(ctx context.Context, params CreateWorkflowScheduleParams) (WorkflowSchedule, error)
- func (s *Store) DeactivateProject(ctx context.Context, key, confirmSlug string) (Project, error)
- func (s *Store) DecideEnvironmentApproval(ctx context.Context, params DecideEnvironmentApprovalParams) (EnvironmentApprovalRequest, error)
- func (s *Store) DeleteEnvironmentSecret(ctx context.Context, secretID string) error
- func (s *Store) DeleteSecret(ctx context.Context, secretID string) error
- func (s *Store) DeleteWebhookEndpoint(ctx context.Context, endpointID string) error
- func (s *Store) DeleteWorkflowSchedule(ctx context.Context, scheduleID string) error
- func (s *Store) EnqueueDeploymentRollback(ctx context.Context, params EnqueueRollbackParams) (Run, error)
- func (s *Store) EnqueueRun(ctx context.Context, params EnqueueRunParams) (Run, error)
- func (s *Store) EnqueueRunReplay(ctx context.Context, params EnqueueReplayParams) (Run, error)
- func (s *Store) EnsureDeploymentForJob(ctx context.Context, jobID string) (Deployment, error)
- func (s *Store) EnsureEnvironmentForJob(ctx context.Context, jobID string) (Environment, error)
- func (s *Store) EvaluateDeploymentRollback(ctx context.Context, sourceDeploymentID string) (RollbackEligibility, error)
- func (s *Store) EvaluateEnvironmentAccess(ctx context.Context, jobID string, now time.Time) (EnvironmentAccess, error)
- func (s *Store) EvaluateJobReplay(ctx context.Context, sourceJobID string) (ReplayEligibility, error)
- func (s *Store) EvaluateRunReplays(ctx context.Context, sourceRunID string) (RunReplayOptions, error)
- func (s *Store) EvaluateStepReplay(ctx context.Context, sourceStepID string) (ReplayEligibility, error)
- func (s *Store) FindCacheEntry(ctx context.Context, projectID string, refs []string, key string, ...) (CacheEntry, bool, error)
- func (s *Store) FinishJobAttempt(ctx context.Context, params FinishJobAttemptParams) (JobAttempt, error)
- func (s *Store) FinishStepLogSection(ctx context.Context, params FinishStepLogSectionParams) (StepLogSection, error)
- func (s *Store) GetArtifact(ctx context.Context, artifactID string) (Artifact, error)
- func (s *Store) GetDeployment(ctx context.Context, deploymentID string) (Deployment, error)
- func (s *Store) GetDeploymentTargetForJob(ctx context.Context, jobID string) (DeploymentTarget, error)
- func (s *Store) GetEnvironment(ctx context.Context, projectID, name string) (Environment, error)
- func (s *Store) GetEnvironmentApprovalRequest(ctx context.Context, requestID string) (EnvironmentApprovalRequest, error)
- func (s *Store) GetEnvironmentByID(ctx context.Context, environmentID string) (Environment, error)
- func (s *Store) GetEnvironmentSecretEnvelope(ctx context.Context, secretID string) (EnvironmentSecretEnvelope, error)
- func (s *Store) GetExecutionConcurrency(ctx context.Context, scope ExecutionConcurrencyScope, group string) (*ExecutionConcurrencyLease, error)
- func (s *Store) GetProject(ctx context.Context, key string) (Project, error)
- func (s *Store) GetProjectCommitTrigger(ctx context.Context, projectID string) (ProjectCommitTrigger, error)
- func (s *Store) GetReplaySourceRun(ctx context.Context, params EnqueueReplayParams) (Run, error)
- func (s *Store) GetRunArtifactByName(ctx context.Context, runID, name string) (Artifact, error)
- func (s *Store) GetRunCancellation(ctx context.Context, runID string) (RunCancellation, error)
- func (s *Store) GetRunGraph(ctx context.Context, runID string) (RunGraph, error)
- func (s *Store) GetRunLineage(ctx context.Context, runID string) (RunLineage, error)
- func (s *Store) GetRunLineageByIdempotency(ctx context.Context, actor, key string) (RunLineage, error)
- func (s *Store) GetSecret(ctx context.Context, secretID string) (Secret, error)
- func (s *Store) GetSecretEnvelope(ctx context.Context, secretID string) (SecretEnvelope, error)
- func (s *Store) GetWebhookEndpoint(ctx context.Context, endpointID string) (WebhookEndpoint, error)
- func (s *Store) GetWorkflow(ctx context.Context, workflowID string) (Workflow, error)
- func (s *Store) GetWorkflowSchedule(ctx context.Context, scheduleID string) (WorkflowSchedule, error)
- func (s *Store) HeartbeatRunWorker(ctx context.Context, runID, workerID string, now time.Time, ttl time.Duration) error
- func (s *Store) ListActiveProjects(ctx context.Context) ([]Project, error)
- func (s *Store) ListAudit(ctx context.Context, filter AuditFilter) (AuditReport, error)
- func (s *Store) ListDeploymentTargets(ctx context.Context, runID string) ([]DeploymentTarget, error)
- func (s *Store) ListDeployments(ctx context.Context, projectID string) ([]Deployment, error)
- func (s *Store) ListEnabledProjectCommitTriggers(ctx context.Context) ([]ProjectCommitTrigger, error)
- func (s *Store) ListEnvironmentApprovalDecisions(ctx context.Context, requestID string) ([]EnvironmentApprovalDecision, error)
- func (s *Store) ListEnvironmentApprovalRequests(ctx context.Context, params ListEnvironmentApprovalsParams) ([]EnvironmentApprovalSummary, error)
- func (s *Store) ListEnvironmentSecrets(ctx context.Context, environmentID string) ([]EnvironmentSecret, error)
- func (s *Store) ListEnvironments(ctx context.Context, projectID string) ([]Environment, error)
- func (s *Store) ListInactiveProjects(ctx context.Context) ([]Project, error)
- func (s *Store) ListJobWaits(ctx context.Context) ([]JobWait, error)
- func (s *Store) ListLogLines(ctx context.Context, stepID string) ([]LogLine, error)
- func (s *Store) ListProjectCaches(ctx context.Context, projectID string) ([]CacheEntry, error)
- func (s *Store) ListProjects(ctx context.Context) ([]Project, error)
- func (s *Store) ListRunArtifacts(ctx context.Context, runID string) ([]Artifact, error)
- func (s *Store) ListRunTestReports(ctx context.Context, runID string) ([]TestReport, error)
- func (s *Store) ListRuns(ctx context.Context, projectID string) ([]Run, error)
- func (s *Store) ListSecrets(ctx context.Context, projectID string) ([]Secret, error)
- func (s *Store) ListStepAnnotations(ctx context.Context, stepID string) ([]StepAnnotation, error)
- func (s *Store) ListStepLogSections(ctx context.Context, stepID string) ([]StepLogSection, error)
- func (s *Store) ListWebhookDeliveries(ctx context.Context, endpointID string) ([]WebhookDelivery, error)
- func (s *Store) ListWebhookEndpoints(ctx context.Context, projectID string) ([]WebhookEndpoint, error)
- func (s *Store) ListWorkflowSchedules(ctx context.Context, projectID string) ([]WorkflowSchedule, error)
- func (s *Store) ListWorkflows(ctx context.Context, projectID string) ([]Workflow, error)
- func (s *Store) MarkInterruptedRunningRunsFailed(ctx context.Context) (int, error)
- func (s *Store) PauseJob(ctx context.Context, params PauseJobParams) (JobWait, error)
- func (s *Store) PauseManualJob(ctx context.Context, params PauseManualJobParams) (ManualJobState, error)
- func (s *Store) PlayManualJob(ctx context.Context, params PlayManualJobParams) (ManualJobPlayResult, error)
- func (s *Store) PutCacheEntry(ctx context.Context, params PutCacheEntryParams) (CacheEntry, error)
- func (s *Store) RecordAudit(ctx context.Context, event AuditEvent) (AuditEvent, error)
- func (s *Store) RecordProjectCommitTriggerCheck(ctx context.Context, projectID string, observedSHA *string, triggered bool, ...) error
- func (s *Store) RecordWebhookDelivery(ctx context.Context, params RecordWebhookDeliveryParams) (RecordedWebhookDelivery, error)
- func (s *Store) RecoverExpiredRunWorkers(ctx context.Context, now, orphanBefore time.Time) (RecoveryResult, error)
- func (s *Store) ReleaseEnvironmentLease(ctx context.Context, environmentID, jobID, ownerID string) (bool, error)
- func (s *Store) ReleaseExecutionConcurrency(ctx context.Context, scope ExecutionConcurrencyScope, ...) (bool, error)
- func (s *Store) ReleaseRunWorker(ctx context.Context, runID, workerID string) error
- func (s *Store) RequestEnvironmentApproval(ctx context.Context, params RequestEnvironmentApprovalParams) (EnvironmentApprovalRequest, error)
- func (s *Store) RequestRunCancellation(ctx context.Context, runID string) (RunCancellation, error)
- func (s *Store) ResetJobForRetry(ctx context.Context, jobID, attemptID string) error
- func (s *Store) ResumeJob(ctx context.Context, runID, jobID string) error
- func (s *Store) SetProjectWorkflowSet(ctx context.Context, projectID string, keys []string) error
- func (s *Store) SetStepSummary(ctx context.Context, stepID, summary string) (Step, error)
- func (s *Store) StartJobAttempt(ctx context.Context, jobID string) (JobAttempt, error)
- func (s *Store) StartStepLogSection(ctx context.Context, params StartStepLogSectionParams) (StepLogSection, error)
- func (s *Store) TransitionDeployment(ctx context.Context, deploymentID string, next Status, reason *string) (Deployment, error)
- func (s *Store) TransitionJob(ctx context.Context, jobID string, next Status) (Job, error)
- func (s *Store) TransitionRun(ctx context.Context, runID string, next Status) (Run, error)
- func (s *Store) TransitionStep(ctx context.Context, stepID string, next Status) (Step, error)
- func (s *Store) TransitionWebhookDelivery(ctx context.Context, deliveryID string, next WebhookDeliveryStatus, ...) (WebhookDelivery, error)
- func (s *Store) UpdateWebhookEndpoint(ctx context.Context, endpointID string, params UpdateWebhookEndpointParams) (WebhookEndpoint, error)
- func (s *Store) UpdateWorkflowSchedule(ctx context.Context, scheduleID string, params UpdateWorkflowScheduleParams) (WorkflowSchedule, error)
- func (s *Store) UpsertEnvironment(ctx context.Context, params UpsertEnvironmentParams) (Environment, error)
- func (s *Store) UpsertEnvironmentSecret(ctx context.Context, params UpsertEnvironmentSecretParams) (EnvironmentSecret, error)
- func (s *Store) UpsertProjectCommitTrigger(ctx context.Context, params UpsertProjectCommitTriggerParams) (ProjectCommitTrigger, error)
- func (s *Store) UpsertSecret(ctx context.Context, params UpsertSecretParams) (Secret, error)
- func (s *Store) UpsertWorkflow(ctx context.Context, params UpsertWorkflowParams) (Workflow, error)
- type TestReport
- type UpdateWebhookEndpointParams
- type UpdateWorkflowScheduleParams
- type UpsertEnvironmentParams
- type UpsertEnvironmentSecretParams
- type UpsertProjectCommitTriggerParams
- type UpsertSecretParams
- type UpsertWorkflowParams
- type WebhookDelivery
- type WebhookDeliveryStatus
- type WebhookEndpoint
- type Workflow
- type WorkflowSchedule
Constants ¶
const ( AnnotationNotice AnnotationLevel = "notice" AnnotationWarning AnnotationLevel = "warning" AnnotationError AnnotationLevel = "error" MaxStepAnnotations = 50 MaxAnnotationMessageSize = 4 << 10 MaxAnnotationFieldSize = 1 << 10 )
const ( LogSectionGitHub LogSectionProvider = "github" LogSectionGitLab LogSectionProvider = "gitlab" MaxStepLogSections = 100 MaxLogSectionDepth = 32 MaxLogSectionNameSize = 1 << 10 )
const ( MaxManualPlayVariables = 32 MaxManualPlayValueBytes = 4096 MaxManualPlayVariableBytes = 16384 )
const MaxStepSummaryBytes = 1 << 20
MaxStepSummaryBytes is the durable per-step Markdown summary limit.
Variables ¶
This section is empty.
Functions ¶
func EnvironmentAllowsRef ¶
func EnvironmentAllowsRef(environment Environment, ref string) bool
Types ¶
type AcquireEnvironmentLeaseResult ¶
type AcquireEnvironmentLeaseResult struct {
Lease EnvironmentLease `json:"lease"`
Acquired bool `json:"acquired"`
}
type AcquireExecutionConcurrencyParams ¶ added in v0.6.0
type AcquireExecutionConcurrencyResult ¶ added in v0.6.0
type AcquireExecutionConcurrencyResult struct {
Lease ExecutionConcurrencyLease `json:"lease"`
Acquired bool `json:"acquired"`
}
type AnnotationLevel ¶ added in v0.19.0
type AnnotationLevel string
type AppendLogLineParams ¶
AppendLogLineParams is the input for one immutable log line. Message must represent a single line, but it may be empty.
type AppendStepAnnotationParams ¶ added in v0.19.0
type Artifact ¶ added in v0.7.0
type Artifact struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
RunID string `json:"runId"`
JobID string `json:"jobId"`
StepID *string `json:"stepId,omitempty"`
Name string `json:"name"`
Format string `json:"format"`
StorageKey string `json:"-"`
SHA256 string `json:"sha256"`
SizeBytes int64 `json:"sizeBytes"`
FileCount int `json:"fileCount"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
type AuditBucket ¶ added in v0.23.0
type AuditEvent ¶
type AuditEvent struct {
ID string `json:"id"`
ProjectID string `json:"projectId,omitempty"`
Action string `json:"action"`
Actor string `json:"actor,omitempty"`
ResourceType string `json:"resourceType,omitempty"`
ResourceID string `json:"resourceId,omitempty"`
Metadata json.RawMessage `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
}
AuditEvent is an immutable record of a meaningful store action. IDs and creation timestamps are assigned by Store when the event is recorded.
type AuditFacets ¶ added in v0.23.0
type AuditFilter ¶ added in v0.23.0
type AuditFilter struct {
ProjectID string `json:"projectId,omitempty"`
Actor string `json:"actor,omitempty"`
Action string `json:"action,omitempty"`
ResourceType string `json:"resourceType,omitempty"`
Search string `json:"q,omitempty"`
Since time.Time `json:"since,omitempty"`
Until time.Time `json:"until"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
AuditFilter bounds an immutable audit query. Until is inclusive; a zero Since value means all retained history.
type AuditReport ¶ added in v0.23.0
type AuditReport struct {
Items []AuditEvent `json:"items"`
Count int `json:"count"`
Total int `json:"total"`
Filter AuditFilter `json:"filter"`
Facets AuditFacets `json:"facets"`
Buckets []AuditBucket `json:"buckets"`
}
type CacheEntry ¶ added in v0.7.0
type CacheEntry struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Ref string `json:"ref"`
Key string `json:"key"`
StorageKey string `json:"-"`
SHA256 string `json:"sha256"`
SizeBytes int64 `json:"sizeBytes"`
FileCount int `json:"fileCount"`
CreatedAt time.Time `json:"createdAt"`
AccessedAt time.Time `json:"accessedAt"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
}
type CreateArtifactParams ¶ added in v0.7.0
type CreateDeploymentParams ¶
type CreateProjectParams ¶
type CreateProjectParams struct {
Slug string
Name string
SourceType string
CanonicalPath *string
RepositoryURL *string
DefaultBranch string
Active bool
}
CreateProjectParams contains the mutable input needed to create a project. IDs and timestamps are assigned by Store.
type CreateTestReportParams ¶ added in v0.7.0
type CreateWebhookEndpointParams ¶
type CreateWebhookEndpointParams struct {
ProjectID, Name, Provider string
TokenHash []byte
Metadata json.RawMessage
Enabled bool
}
type DecideEnvironmentApprovalParams ¶
type DecideEnvironmentApprovalParams struct {
RequestID string
Decision EnvironmentApprovalStatus
Actor string
Reason string
}
type Deployment ¶
type Deployment struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
RunID string `json:"runId"`
JobID *string `json:"jobId,omitempty"`
Environment string `json:"environment"`
DeploymentTier DeploymentTier `json:"deploymentTier"`
Status Status `json:"status"`
SourceDeploymentID *string `json:"sourceDeploymentId,omitempty"`
TargetDeploymentID *string `json:"targetDeploymentId,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
History []DeploymentEvent `json:"history,omitempty"`
}
type DeploymentEvent ¶
type DeploymentTarget ¶
type DeploymentTier ¶
type DeploymentTier string
const ( DeploymentTierProduction DeploymentTier = "production" DeploymentTierStaging DeploymentTier = "staging" DeploymentTierTesting DeploymentTier = "testing" DeploymentTierDevelopment DeploymentTier = "development" DeploymentTierOther DeploymentTier = "other" )
type EnqueueJob ¶
type EnqueueJob struct {
Key string
Name string
Runner string
EnvironmentName string
DeploymentTier string
Environment json.RawMessage
DependencyKeys json.RawMessage
AllowFailure bool
TimeoutMinutes int
RollbackCommand string
VerifyCommand string
Steps []EnqueueStep
}
EnqueueJob is an immutable job snapshot. DependencyKeys is a JSON array of job keys, and Environment is a JSON object. The slice order assigns the durable job position.
type EnqueueReplayParams ¶
type EnqueueReplayParams struct {
Kind RunLineageKind
SourceRunID, SourceJobID, SourceStepID string
Actor, IdempotencyKey string
ConfirmSuccessful bool
}
type EnqueueRollbackParams ¶
type EnqueueRollbackParams struct {
SourceDeploymentID, TargetDeploymentID, Actor, IdempotencyKey string
}
type EnqueueRunLineage ¶
type EnqueueRunLineage struct {
Kind RunLineageKind
SourceRunID, SourceJobID, SourceStepID string
SourceDeploymentID, TargetDeploymentID string
Actor, IdempotencyKey string
}
type EnqueueRunParams ¶
type EnqueueRunParams struct {
ProjectID string
WorkflowID string
TriggerType string
Ref string
CommitSHA string
SourcePath string
Environment json.RawMessage
Jobs []EnqueueJob
Lineage *EnqueueRunLineage
}
EnqueueRunParams contains all immutable execution input. Jobs and steps are copied into the run transaction; later workflow upserts cannot alter them.
type EnqueueStep ¶
type EnqueueStep struct {
Key string
Name string
Command string
Action string
WorkingDirectory string
TimeoutMinutes int
Shell string
AllowFailure bool
Environment json.RawMessage
}
EnqueueStep is an immutable step snapshot. Environment is a JSON object. The slice order assigns the durable step index.
type Environment ¶
type Environment struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Name string `json:"name"`
DeploymentTier DeploymentTier `json:"deploymentTier"`
Protected bool `json:"protected"`
RequiredApprovals int `json:"requiredApprovals"`
WaitTimerSeconds int `json:"waitTimerSeconds"`
AllowedRefs []string `json:"allowedRefs"`
ConcurrencyMode EnvironmentConcurrencyMode `json:"concurrencyMode"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type EnvironmentAccess ¶
type EnvironmentAccess struct {
Environment Environment `json:"environment"`
ProjectID string `json:"projectId"`
RunID string `json:"runId"`
JobID string `json:"jobId"`
Ref string `json:"ref"`
ApprovalStatus *EnvironmentApprovalStatus `json:"approvalStatus,omitempty"`
WaitUntil *time.Time `json:"waitUntil,omitempty"`
Ready bool `json:"ready"`
Reason string `json:"reason,omitempty"`
}
type EnvironmentApprovalRequest ¶
type EnvironmentApprovalRequest struct {
ID string `json:"id"`
EnvironmentID string `json:"environmentId"`
RunID string `json:"runId"`
JobID string `json:"jobId"`
Status EnvironmentApprovalStatus `json:"status"`
RequiredApprovals int `json:"requiredApprovals"`
RequestedBy string `json:"requestedBy"`
RequestedAt time.Time `json:"requestedAt"`
DecidedAt *time.Time `json:"decidedAt,omitempty"`
}
type EnvironmentApprovalStatus ¶
type EnvironmentApprovalStatus string
const ( EnvironmentApprovalPending EnvironmentApprovalStatus = "pending" EnvironmentApprovalApproved EnvironmentApprovalStatus = "approved" EnvironmentApprovalRejected EnvironmentApprovalStatus = "rejected" EnvironmentApprovalCancelled EnvironmentApprovalStatus = "cancelled" )
type EnvironmentApprovalSummary ¶
type EnvironmentApprovalSummary struct {
EnvironmentApprovalRequest
ProjectID string `json:"projectId"`
ProjectName string `json:"projectName"`
EnvironmentName string `json:"environmentName"`
DeploymentTier DeploymentTier `json:"deploymentTier"`
JobName string `json:"jobName"`
Ref *string `json:"ref,omitempty"`
CommitSHA *string `json:"commitSha,omitempty"`
}
type EnvironmentConcurrencyMode ¶
type EnvironmentConcurrencyMode string
const ( EnvironmentConcurrencyQueue EnvironmentConcurrencyMode = "queue" EnvironmentConcurrencyCancelInProgress EnvironmentConcurrencyMode = "cancel_in_progress" )
type EnvironmentLease ¶
type EnvironmentSecret ¶
type EnvironmentSecret struct {
ID string `json:"id"`
EnvironmentID string `json:"environmentId"`
Name string `json:"name"`
Provider *string `json:"provider,omitempty"`
Version *string `json:"version,omitempty"`
EncryptionAlgorithm string `json:"encryptionAlgorithm"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type EnvironmentSecretEnvelope ¶
type EnvironmentSecretEnvelope struct {
EnvironmentSecret
Nonce []byte `json:"-"`
Ciphertext []byte `json:"-"`
}
type ErrConflict ¶
ErrConflict reports that a unique or otherwise exclusive resource value is already in use. Callers can use errors.As to inspect the conflicting field.
func (*ErrConflict) Error ¶
func (e *ErrConflict) Error() string
func (*ErrConflict) Is ¶
func (e *ErrConflict) Is(target error) bool
Is makes all conflict errors comparable by category with errors.Is.
type ErrInvalidStatusTransition ¶
ErrInvalidStatusTransition reports an attempted lifecycle transition that cannot be performed from the resource's current state.
func (*ErrInvalidStatusTransition) Error ¶
func (e *ErrInvalidStatusTransition) Error() string
func (*ErrInvalidStatusTransition) Is ¶
func (e *ErrInvalidStatusTransition) Is(target error) bool
Is makes status-transition errors comparable by category with errors.Is.
type ErrManualJobPlay ¶ added in v0.24.0
type ErrManualJobPlay struct {
Code, Message string
}
func (*ErrManualJobPlay) Error ¶ added in v0.24.0
func (e *ErrManualJobPlay) Error() string
type ErrNotFound ¶
ErrNotFound reports that a requested store resource does not exist. Callers can use errors.As to inspect the resource and lookup key.
func (*ErrNotFound) Error ¶
func (e *ErrNotFound) Error() string
func (*ErrNotFound) Is ¶
func (e *ErrNotFound) Is(target error) bool
Is makes all not-found errors comparable by category with errors.Is.
type ErrReplayEligibility ¶
type ErrReplayEligibility struct{ Code, Message string }
func (*ErrReplayEligibility) Error ¶
func (err *ErrReplayEligibility) Error() string
type ErrRollbackEligibility ¶
type ErrRollbackEligibility struct{ Code, Message string }
func (*ErrRollbackEligibility) Error ¶
func (err *ErrRollbackEligibility) Error() string
type ExecutionConcurrencyLease ¶ added in v0.6.0
type ExecutionConcurrencyLease struct {
Scope ExecutionConcurrencyScope `json:"scope"`
Group string `json:"group"`
RunID string `json:"runId"`
HolderID string `json:"holderId"`
OwnerID string `json:"ownerId"`
AcquiredAt time.Time `json:"acquiredAt"`
HeartbeatAt time.Time `json:"heartbeatAt"`
ExpiresAt time.Time `json:"expiresAt"`
}
type ExecutionConcurrencyScope ¶ added in v0.6.0
type ExecutionConcurrencyScope string
const ( ExecutionConcurrencyWorkflow ExecutionConcurrencyScope = "workflow" ExecutionConcurrencyJob ExecutionConcurrencyScope = "job" )
type FinishJobAttemptParams ¶ added in v0.25.0
type FinishStepLogSectionParams ¶ added in v0.20.0
type Job ¶
type Job struct {
Attempts []JobAttempt `json:"attempts,omitempty"`
ID string `json:"id"`
RunID string `json:"runId"`
Key *string `json:"key,omitempty"`
Name string `json:"name"`
Status Status `json:"status"`
Runner *string `json:"runner,omitempty"`
Position int `json:"position"`
Environment json.RawMessage `json:"environment"`
DependencyKeys json.RawMessage `json:"dependencyKeys"`
AllowFailure bool `json:"allowFailure"`
TimeoutMinutes int `json:"timeoutMinutes"`
RollbackCommand *string `json:"-"`
VerifyCommand *string `json:"-"`
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ManualState *ManualJobState `json:"manualState,omitempty"`
ManualPlay *ManualJobPlay `json:"manualPlay,omitempty"`
}
Job is a durable job snapshot and its mutable lifecycle fields.
type JobAttempt ¶ added in v0.25.0
type JobAttempt struct {
ID string `json:"id"`
JobID string `json:"jobId"`
RunID string `json:"runId"`
AttemptNumber int `json:"attemptNumber"`
Status Status `json:"status"`
FailureKind string `json:"failureKind,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
Message string `json:"message,omitempty"`
WillRetry bool `json:"willRetry"`
StartedAt time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
}
type JobWaitReason ¶
type JobWaitReason string
const ( JobWaitApproval JobWaitReason = "approval" JobWaitTimer JobWaitReason = "timer" JobWaitConcurrency JobWaitReason = "concurrency" )
type ListEnvironmentApprovalsParams ¶
type ListEnvironmentApprovalsParams struct {
ProjectID string
Status EnvironmentApprovalStatus
}
type LogLine ¶
type LogLine struct {
ID string `json:"id"`
RunID string `json:"runId"`
JobID string `json:"jobId"`
StepID string `json:"stepId"`
Sequence int64 `json:"sequence"`
Stream LogStream `json:"stream"`
Message string `json:"message"`
CreatedAt time.Time `json:"createdAt"`
}
LogLine is one immutable, line-oriented worker output record.
type LogSectionProvider ¶ added in v0.20.0
type LogSectionProvider string
type ManualJobPlay ¶ added in v0.24.0
type ManualJobPlay struct {
ID string `json:"id"`
JobID string `json:"jobId"`
RunID string `json:"runId"`
Actor string `json:"actor"`
IdempotencyKey string `json:"idempotencyKey"`
Variables map[string]string `json:"variables"`
Confirmed bool `json:"confirmed"`
CreatedAt time.Time `json:"createdAt"`
}
type ManualJobPlayResult ¶ added in v0.24.0
type ManualJobPlayResult struct {
Run Run `json:"run"`
Job Job `json:"job"`
Play ManualJobPlay `json:"play"`
Idempotent bool `json:"idempotent"`
}
type ManualJobState ¶ added in v0.24.0
type PauseJobParams ¶
type PauseManualJobParams ¶ added in v0.24.0
type PlayManualJobParams ¶ added in v0.24.0
type Project ¶
type Project struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
SourceType string `json:"sourceType"`
CanonicalPath *string `json:"canonicalPath,omitempty"`
RepositoryURL *string `json:"repositoryUrl,omitempty"`
DefaultBranch string `json:"defaultBranch"`
Active bool `json:"active"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Project is a configured source repository or local checkout.
type ProjectCommitTrigger ¶ added in v0.6.0
type ProjectCommitTrigger struct {
ProjectID string `json:"projectId"`
Ref string `json:"ref"`
Enabled bool `json:"enabled"`
LastCommitSHA *string `json:"lastCommitSha,omitempty"`
LastCheckedAt *time.Time `json:"lastCheckedAt,omitempty"`
LastTriggeredAt *time.Time `json:"lastTriggeredAt,omitempty"`
LastError *string `json:"lastError,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type PutCacheEntryParams ¶ added in v0.7.0
type RecordWebhookDeliveryParams ¶
type RecordWebhookDeliveryParams struct {
EndpointID, ProviderDeliveryID, EventType, PayloadSHA256 string
Status WebhookDeliveryStatus
ErrorMessage *string
ProcessedAt *time.Time
}
type RecordedWebhookDelivery ¶
type RecordedWebhookDelivery struct {
Delivery WebhookDelivery `json:"delivery"`
Created bool `json:"created"`
}
type RecoveryResult ¶
type ReplayEligibility ¶
type ReplayEligibility struct {
Kind RunLineageKind `json:"kind"`
SourceRunID string `json:"sourceRunId"`
SourceJobID string `json:"sourceJobId"`
SourceStepID string `json:"sourceStepId,omitempty"`
Eligible bool `json:"eligible"`
Code string `json:"code"`
Message string `json:"message"`
CommitSHA string `json:"commitSha,omitempty"`
DependencyCount int `json:"dependencyCount"`
RequiresConfirmation bool `json:"requiresConfirmation"`
CleanWorkspace bool `json:"cleanWorkspace"`
DeploymentGate bool `json:"deploymentGate"`
}
type ReplayJobOptions ¶
type ReplayJobOptions struct {
Job ReplayEligibility `json:"job"`
Steps []ReplayEligibility `json:"steps"`
}
type RollbackEligibility ¶
type RollbackEligibility struct {
SourceDeploymentID string `json:"sourceDeploymentId"`
Eligible bool `json:"eligible"`
Code string `json:"code"`
Message string `json:"message"`
Targets []RollbackTargetView `json:"targets"`
}
type RollbackTarget ¶
type RollbackTarget struct {
DeploymentID, RunID, Ref, CommitSHA, JobName, CreatedAt string `json:"-"`
}
type RollbackTargetView ¶
type Run ¶
type Run struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
WorkflowID *string `json:"workflowId,omitempty"`
WorkflowKey *string `json:"workflowKey,omitempty"`
WorkflowRevision *int64 `json:"workflowRevision,omitempty"`
TriggerType string `json:"triggerType"`
Status Status `json:"status"`
Ref *string `json:"ref,omitempty"`
CommitSHA *string `json:"commitSha,omitempty"`
Environment json.RawMessage `json:"environment"`
CancellationRequested bool `json:"cancellationRequested"`
CancellationRequestedAt *time.Time `json:"cancellationRequestedAt,omitempty"`
WorkerID *string `json:"workerId,omitempty"`
ClaimedAt *time.Time `json:"claimedAt,omitempty"`
FailureReason *string `json:"failureReason,omitempty"`
SourcePath string `json:"sourcePath"`
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Run is the durable lifecycle record for one immutable workflow execution.
type RunCancellation ¶
type RunCancellation struct {
RunID string `json:"runId"`
Requested bool `json:"requested"`
RequestedAt *time.Time `json:"requestedAt,omitempty"`
}
RunCancellation is the durable cancellation signal read by the worker.
type RunGraph ¶
RunGraph is the durable graph view for one run. Dependency edges are the JSON dependency keys attached to each Job.
type RunLineage ¶
type RunLineage struct {
RunID string `json:"runId"`
Kind RunLineageKind `json:"kind"`
SourceRunID string `json:"sourceRunId"`
SourceJobID *string `json:"sourceJobId,omitempty"`
SourceStepID *string `json:"sourceStepId,omitempty"`
SourceDeploymentID *string `json:"sourceDeploymentId,omitempty"`
TargetDeploymentID *string `json:"targetDeploymentId,omitempty"`
Actor string `json:"actor"`
IdempotencyKey string `json:"idempotencyKey"`
CreatedAt time.Time `json:"createdAt"`
}
type RunLineageKind ¶
type RunLineageKind string
const ( RunLineageRollback RunLineageKind = "rollback" RunLineageJobReplay RunLineageKind = "job_replay" RunLineageStepReplay RunLineageKind = "step_replay" )
type RunReplayOptions ¶
type RunReplayOptions struct {
RunID string `json:"runId"`
Jobs []ReplayJobOptions `json:"jobs"`
}
type ScheduleClaim ¶
type ScheduleClaim struct {
Schedule WorkflowSchedule `json:"schedule"`
DueAt time.Time `json:"dueAt"`
ClaimedAt time.Time `json:"claimedAt"`
}
type Secret ¶
type Secret struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Name string `json:"name"`
Provider *string `json:"provider,omitempty"`
KeyReference *string `json:"keyReference,omitempty"`
Version *string `json:"version,omitempty"`
EncryptionAlgorithm string `json:"encryptionAlgorithm"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Secret is non-sensitive secret metadata. It intentionally cannot expose an encrypted envelope through JSON serialization.
type SecretEnvelope ¶
SecretEnvelope contains opaque encrypted secret bytes. Nonce and Ciphertext have explicit JSON exclusion to prevent accidental API plaintext exposure.
type StartStepLogSectionParams ¶ added in v0.20.0
type Step ¶
type Step struct {
ID string `json:"id"`
JobID string `json:"jobId"`
Key *string `json:"key,omitempty"`
Index int `json:"index"`
Name string `json:"name"`
Command *string `json:"command,omitempty"`
Status Status `json:"status"`
Environment json.RawMessage `json:"environment"`
Action *string `json:"action,omitempty"`
WorkingDirectory *string `json:"workingDirectory,omitempty"`
TimeoutMinutes int `json:"timeoutMinutes"`
Shell *string `json:"shell,omitempty"`
AllowFailure bool `json:"allowFailure"`
Summary string `json:"summary,omitempty"`
Annotations []StepAnnotation `json:"annotations,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Step is a durable step snapshot and its mutable lifecycle fields.
type StepAnnotation ¶ added in v0.19.0
type StepAnnotation struct {
ID string `json:"id"`
StepID string `json:"stepId"`
Level AnnotationLevel `json:"level"`
Message string `json:"message"`
Title string `json:"title,omitempty"`
File string `json:"file,omitempty"`
StartLine *int `json:"line,omitempty"`
EndLine *int `json:"endLine,omitempty"`
StartColumn *int `json:"column,omitempty"`
EndColumn *int `json:"endColumn,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
type StepLogSection ¶ added in v0.20.0
type StepLogSection struct {
ID string `json:"id"`
StepID string `json:"stepId"`
Provider LogSectionProvider `json:"provider"`
Name string `json:"name"`
Depth int `json:"depth"`
Collapsed bool `json:"collapsed"`
StartSequence int64 `json:"startSequence"`
EndSequence *int64 `json:"endSequence,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns a pool of SQLite connections and the schema stored in it.
func Open ¶
Open opens a SQLite database at databasePath, configures connection-level safety settings, and applies embedded migrations in filename order.
func (*Store) AcquireEnvironmentLease ¶
func (s *Store) AcquireEnvironmentLease(ctx context.Context, params AcquireEnvironmentLeaseParams) (AcquireEnvironmentLeaseResult, error)
func (*Store) AcquireExecutionConcurrency ¶ added in v0.6.0
func (s *Store) AcquireExecutionConcurrency(ctx context.Context, params AcquireExecutionConcurrencyParams) (AcquireExecutionConcurrencyResult, error)
func (*Store) AppendLogLine ¶
AppendLogLine appends one line with an atomically allocated per-run sequence number. It verifies that the requested step belongs to a durable run first.
func (*Store) AppendStepAnnotation ¶ added in v0.19.0
func (s *Store) AppendStepAnnotation(ctx context.Context, params AppendStepAnnotationParams) (StepAnnotation, error)
func (*Store) ClaimDueWorkflowSchedules ¶
func (s *Store) ClaimDueWorkflowSchedules(ctx context.Context, dueBefore time.Time, limit int) ([]ScheduleClaim, error)
ClaimDueWorkflowSchedules atomically reserves due schedules. A claim remains durable across a restart until UpdateWorkflowSchedule records the next run.
func (*Store) ClaimNextQueuedRun ¶
ClaimNextQueuedRun atomically claims the oldest non-cancelled queued run. A nil run and nil error mean that no work is currently available.
func (*Store) CommitTriggeredRunExists ¶ added in v0.6.0
func (*Store) CreateArtifact ¶ added in v0.7.0
func (*Store) CreateDeployment ¶
func (s *Store) CreateDeployment(ctx context.Context, params CreateDeploymentParams) (Deployment, error)
func (*Store) CreateProject ¶
CreateProject validates and persists a project. Slugs are unique.
func (*Store) CreateTestReport ¶ added in v0.7.0
func (s *Store) CreateTestReport(ctx context.Context, params CreateTestReportParams) (TestReport, error)
func (*Store) CreateWebhookEndpoint ¶
func (s *Store) CreateWebhookEndpoint(ctx context.Context, params CreateWebhookEndpointParams) (WebhookEndpoint, error)
func (*Store) CreateWorkflowSchedule ¶
func (s *Store) CreateWorkflowSchedule(ctx context.Context, params CreateWorkflowScheduleParams) (WorkflowSchedule, error)
func (*Store) DeactivateProject ¶ added in v0.21.0
DeactivateProject unregisters a project without deleting its checkout or history. Every asynchronous trigger source is disabled in the same SQLite transaction.
func (*Store) DecideEnvironmentApproval ¶
func (s *Store) DecideEnvironmentApproval(ctx context.Context, params DecideEnvironmentApprovalParams) (EnvironmentApprovalRequest, error)
func (*Store) DeleteEnvironmentSecret ¶
func (*Store) DeleteSecret ¶
func (*Store) DeleteWebhookEndpoint ¶
func (*Store) DeleteWorkflowSchedule ¶
func (*Store) EnqueueDeploymentRollback ¶
func (*Store) EnqueueRun ¶
EnqueueRun atomically stores a queued run and immutable snapshots of every job, step, environment, and dependency edge the worker will need.
func (*Store) EnqueueRunReplay ¶
func (*Store) EnsureDeploymentForJob ¶
func (*Store) EnsureEnvironmentForJob ¶
func (*Store) EvaluateDeploymentRollback ¶
func (*Store) EvaluateEnvironmentAccess ¶
func (*Store) EvaluateJobReplay ¶
func (*Store) EvaluateRunReplays ¶
func (*Store) EvaluateStepReplay ¶
func (*Store) FindCacheEntry ¶ added in v0.7.0
func (*Store) FinishJobAttempt ¶ added in v0.25.0
func (s *Store) FinishJobAttempt(ctx context.Context, params FinishJobAttemptParams) (JobAttempt, error)
func (*Store) FinishStepLogSection ¶ added in v0.20.0
func (s *Store) FinishStepLogSection(ctx context.Context, params FinishStepLogSectionParams) (StepLogSection, error)
func (*Store) GetArtifact ¶ added in v0.7.0
func (*Store) GetDeployment ¶
func (*Store) GetDeploymentTargetForJob ¶
func (*Store) GetEnvironment ¶
func (*Store) GetEnvironmentApprovalRequest ¶
func (*Store) GetEnvironmentByID ¶
func (*Store) GetEnvironmentSecretEnvelope ¶
func (*Store) GetExecutionConcurrency ¶ added in v0.6.0
func (s *Store) GetExecutionConcurrency(ctx context.Context, scope ExecutionConcurrencyScope, group string) (*ExecutionConcurrencyLease, error)
func (*Store) GetProject ¶
GetProject returns a project by either its opaque ID or its slug.
func (*Store) GetProjectCommitTrigger ¶ added in v0.6.0
func (*Store) GetReplaySourceRun ¶
func (*Store) GetRunArtifactByName ¶ added in v0.7.0
func (*Store) GetRunCancellation ¶
GetRunCancellation reads the durable cancellation signal for a run.
func (*Store) GetRunGraph ¶
GetRunGraph returns the run together with jobs and ordered steps. The job dependency graph is represented by each Job's immutable DependencyKeys.
func (*Store) GetRunLineage ¶
func (*Store) GetRunLineageByIdempotency ¶
func (*Store) GetSecret ¶
GetSecret returns metadata only. Use GetSecretEnvelope only in trusted code that is responsible for decrypting the value.
func (*Store) GetSecretEnvelope ¶
func (*Store) GetWebhookEndpoint ¶
func (*Store) GetWorkflow ¶
GetWorkflow returns a workflow by its opaque ID.
func (*Store) GetWorkflowSchedule ¶
func (*Store) HeartbeatRunWorker ¶
func (*Store) ListActiveProjects ¶ added in v0.21.0
ListActiveProjects returns projects available to operational surfaces.
func (*Store) ListAudit ¶ added in v0.23.0
func (s *Store) ListAudit(ctx context.Context, filter AuditFilter) (AuditReport, error)
ListAudit returns a stable newest-first page, facets, and a fixed twelve bucket histogram from the same SQLite filter contract.
func (*Store) ListDeploymentTargets ¶
func (*Store) ListDeployments ¶
func (*Store) ListEnabledProjectCommitTriggers ¶ added in v0.6.0
func (s *Store) ListEnabledProjectCommitTriggers(ctx context.Context) ([]ProjectCommitTrigger, error)
func (*Store) ListEnvironmentApprovalDecisions ¶
func (*Store) ListEnvironmentApprovalRequests ¶
func (s *Store) ListEnvironmentApprovalRequests(ctx context.Context, params ListEnvironmentApprovalsParams) ([]EnvironmentApprovalSummary, error)
func (*Store) ListEnvironmentSecrets ¶
func (*Store) ListEnvironments ¶
func (*Store) ListInactiveProjects ¶ added in v0.21.0
ListInactiveProjects returns unregistered projects whose history is retained.
func (*Store) ListLogLines ¶
ListLogLines returns every line for a step in its durable append order.
func (*Store) ListProjectCaches ¶ added in v0.7.0
func (*Store) ListProjects ¶
ListProjects returns every project, including inactive history, in stable order.
func (*Store) ListRunArtifacts ¶ added in v0.7.0
func (*Store) ListRunTestReports ¶ added in v0.7.0
func (*Store) ListSecrets ¶
ListSecrets returns metadata only, ordered by name then opaque ID.
func (*Store) ListStepAnnotations ¶ added in v0.19.0
func (*Store) ListStepLogSections ¶ added in v0.20.0
func (*Store) ListWebhookDeliveries ¶
func (*Store) ListWebhookEndpoints ¶
func (*Store) ListWorkflowSchedules ¶
func (*Store) ListWorkflows ¶
ListWorkflows returns all workflows for a project in stable key order.
func (*Store) MarkInterruptedRunningRunsFailed ¶
MarkInterruptedRunningRunsFailed finalizes work left running by an abrupt service stop. Running jobs and steps fail; queued descendants are skipped. It returns the number of interrupted runs finalized by this startup action.
func (*Store) PauseManualJob ¶ added in v0.24.0
func (s *Store) PauseManualJob(ctx context.Context, params PauseManualJobParams) (ManualJobState, error)
func (*Store) PlayManualJob ¶ added in v0.24.0
func (s *Store) PlayManualJob(ctx context.Context, params PlayManualJobParams) (ManualJobPlayResult, error)
func (*Store) PutCacheEntry ¶ added in v0.7.0
func (s *Store) PutCacheEntry(ctx context.Context, params PutCacheEntryParams) (CacheEntry, error)
func (*Store) RecordAudit ¶
func (s *Store) RecordAudit(ctx context.Context, event AuditEvent) (AuditEvent, error)
RecordAudit validates and appends an audit event. ProjectID is optional; if provided, it must identify an existing project.
func (*Store) RecordProjectCommitTriggerCheck ¶ added in v0.6.0
func (*Store) RecordWebhookDelivery ¶
func (s *Store) RecordWebhookDelivery(ctx context.Context, params RecordWebhookDeliveryParams) (RecordedWebhookDelivery, error)
func (*Store) RecoverExpiredRunWorkers ¶
func (*Store) ReleaseEnvironmentLease ¶
func (*Store) ReleaseExecutionConcurrency ¶ added in v0.6.0
func (*Store) ReleaseRunWorker ¶
func (*Store) RequestEnvironmentApproval ¶
func (s *Store) RequestEnvironmentApproval(ctx context.Context, params RequestEnvironmentApprovalParams) (EnvironmentApprovalRequest, error)
func (*Store) RequestRunCancellation ¶
RequestRunCancellation records a durable cancellation signal. Queued and waiting runs are cancelled transactionally, including their pending graph, waits, and deployment audit trail. Running workers read the signal and perform their own orderly cancellation.
func (*Store) ResetJobForRetry ¶ added in v0.25.0
func (*Store) SetProjectWorkflowSet ¶
SetProjectWorkflowSet marks exactly the supplied workflow keys active for a project. Historical workflow rows remain addressable by ID for immutable run history after their source files are removed.
func (*Store) SetStepSummary ¶ added in v0.16.0
SetStepSummary replaces the durable Markdown summary for one step. The execution layer redacts secrets before calling this storage boundary.
func (*Store) StartJobAttempt ¶ added in v0.25.0
func (*Store) StartStepLogSection ¶ added in v0.20.0
func (s *Store) StartStepLogSection(ctx context.Context, params StartStepLogSectionParams) (StepLogSection, error)
func (*Store) TransitionDeployment ¶
func (*Store) TransitionJob ¶
TransitionJob changes one job status only when the lifecycle transition is valid. It maintains started, finished, and updated timestamps atomically.
func (*Store) TransitionRun ¶
TransitionRun changes one run status only when the lifecycle transition is valid. It maintains started, finished, and updated timestamps atomically.
func (*Store) TransitionStep ¶
TransitionStep changes one step status only when the lifecycle transition is valid. It maintains started, finished, and updated timestamps atomically.
func (*Store) TransitionWebhookDelivery ¶
func (s *Store) TransitionWebhookDelivery(ctx context.Context, deliveryID string, next WebhookDeliveryStatus, message *string) (WebhookDelivery, error)
TransitionWebhookDelivery records the final processing result for a previously reserved delivery. Only received deliveries can transition.
func (*Store) UpdateWebhookEndpoint ¶
func (s *Store) UpdateWebhookEndpoint(ctx context.Context, endpointID string, params UpdateWebhookEndpointParams) (WebhookEndpoint, error)
func (*Store) UpdateWorkflowSchedule ¶
func (s *Store) UpdateWorkflowSchedule(ctx context.Context, scheduleID string, params UpdateWorkflowScheduleParams) (WorkflowSchedule, error)
func (*Store) UpsertEnvironment ¶
func (s *Store) UpsertEnvironment(ctx context.Context, params UpsertEnvironmentParams) (Environment, error)
func (*Store) UpsertEnvironmentSecret ¶
func (s *Store) UpsertEnvironmentSecret(ctx context.Context, params UpsertEnvironmentSecretParams) (EnvironmentSecret, error)
func (*Store) UpsertProjectCommitTrigger ¶ added in v0.6.0
func (s *Store) UpsertProjectCommitTrigger(ctx context.Context, params UpsertProjectCommitTriggerParams) (ProjectCommitTrigger, error)
func (*Store) UpsertSecret ¶
func (*Store) UpsertWorkflow ¶
UpsertWorkflow creates a workflow or replaces its current definition. An existing workflow keeps its ID and receives a monotonically increasing revision number.
type TestReport ¶ added in v0.7.0
type TestReport struct {
ID string `json:"id"`
ArtifactID *string `json:"artifactId,omitempty"`
ProjectID string `json:"projectId"`
RunID string `json:"runId"`
JobID string `json:"jobId"`
StepID *string `json:"stepId,omitempty"`
Format string `json:"format"`
Name string `json:"name"`
Tests int `json:"tests"`
Failures int `json:"failures"`
Errors int `json:"errors"`
Skipped int `json:"skipped"`
DurationSeconds float64 `json:"durationSeconds"`
CreatedAt time.Time `json:"createdAt"`
}
type UpdateWebhookEndpointParams ¶
type UpdateWebhookEndpointParams struct {
Provider string
TokenHash []byte
Metadata json.RawMessage
Enabled bool
}
type UpsertEnvironmentParams ¶
type UpsertEnvironmentParams struct {
ProjectID string
Name string
DeploymentTier DeploymentTier
Protected bool
RequiredApprovals int
WaitTimerSeconds int
AllowedRefs []string
ConcurrencyMode EnvironmentConcurrencyMode
}
type UpsertProjectCommitTriggerParams ¶ added in v0.6.0
type UpsertSecretParams ¶
type UpsertWorkflowParams ¶
type UpsertWorkflowParams struct {
ProjectID string
Key string
Name string
Definition json.RawMessage
Environment json.RawMessage
}
UpsertWorkflowParams contains the complete current definition for a workflow. Definition and Environment must be JSON objects.
type WebhookDelivery ¶
type WebhookDelivery struct {
ID string `json:"id"`
EndpointID string `json:"endpointId"`
ProviderDeliveryID string `json:"providerDeliveryId"`
EventType string `json:"eventType"`
PayloadSHA256 string `json:"payloadSha256"`
Status WebhookDeliveryStatus `json:"status"`
ErrorMessage *string `json:"errorMessage,omitempty"`
ReceivedAt time.Time `json:"receivedAt"`
ProcessedAt *time.Time `json:"processedAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type WebhookDeliveryStatus ¶
type WebhookDeliveryStatus string
const ( WebhookDeliveryReceived WebhookDeliveryStatus = "received" WebhookDeliveryAccepted WebhookDeliveryStatus = "accepted" WebhookDeliveryRejected WebhookDeliveryStatus = "rejected" WebhookDeliveryFailed WebhookDeliveryStatus = "failed" )
type WebhookEndpoint ¶
type WebhookEndpoint struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Name string `json:"name"`
Provider string `json:"provider"`
TokenHash []byte `json:"-"`
Metadata json.RawMessage `json:"metadata"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type Workflow ¶
type Workflow struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Key string `json:"key"`
Name string `json:"name"`
Definition json.RawMessage `json:"definition"`
Environment json.RawMessage `json:"environment"`
Revision int64 `json:"revision"`
Active bool `json:"active"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Workflow is a mutable workflow definition. Runs record the workflow's key and revision at enqueue time, while their job and step snapshots stay fixed.
type WorkflowSchedule ¶
type WorkflowSchedule struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
WorkflowID string `json:"workflowId"`
Cron string `json:"cron"`
Ref *string `json:"ref,omitempty"`
Timezone string `json:"timezone"`
Enabled bool `json:"enabled"`
NextRunAt *time.Time `json:"nextRunAt,omitempty"`
LastRunAt *time.Time `json:"lastRunAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Source Files
¶
- annotations.go
- audit.go
- commit_triggers.go
- configuration.go
- deployment_execution.go
- deployment_targets.go
- environment_approvals.go
- environment_leases.go
- environment_secrets.go
- environments.go
- errors.go
- execution.go
- execution_concurrency.go
- execution_data.go
- execution_waits.go
- job_attempts.go
- log_sections.go
- manual_jobs.go
- projects.go
- run_lineage.go
- store.go
- webhook_transition.go