Documentation
¶
Index ¶
- Constants
- func GetInvocationHash(inv Invocation) string
- type EnvironmentContext
- type EnvironmentPathContext
- type GitBaseContext
- type GitCommitContext
- type GitTask
- type Invocation
- type InvocationCtx
- type JobContext
- type RecipeSourceContext
- type RunOutput
- type StepOutput
- type TaskContext
- type TaskExecutionContext
- type WorkflowContext
Constants ¶
const ArtifactInboxSentinel = "__C2_SENTINEL_ARTIFACT_INBOX__"
const ArtifactOutboxSentinel = "__C2_SENTINEL_ARTIFACT_OUTBOX__"
const JobIdSentinel = "__C2_SENTINEL_JOB_ID__"
const OpArtifactInboxSentinel = "__C2_SENTINEL_OP_ARTIFACT_INBOX__"
const OpArtifactOutboxSentinel = "__C2_SENTINEL_OP_ARTIFACT_OUTBOX__"
const OpWorkdirPathSentinel = "__C2_SENTINEL_OP_WORKDIR__"
const OpWorktreePathSentinel = "__C2_SENTINEL_OP_WORKTREE__"
const WorkdirPathSentinel = "__C2_SENTINEL_WORKDIR__"
const WorktreePathSentinel = "__C2_SENTINEL_WORKTREE__"
WorktreePathSentinel is a placeholder value used during template resolution Templates that reference {{ environment.worktree_path }} will resolve to this sentinel The actual worktree path is determined at execution time on the target machine
Variables ¶
This section is empty.
Functions ¶
func GetInvocationHash ¶
func GetInvocationHash(inv Invocation) string
Hash returns a truncated hex-encoded SHA-256 hash over deterministic invocation fields.
Types ¶
type EnvironmentContext ¶
type EnvironmentContext struct {
WorktreePath string `json:"worktree_path,omitempty"`
WorkdirPath string `json:"workdir,omitempty"`
ArtifactInbox string `json:"inbox,omitempty"`
ArtifactOutbox string `json:"outbox,omitempty"`
Host EnvironmentPathContext `json:"host,omitempty"`
Op EnvironmentPathContext `json:"op,omitempty"`
}
EnvironmentContext captures filesystem and storage locations relevant to execution.
type EnvironmentPathContext ¶ added in v0.0.8
type GitBaseContext ¶
type GitBaseContext struct {
BaseRepo string `json:"repo,omitempty"`
BaseRef string `json:"ref,omitempty"`
ResolvedBaseHash string `json:"resolved_hash,omitempty"`
GitAuthor string `json:"author,omitempty"`
}
GitBaseContext captures immutable git state information at a point in time.
type GitCommitContext ¶
type GitCommitContext struct {
ParentRef string `json:"parent_ref,omitempty"` // ref carrying workspace state until a hash exists
PersistHash string `json:"hash,omitempty"` // materialized SHA after a commit is created
ParentHash string `json:"parent_hash,omitempty"` // resolved job parent/root SHA once materialized
}
WorkspaceResult captures the output of inline/detached workspace executions.
type GitTask ¶
type GitTask struct {
BaseRepo string `json:"repo,omitempty"`
BaseRef string `json:"ref,omitempty"`
ResolvedBaseHash string `json:"resolved_hash,omitempty"`
GitAuthor string `json:"author,omitempty"`
ParentRef string `json:"parent_ref,omitempty"` // ref carrying workspace state until a hash exists
PersistHash string `json:"hash,omitempty"` // materialized SHA after a commit is created
ParentHash string `json:"parent_hash,omitempty"` // resolved job parent/root SHA once materialized
}
type Invocation ¶
Invocation captures deterministic identifiers for an op execution.
type InvocationCtx ¶
type JobContext ¶
type JobContext struct {
Environment EnvironmentContext `json:"environment,omitempty"`
Artifacts map[string]artifacts.Ref `json:"artifacts,omitempty"`
Workflow WorkflowContext `json:"workflow,omitempty"`
GitBase GitBaseContext `json:"git,omitempty"`
RecipeSource RecipeSourceContext `json:"recipe_source,omitempty"`
}
ExecutionContext holds typed workflow context available to templates. It is created per task.
type RecipeSourceContext ¶
type RunOutput ¶
type RunOutput struct {
Outputs map[string]interface{} `json:"outputs"`
Artifacts map[string]artifacts.Ref `json:"artifacts"`
RunID string `json:"run_id"`
Timestamp time.Time `json:"timestamp"`
}
RunOutput represents a single execution run
type StepOutput ¶
type TaskContext ¶
type TaskContext struct {
// GitCommit is shared across entire ResolutionContext and often updated. Thus must be a pointer.
GitCommit *GitCommitContext
Invocation Invocation
}
type TaskExecutionContext ¶
type TaskExecutionContext struct {
// embed these directly from task and job contexts for easier resolution.
Environment EnvironmentContext `json:"environment,omitempty"`
Artifacts map[string]artifacts.Ref `json:"artifacts,omitempty"`
Workflow WorkflowContext `json:"workflow,omitempty"`
RecipeSource RecipeSourceContext `json:"recipe_source,omitempty"`
GitTask GitTask `json:"git,omitempty"`
Invocation InvocationCtx `json:"invocation,omitempty"`
}
func NewTaskExecutionContext ¶
func NewTaskExecutionContext(ctx JobContext, ctx2 TaskContext) TaskExecutionContext
func (TaskExecutionContext) JobContext ¶
func (t TaskExecutionContext) JobContext() JobContext