pipeline

package
v1.336.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 40 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2026 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-FileCopyrightText: 2025 Forkbomb BV

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

View Source
const (
	GitHubPRCommentConfigKey                  = "github_pr_comment"
	GitHubPRCommentConfigRepositoryKey        = "repository"
	GitHubPRCommentConfigPullRequestNumberKey = "pull_request_number"
	GitHubPRCommentConfigCommitSHAKey         = "commit_sha"
	GitHubPRCommentConfigPipelineIDKey        = "pipeline_id"
	GitHubPRCommentConfigPipelineURLKey       = "pipeline_url"
	GitHubPRCommentConfigAppURLKey            = "app_url"
	GitHubPRCommentConfigSectionTitleKey      = "section_title"
)
View Source
const (
	PipelineTaskQueue = "PipelineTaskQueue"

	PipelineMobileDevicesQuery = "GetPipelineMobileDevices"
)
View Source
const (
	DefaultNameSpace                = "default"
	DefaultExecutionTimeout         = "24h"
	DefaultActivityScheduleTimeout  = "10m"
	DefaultActivityStartTimeout     = "5m"
	DefaultActivityHeartbeatTimeout = "30s"
	DefaultRetryMaxAttempts         = int32(5)
	DefaultRetryInitialInterval     = "5s"
	DefaultRetryMaxInterval         = "1m"
	DefaultRetryBackoff             = 2.0
)
View Source
const CompletionNotificationConfigKey = "pipeline_completion_notification"

CompletionNotificationConfigKey marks queued runs that should send a web push notification when they reach a terminal state. The queue handler injects it for every run it starts, directly or through the semaphore.

View Source
const MobileExternalSourceVersionID = "installed_from_external_source"

MobileExternalSourceVersionID is the version_id of a wallet installed outside Credimi, for example from the Play Store, instead of from an uploaded installer.

Variables

This section is empty.

Functions

func ConformanceCheckCleanupHook

func ConformanceCheckCleanupHook(
	ctx workflow.Context,
	wfDef *pipeline.WorkflowDefinition,
	_ *workflow.ActivityOptions,
	_ map[string]any,
	_ map[string]any,
	output *map[string]any,
) error

func ConformanceCheckSetupHook

func ConformanceCheckSetupHook(
	ctx workflow.Context,
	wfDef *pipeline.WorkflowDefinition,
	config map[string]any,
	runData *map[string]any,
	_ *map[string]any,
	_ log.Logger,
) error

func DecodePayload

func DecodePayload(s *pipeline.StepDefinition) (any, error)

func DeviceIDsWithGlobal

func DeviceIDsWithGlobal(info PipelineDeviceInfo, globalDeviceID string) []string

func Execute

func Execute(
	s *pipeline.StepDefinition,
	ctx workflow.Context,
	globalCfg map[string]any,
	dataCtx map[string]any,
	ao workflow.ActivityOptions,
) (any, error)

func ExecuteEventStepsOnError

func ExecuteEventStepsOnError(
	ctx workflow.Context,
	eventSteps []*pipeline.OnErrorStepDefinition,
	stepInputs map[string]any,
	existingFailures []pipelineStepFailure,
	ao workflow.ActivityOptions,
	config map[string]any,
) []pipelineStepFailure

func ExecuteEventStepsOnSuccess

func ExecuteEventStepsOnSuccess(
	ctx workflow.Context,
	eventSteps []*pipeline.OnSuccessStepDefinition,
	stepInputs map[string]any,
	existingFailures []pipelineStepFailure,
	ao workflow.ActivityOptions,
	config map[string]any,
) []pipelineStepFailure

func ExecuteOnError

func ExecuteOnError(
	s *pipeline.OnErrorStepDefinition,
	ctx workflow.Context,
	globalCfg map[string]any,
	dataCtx map[string]any,
	ao workflow.ActivityOptions,
) (any, error)

func ExecuteOnSuccess

func ExecuteOnSuccess(
	s *pipeline.OnSuccessStepDefinition,
	ctx workflow.Context,
	globalCfg map[string]any,
	dataCtx map[string]any,
	ao workflow.ActivityOptions,
) (any, error)

func ExecuteStep

func ExecuteStep(
	id string,
	use string,
	with pipeline.StepInputs,
	activityOptions *pipeline.ActivityOptionsConfig,
	ctx workflow.Context,
	globalCfg map[string]any,
	dataCtx map[string]any,
	ao workflow.ActivityOptions,
) (any, error)

func ExtractPipelineOutput

func ExtractPipelineOutput(dataCtx map[string]any) map[string]any

func GlobalDeviceIDFromConfig

func GlobalDeviceIDFromConfig(config map[string]any) string

func MergePayload

func MergePayload(dst, src *map[string]any) error

MergePayload merges all keys from src into dst recursively.

func MobileAutomationCleanupHook

func MobileAutomationCleanupHook(
	ctx workflow.Context,
	_ *pipeline.WorkflowDefinition,
	ao *workflow.ActivityOptions,
	config map[string]any,
	runData map[string]any,
	output *map[string]any,
) error

func MobileAutomationSetupHook

func MobileAutomationSetupHook(
	ctx workflow.Context,
	wfDef *pipeline.WorkflowDefinition,
	config map[string]any,
	runData *map[string]any,
	_ *map[string]any,
	_ log.Logger,
) error

func PipelineEvidenceSetupHook

func PipelineEvidenceSetupHook(
	ctx workflow.Context,
	wfDef *pipelineinternal.WorkflowDefinition,
	_ map[string]any,
	runData *map[string]any,
	finalOutput *map[string]any,
	logger log.Logger,
) error

PipelineEvidenceSetupHook extracts issuer and verifier evidence for the pipeline's credential-offer and use-case-verification-deeplink steps in a single activity, before the steps run. The activity generates its own deeplinks: a verifier serves a request object only once, so evidence cannot reuse the deeplink the wallet receives.

func PipelineReportCleanupHook

func PipelineReportCleanupHook(
	ctx workflow.Context,
	wfDef *pipelineinternal.WorkflowDefinition,
	ao *workflow.ActivityOptions,
	config map[string]any,
	runData map[string]any,
	finalOutput *map[string]any,
) error

func ReportMobileDeviceSemaphoreDone added in v1.330.0

func ReportMobileDeviceSemaphoreDone(
	ctx workflow.Context,
	logger log.Logger,
	config map[string]any,
	workflowID string,
	runID string,
	workflowResult string,
)

ReportMobileDeviceSemaphoreDone tells the leader device semaphore that the run of a semaphore ticket ended, so the ticket's devices are released. It does nothing without the injected mobile_device_semaphore_* config keys and only logs a failed report.

func ResolveDeviceRecord

func ResolveDeviceRecord(
	app core.App,
	deviceID string,
	deviceCache map[string]map[string]any,
) map[string]any

func ResolveDeviceRecords

func ResolveDeviceRecords(
	app core.App,
	deviceIDs []string,
	deviceCache map[string]map[string]any,
) []map[string]any

func RunIdentifier

func RunIdentifier(namespace, workflowID, runID string) string

RunIdentifier is the canonical pipeline run identifier used for runner workspaces and artifacts.

func SetConfigValue

func SetConfigValue(config *map[string]any, key string, val any)

func SetPayloadValue

func SetPayloadValue(payload *map[string]any, key string, val any) error

SetPayloadValue sets a key/value pair in the given payload map. If the key exists, it overwrites it; otherwise, it adds it.

func SetRunDataValue

func SetRunDataValue(runData *map[string]any, key string, val any)

func ValidateDeviceIDYAML

func ValidateDeviceIDYAML(yamlStr string) error

ValidateDeviceIDYAML enforces the mobile device_id configuration rule.

func ValidateFinallySteps

