starter

package
v0.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecipeJobType        = "recipe"
	RecipeArtifactSuffix = ".recipe.yaml"
)
View Source
const (
	JobMetadataVersion = 1

	MetaFieldVersion  jobdb.FieldName = "v"
	MetaFieldRecipe   jobdb.FieldName = "recipe"
	MetaFieldCellID   jobdb.FieldName = "cell_id"
	MetaFieldCellName jobdb.FieldName = "cell_name"
	MetaFieldRepo     jobdb.FieldName = "repo"
	MetaFieldGitRef   jobdb.FieldName = "git_ref"

	MetaFieldParentTenantID       jobdb.FieldName = "parent_tenant_id"
	MetaFieldParentJobID          jobdb.FieldName = "parent_job_id"
	MetaFieldParentJobType        jobdb.FieldName = "parent_job_type"
	MetaFieldParentOpType         jobdb.FieldName = "parent_op_type"
	MetaFieldParentOpStep         jobdb.FieldName = "parent_op_step"
	MetaFieldParentOpTaskType     jobdb.FieldName = "parent_op_task_type"
	MetaFieldParentCellName       jobdb.FieldName = "parent_cell_name"
	MetaFieldParentRepo           jobdb.FieldName = "parent_repo"
	MetaFieldParentGitRef         jobdb.FieldName = "parent_git_ref"
	MetaFieldParentInvocationPath jobdb.FieldName = "parent_invocation_path"
	MetaFieldParentInvocationSeq  jobdb.FieldName = "parent_invocation_seq"
	MetaFieldParentInvocationHash jobdb.FieldName = "parent_invocation_hash"
)

Variables

This section is empty.

Functions

func RestartRecipeJob

func RestartRecipeJob(ctx context.Context, engine recipeJobRestartSubmitter, prior jobdb.JobKey, stepOffset int64, patch *task.ContextPatch) (jobdb.JobKey, error)

RestartRecipeJob restarts an existing recipe job from the provided step offset.

stepOffset is the next chapter ordinal to execute (0-based). Internally SWF uses LastStepToKeep, so we keep chapters up to stepOffset-1.

If patch is non-nil, we inject a context patch envelope as the next chapter output to be replayed. This intentionally causes a swf.TaskInputMismatchError at replay time, allowing the recipe worker to detect and apply the patch before re-executing the task.

func StartRecipeJob

func StartRecipeJob(ctx context.Context, startJob workflowctl.StartJob, engine recipeJobSubmitter, recipes ...recipe.Recipe) (jobdb.JobKey, error)

func StartRecipeJobWithOptions

func StartRecipeJobWithOptions(ctx context.Context, startJob workflowctl.StartJob, engine recipeJobSubmitter, opts StartRecipeJobOptions, recipes ...recipe.Recipe) (jobdb.JobKey, error)

Types

type JobMetadata

type JobMetadata struct {
	Version          int    `json:"v"`
	RecipeName       string `json:"recipe,omitempty"`
	CellID           string `json:"cell_id,omitempty"`
	CellName         string `json:"cell_name,omitempty"`
	RepositorySource string `json:"repo,omitempty"`
	GitRef           string `json:"git_ref,omitempty"`

	ParentTenantID           string `json:"parent_tenant_id,omitempty"`
	ParentJobID              string `json:"parent_job_id,omitempty"`
	ParentJobType            string `json:"parent_job_type,omitempty"`
	ParentOpType             string `json:"parent_op_type,omitempty"`
	ParentOpStep             string `json:"parent_op_step,omitempty"`
	ParentOpTaskType         string `json:"parent_op_task_type,omitempty"`
	ParentCellName           string `json:"parent_cell_name,omitempty"`
	ParentRepositorySource   string `json:"parent_repo,omitempty"`
	ParentGitRef             string `json:"parent_git_ref,omitempty"`
	ParentInvocationPath     string `json:"parent_invocation_path,omitempty"`
	ParentInvocationSequence int64  `json:"parent_invocation_seq,omitempty"`
	ParentInvocationHash     string `json:"parent_invocation_hash,omitempty"`
}

func JobMetadataFromStartJob

func JobMetadataFromStartJob(startJob workflowctl.StartJob) JobMetadata

type StartRecipeJobOptions

type StartRecipeJobOptions struct {
	JobID         string
	Prerequisites []jobdb.JobPrerequisite
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL