Documentation
¶
Index ¶
- func BuildRepoURL(repo *tangled.Pipeline_TriggerRepo, devMode bool) string
- func LogFilePath(baseDir string, workflowID WorkflowId) string
- func PipelineEnvVars(tr *tangled.Pipeline_TriggerMetadata, pipelineId PipelineId, devMode bool) map[string]string
- type CloneStep
- type Engine
- type FileWorkflowLogger
- type LogKind
- type LogLine
- type NullLogger
- type Pipeline
- type PipelineId
- type SecretMask
- type StatusKind
- type Step
- type StepKind
- type StepStatus
- type Workflow
- type WorkflowId
- type WorkflowLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRepoURL ¶
func BuildRepoURL(repo *tangled.Pipeline_TriggerRepo, devMode bool) string
BuildRepoURL constructs the repository URL from repo metadata.
func LogFilePath ¶
func LogFilePath(baseDir string, workflowID WorkflowId) string
func PipelineEnvVars ¶
func PipelineEnvVars(tr *tangled.Pipeline_TriggerMetadata, pipelineId PipelineId, devMode bool) map[string]string
PipelineEnvVars extracts environment variables from pipeline trigger metadata. These are framework-provided variables that are injected into workflow steps.
Types ¶
type CloneStep ¶
type CloneStep struct {
// contains filtered or unexported fields
}
func BuildCloneStep ¶
func BuildCloneStep(twf tangled.Pipeline_Workflow, tr tangled.Pipeline_TriggerMetadata, dev bool) CloneStep
BuildCloneStep generates git clone commands. The caller must ensure the current working directory is set to the desired workspace directory before executing these commands.
The generated commands are: - git init - git remote add origin <url> - git fetch --depth=<d> --recurse-submodules=<yes|no> <sha> - git checkout FETCH_HEAD
Supports all trigger types (push, PR, manual) and clone options.
type Engine ¶
type Engine interface {
InitWorkflow(twf tangled.Pipeline_Workflow, tpl tangled.Pipeline) (*Workflow, error)
SetupWorkflow(ctx context.Context, wid WorkflowId, wf *Workflow, wfLogger WorkflowLogger) error
WorkflowTimeout() time.Duration
DestroyWorkflow(ctx context.Context, wid WorkflowId) error
RunStep(ctx context.Context, wid WorkflowId, w *Workflow, idx int, secrets []secrets.UnlockedSecret, wfLogger WorkflowLogger) error
}
type FileWorkflowLogger ¶
type FileWorkflowLogger struct {
// contains filtered or unexported fields
}
func (*FileWorkflowLogger) Close ¶
func (l *FileWorkflowLogger) Close() error
func (*FileWorkflowLogger) ControlWriter ¶
func (l *FileWorkflowLogger) ControlWriter(idx int, step Step, stepStatus StepStatus) io.Writer
type LogLine ¶
type LogLine struct {
Kind LogKind `json:"kind"`
Content string `json:"content"`
Time time.Time `json:"time"`
StepId int `json:"step_id"`
// fields if kind is "data"
Stream string `json:"stream,omitempty"`
// fields if kind is "control"
StepStatus StepStatus `json:"step_status,omitempty"`
StepKind StepKind `json:"step_kind,omitempty"`
StepCommand string `json:"step_command,omitempty"`
}
func NewControlLogLine ¶
func NewControlLogLine(idx int, step Step, status StepStatus) LogLine
type NullLogger ¶
type NullLogger struct{}
func (NullLogger) Close ¶
func (l NullLogger) Close() error
func (NullLogger) ControlWriter ¶
func (l NullLogger) ControlWriter(idx int, step Step, stepStatus StepStatus) io.Writer
type Pipeline ¶
type PipelineId ¶
func (*PipelineId) AtUri ¶
func (p *PipelineId) AtUri() syntax.ATURI
type SecretMask ¶
type SecretMask struct {
// contains filtered or unexported fields
}
SecretMask replaces secret values in strings with "***".
func NewSecretMask ¶
func NewSecretMask(values []string) *SecretMask
NewSecretMask creates a mask for the given secret values. Also registers base64-encoded variants of each secret.
func (*SecretMask) Mask ¶
func (m *SecretMask) Mask(input string) string
Mask replaces all registered secret values with "***".
type StatusKind ¶
type StatusKind string
var ( StatusKindPending StatusKind = "pending" StatusKindRunning StatusKind = "running" StatusKindFailed StatusKind = "failed" StatusKindTimeout StatusKind = "timeout" StatusKindCancelled StatusKind = "cancelled" StatusKindSuccess StatusKind = "success" StartStates [2]StatusKind = [2]StatusKind{ StatusKindPending, StatusKindRunning, } FinishStates [4]StatusKind = [4]StatusKind{ StatusKindFailed, StatusKindTimeout, StatusKindCancelled, StatusKindSuccess, } )
func (StatusKind) IsFinish ¶
func (s StatusKind) IsFinish() bool
func (StatusKind) IsStart ¶
func (s StatusKind) IsStart() bool
func (StatusKind) String ¶
func (s StatusKind) String() string
type StepStatus ¶
type StepStatus string
step status indicator in control log lines
var ( StepStatusStart StepStatus = "start" StepStatusEnd StepStatus = "end" )
type Workflow ¶
type WorkflowId ¶
type WorkflowId struct {
PipelineId
Name string
}
func (WorkflowId) String ¶
func (wid WorkflowId) String() string
type WorkflowLogger ¶
type WorkflowLogger interface {
Close() error
DataWriter(idx int, stream string) io.Writer
ControlWriter(idx int, step Step, stepStatus StepStatus) io.Writer
}
func NewFileWorkflowLogger ¶
func NewFileWorkflowLogger(baseDir string, wid WorkflowId, secretValues []string) (WorkflowLogger, error)
Source Files
¶
- clone.go
- engine.go
- logger.go
- models.go
- pipeline.go
- pipeline_env.go
- secret_mask.go