func ValidateFinallySteps(finallyDef pipeline.FinallyDefinition) error

Types

type CleanupFunc

type CleanupFunc func(
	ctx workflow.Context,
	wfDef *pipeline.WorkflowDefinition,
	ao *workflow.ActivityOptions,
	config map[string]any,
	runData map[string]any,
	output *map[string]any,
) error

type ConformanceTemplateActivity

type ConformanceTemplateActivity struct {
	workflowengine.BaseActivity
}

ConformanceTemplateActivity reads a conformance check's config and StepCI templates outside workflow code.

func NewConformanceTemplateActivity

func NewConformanceTemplateActivity() *ConformanceTemplateActivity

NewConformanceTemplateActivity returns the "Resolve conformance check template" activity.

func (*ConformanceTemplateActivity) Execute

Execute resolves the check's config template, suite extras and StepCI template.

func (*ConformanceTemplateActivity) Name

Name returns the registered activity name.

type ConformanceTemplateActivityPayload

type ConformanceTemplateActivityPayload struct {
	CheckID string `json:"check_id" validate:"required"`
	StepID  string `json:"step_id"`
}

ConformanceTemplateActivityPayload names the conformance check to resolve.

type DebugActivity

type DebugActivity struct {
	workflowengine.BaseActivity
}

func NewDebugActivity

func NewDebugActivity() *DebugActivity

func (*DebugActivity) Execute

func (*DebugActivity) Name

func (a *DebugActivity) Name() string

type DebugActivityPayload

type DebugActivityPayload struct {
	Step    string         `json:"step"    yaml:"step"`
	Outputs map[string]any `json:"outputs" yaml:"outputs"`
	Inputs  map[string]any `json:"inputs"  yaml:"inputs"`
}

type LinkedStepsWorkflow added in v1.326.0

type LinkedStepsWorkflow struct{}

LinkedStepsWorkflow runs a block of linked steps once each. Temporal retries the whole workflow, so every attempt starts again from the block's first step: a deeplink a step produces is single use, and a retry of its consumer alone would reuse it.

func NewLinkedStepsWorkflow added in v1.326.0

func NewLinkedStepsWorkflow() *LinkedStepsWorkflow

NewLinkedStepsWorkflow returns the workflow that runs a block of linked steps.

func (LinkedStepsWorkflow) Name added in v1.326.0

func (LinkedStepsWorkflow) Name() string

Name returns the Temporal workflow type of a linked steps block.

func (*LinkedStepsWorkflow) Workflow added in v1.326.0

Workflow runs the block once, as the current Temporal attempt.

type LinkedStepsWorkflowInput added in v1.326.0

type LinkedStepsWorkflowInput struct {
	Steps []pipeline.StepDefinition `json:"steps"`
	// PipelineConfig is never sent as "config": pipelinehistory maps a child's
	// config.step_id to a main step.
	PipelineConfig  map[string]any           `json:"pipeline_config"`
	Payload         map[string]any           `json:"payload"`
	PriorOutputs    map[string]any           `json:"prior_outputs"`
	FailedSteps     []string                 `json:"failed_steps"`
	HasFailures     bool                     `json:"has_failures"`
	PipelineName    string                   `json:"pipeline_name"`
	PipelineURL     string                   `json:"pipeline_url"`
	ActivityOptions workflow.ActivityOptions `json:"activity_options"`
	MaximumAttempts int32                    `json:"maximum_attempts"`
	Debug           bool                     `json:"debug"`
}

LinkedStepsWorkflowInput carries the block and the pipeline context its steps resolve their inputs against.

type MobileDeviceRequest added in v1.330.0

type MobileDeviceRequest struct {
	DeviceID          string // canonified device path
	VersionIdentifier string // wallet version identifier to install
	StepID            string // label used in errors and run identifiers
	RunIdentifier     string
	// PackageID is the package of an app installed outside Credimi, with
	// VersionIdentifier MobileExternalSourceVersionID. Its `installed` entry
	// only provides PreparedMobileDevice.PackageID: cleanup removes the app by
	// the diff against the initial_installed_apps recorded at prepare.
	PackageID string
}

