Documentation
¶
Index ¶
- Constants
- type ApprovePlanRequest
- type CancelStepRequest
- type CancelStepResponse
- type CreateStepRetryResponse
- type IsRetryableResponse
- type Signal
- func (s *Signal) Cancel(ctx workflow.Context) error
- func (s *Signal) Execute(ctx workflow.Context) error
- func (s *Signal) RegisterUpdateHandlers(ctx workflow.Context) error
- func (s *Signal) SleepAfter() time.Duration
- func (s *Signal) Type() signal.SignalType
- func (s *Signal) Validate(ctx workflow.Context) error
- type WasRetriedResponse
Constants ¶
const ( DirectiveKey = "directive" DirectiveContinue = "continue" DirectiveSkipGroup = "skip-group" DirectiveStop = "stop" DirectiveRetry = "retry" DirectiveRetryGroup = "retry-group" DirectiveAwaitApproval = "await-approval" )
Directive constants — duplicated here to avoid import cycle with the flow package. The canonical definitions are in flow.DirectiveX.
const ( DenyViolationsKey = "deny_violations" WarnViolationsKey = "warn_violations" PassedPolicyIDsKey = "passed_policy_ids" )
Policy evaluation metadata keys
const SignalType signal.SignalType = "execute-workflow-step"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovePlanRequest ¶
type ApprovePlanRequest struct {
ApprovalResponseID string `json:"approval_response_id"`
ResponseType string `json:"response_type"`
}
ApprovePlanRequest is the input for the "approve-plan" update handler.
type CancelStepRequest ¶
type CancelStepRequest struct{}
CancelStepRequest is the input for the "cancel-step" update handler.
type CancelStepResponse ¶
type CancelStepResponse struct{}
CancelStepResponse is the response from the "cancel-step" update handler.
type CreateStepRetryResponse ¶
type CreateStepRetryResponse struct {
// Directive is the result directive written to the step: "retry" for a
// single-step clone, "retry-group" when the group should be retried.
Directive string `json:"directive"`
NewStepID string `json:"new_step_id"`
}
CreateStepRetryResponse is the response from the "create-step-retry" update handler.
type IsRetryableResponse ¶
type IsRetryableResponse struct {
Retryable bool `json:"retryable"`
Skippable bool `json:"skippable"`
AutoRetry bool `json:"auto_retry"`
MaxRetries int `json:"max_retries"`
MaxAutoRetries int `json:"max_auto_retries"`
RetryGroup bool `json:"retry_group"`
RetryIndex int `json:"retry_index"`
StepID string `json:"step_id"`
}
IsRetryableResponse is the response from the "is-retryable" update handler.
type Signal ¶
type Signal struct {
StepID string `json:"step_id"`
WorkflowID string `json:"workflow_id"`
// OwnerID is the entity that owns the queues (e.g. install ID).
OwnerID string `json:"owner_id"`
OwnerType string `json:"owner_type"`
// TargetQueueName is the queue where the inner signal (the actual step signal)
// gets enqueued for execution (e.g. "install-signals").
TargetQueueName string `json:"target_queue_name"`
// TargetQueueID, when set, is used directly for the inner signal dispatch,
// bypassing the OwnerID/TargetQueueName lookup.
TargetQueueID string `json:"target_queue_id,omitempty"`
// contains filtered or unexported fields
}
Signal encapsulates the full lifecycle of executing a single workflow step. When dispatched to the step queue (e.g. install-workflow-steps), it fetches all necessary state from the database and runs the complete step execution flow: status updates, inner signal dispatch, approval handling, policy checks, and noop plan detection.
func (*Signal) Cancel ¶
Cancel propagates cancellation to the inner signal if one is currently executing. The inner signal's Cancel() method is responsible for updating the underlying resource (e.g. stack run) status to cancelled.
func (*Signal) Execute ¶
Execute runs the full workflow step lifecycle. This replicates the logic from WorkflowConductor.executeFlowStep but as a self-contained signal that fetches its own state from the database.
func (*Signal) RegisterUpdateHandlers ¶
RegisterUpdateHandlers registers step-level update handlers on the handler workflow. Called by the handler framework after initializeState(), before Execute().
func (*Signal) SleepAfter ¶
func (*Signal) Type ¶
func (s *Signal) Type() signal.SignalType
type WasRetriedResponse ¶
type WasRetriedResponse struct{}
WasRetriedResponse is the response from the "was-retried" update handler.
Source Files
¶
- approval_approve.go
- approval_deny.go
- approval_skip.go
- await_approval.go
- clone.go
- directive.go
- execute_step.go
- init.go
- process_errors.go
- process_plan.go
- process_plan_auto_approval.go
- process_plan_noop.go
- process_plan_only.go
- process_plan_policy.go
- signal.go
- skip_steps.go
- step_description.go
- update_approve_plan.go
- update_cancel_step.go
- update_create_step_retry.go
- update_is_retryable.go
- update_step_finished.go
- update_was_retried.go