MobileDeviceRequest names one device to prepare for a run.

type PipelineDeviceInfo

type PipelineDeviceInfo struct {
	DeviceIDs         []string
	NeedsGlobalDevice bool
}

func DeviceInfoFromDefinition

func DeviceInfoFromDefinition(wfDef *pipeline.WorkflowDefinition) PipelineDeviceInfo

DeviceInfoFromDefinition collects mobile device IDs from a parsed workflow definition.

func ParsePipelineDeviceInfo

func ParsePipelineDeviceInfo(yamlStr string) (PipelineDeviceInfo, error)

type PipelineWorkflow

type PipelineWorkflow struct{}

func NewPipelineWorkflow

func NewPipelineWorkflow() *PipelineWorkflow

func (PipelineWorkflow) GetOptions

func (PipelineWorkflow) Name

func (PipelineWorkflow) Name() string

func (*PipelineWorkflow) Start

func (w *PipelineWorkflow) Start(
	inputYaml string,
	config map[string]any,
	memo map[string]any,
	pipelineIdentifier string,
) (workflowengine.WorkflowResult, error)

Start launches the pipeline workflow via Temporal client

func (*PipelineWorkflow) Workflow

func (w *PipelineWorkflow) Workflow(
	ctx workflow.Context,
	input PipelineWorkflowInput,
) (result workflowengine.WorkflowResult, finalErr error)

Workflow executes all steps in the workflow definition sequentially

type PipelineWorkflowInput

type PipelineWorkflowInput struct {
	WorkflowDefinition *pipeline.WorkflowDefinition `yaml:"workflow_definition" json:"workflow_definition"`
	WorkflowInput      workflowengine.WorkflowInput `yaml:"workflow_input"      json:"workflow_input"`

	Debug         bool           `yaml:"debug,omitempty"           json:"debug,omitempty"`
	ParentRunData map[string]any `yaml:"parent_run_data,omitempty" json:"parent_run_data,omitempty"`
	// ReturnOutputs lists the main step outputs the caller references, so the run returns
	// them in its result. Nil, as for a top-level run, returns no step outputs;
	// pipeline.AllStepOutputs returns all of them.
	ReturnOutputs []string `yaml:"return_outputs,omitempty" json:"return_outputs,omitempty"`
}

type PreparedMobileDevice added in v1.330.0

type PreparedMobileDevice struct {
	RunnerID string `json:"runner_id"`
	// Serial is the adb serial, or the UDID of the run's simulator clone.
	Serial string `json:"serial"`
	Type   string `json:"type"`
	// PackageID is the Android package or the iOS bundle ID.
	PackageID string `json:"package_id"`
	// InstallerPath is the runner-host path of the installed APK or .app.
	InstallerPath string `json:"installer_path"`
}

PreparedMobileDevice is what a run needs to drive the prepared device.

func PrepareMobileDevice added in v1.330.0

func PrepareMobileDevice(
	ctx workflow.Context,
	ao workflow.ActivityOptions,
	settedDevices map[string]any,
	req MobileDeviceRequest,
) (PreparedMobileDevice, error)

PrepareMobileDevice sets up one device and installs a wallet version on it with the same sequence a mobile-automation step uses. The device is recorded in settedDevices before any runner activity, so MobileAutomationCleanupHook cleans it whatever fails afterwards.

type SetupFunc

type SetupFunc func(
	ctx workflow.Context,
	wfDef *pipeline.WorkflowDefinition,
	config map[string]any,
	runData *map[string]any,
	finalOutput *map[string]any,
	logger log.Logger,
) error

type StepDefinition

type StepDefinition pipeline.StepDefinition

type WorkflowDefinition

type WorkflowDefinition pipeline.WorkflowDefinition

Jump to

Keyboard shortcuts

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