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
- func CleanUpDeviceWorkflow(ctx workflow.Context, in mobiledevice.CleanUpInput) (mobiledevice.CleanUpResult, error)
- func ConformanceCheckCleanupHook(ctx workflow.Context, wfDef *pipeline.WorkflowDefinition, ...) error
- func ConformanceCheckSetupHook(ctx workflow.Context, wfDef *pipeline.WorkflowDefinition, ...) error
- func DecodePayload(s *pipeline.StepDefinition) (any, error)
- func DeviceIDsWithGlobal(info PipelineDeviceInfo, globalDeviceID string) []string
- func Execute(s *pipeline.StepDefinition, ctx workflow.Context, globalCfg map[string]any, ...) (any, error)
- func ExecuteEventStepsOnError(ctx workflow.Context, eventSteps []*pipeline.OnErrorStepDefinition, ...) []pipelineStepFailure
- func ExecuteEventStepsOnSuccess(ctx workflow.Context, eventSteps []*pipeline.OnSuccessStepDefinition, ...) []pipelineStepFailure
- func ExecuteOnError(s *pipeline.OnErrorStepDefinition, ctx workflow.Context, ...) (any, error)
- func ExecuteOnSuccess(s *pipeline.OnSuccessStepDefinition, ctx workflow.Context, ...) (any, error)
- func ExecuteStep(id string, use string, with pipeline.StepInputs, ...) (any, error)
- func ExtractPipelineOutput(dataCtx map[string]any) map[string]any
- func GlobalDeviceIDFromConfig(config map[string]any) string
- func MergePayload(dst, src *map[string]any) error
- func MobileAutomationCleanupHook(ctx workflow.Context, _ *pipeline.WorkflowDefinition, ...) error
- func MobileAutomationSetupHook(ctx workflow.Context, wfDef *pipeline.WorkflowDefinition, ...) error
- func MobileDevicesCleanupHook(ctx workflow.Context, wfDef *pipeline.WorkflowDefinition, ...) error
- func NewMobileDeviceService(app core.App) *nexus.Service
- func PipelineEvidenceSetupHook(ctx workflow.Context, wfDef *pipelineinternal.WorkflowDefinition, ...) error
- func PipelineReportCleanupHook(ctx workflow.Context, wfDef *pipelineinternal.WorkflowDefinition, ...) error
- func PrepareActivityOptions(globalAO workflow.ActivityOptions, stepAO *pipeline.ActivityOptionsConfig) workflow.ActivityOptions
- func PrepareDeviceWorkflow(ctx workflow.Context, in mobiledevice.PrepareInput) (mobiledevice.PrepareResult, error)
- func PrepareMobileDevice(ctx workflow.Context, ao workflow.ActivityOptions, ...) (mobiledevice.PreparedMobileDevice, error)
- func PrepareWorkflowOptions(rc pipeline.RuntimeConfig) pipeline.WorkflowOptions
- func ReportMobileDeviceSemaphoreDone(ctx workflow.Context, logger log.Logger, config map[string]any, ...)
- func ResolveDeviceRecord(app core.App, deviceID string, deviceCache map[string]map[string]any) map[string]any
- func ResolveDeviceRecords(app core.App, deviceIDs []string, deviceCache map[string]map[string]any) []map[string]any
- func RunIdentifier(namespace, workflowID, runID string) string
- func SetConfigValue(config *map[string]any, key string, val any)
- func SetPayloadValue(payload *map[string]any, key string, val any) error
- func SetRunDataValue(runData *map[string]any, key string, val any)
- func ValidateDeviceIDYAML(yamlStr string) error
- func ValidateFinallySteps(finallyDef pipeline.FinallyDefinition) error
- type CleanupFunc
- type ConformanceTemplateActivity
- type ConformanceTemplateActivityPayload
- type DebugActivity
- type DebugActivityPayload
- type LinkedStepsWorkflow
- type LinkedStepsWorkflowInput
- type PipelineDeviceInfo
- type PipelineWorkflow
- func (PipelineWorkflow) GetOptions() workflow.ActivityOptions
- func (PipelineWorkflow) Name() string
- func (w *PipelineWorkflow) Start(inputYaml string, config map[string]any, memo map[string]any, ...) (workflowengine.WorkflowResult, error)
- func (w *PipelineWorkflow) Workflow(ctx workflow.Context, input PipelineWorkflowInput) (result workflowengine.WorkflowResult, finalErr error)
- type PipelineWorkflowInput
- type SetupFunc
- type StepDefinition
- type WorkflowDefinition
Constants ¶
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" )
const ( PipelineTaskQueue = "PipelineTaskQueue" PipelineMobileDevicesQuery = "GetPipelineMobileDevices" )
const ( DefaultNameSpace = "default" DefaultExecutionTimeout = "24h" DefaultActivityScheduleTimeout = "10m" DefaultActivityStartTimeout = "5m" DefaultActivityHeartbeatTimeout = "30s" DefaultRetryMaxAttempts = int32(5) DefaultRetryInitialInterval = "5s" DefaultRetryMaxInterval = "1m" DefaultRetryBackoff = 2.0 )
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.
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 CleanUpDeviceWorkflow ¶ added in v1.338.0
func CleanUpDeviceWorkflow( ctx workflow.Context, in mobiledevice.CleanUpInput, ) (mobiledevice.CleanUpResult, error)
CleanUpDeviceWorkflow runs the pipeline's device cleanup on one device in its runner's namespace and returns the evidence it stored and what went wrong. It never fails: the pipeline reports the errors it returns.
func DecodePayload ¶
func DecodePayload(s *pipeline.StepDefinition) (any, error)
func DeviceIDsWithGlobal ¶
func DeviceIDsWithGlobal(info PipelineDeviceInfo, globalDeviceID string) []string
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 ExecuteOnSuccess ¶
func ExecuteStep ¶
func MergePayload ¶
MergePayload merges all keys from src into dst recursively.
func MobileDevicesCleanupHook ¶ added in v1.338.0
func MobileDevicesCleanupHook( ctx workflow.Context, wfDef *pipeline.WorkflowDefinition, ao *workflow.ActivityOptions, config map[string]any, runData map[string]any, output *map[string]any, ) error
MobileDevicesCleanupHook cleans every device the pipeline prepared, except those it borrowed from its parent pipeline, through the Clean up operation of the device's runner namespace, unless the pipeline's cancellation policy skips it, and merges the evidence it stored.
func NewMobileDeviceService ¶ added in v1.338.0
NewMobileDeviceService returns the Nexus service every runner namespace serves: each operation starts one workflow in the runner namespace for a pipeline run of an organization namespace.
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 PrepareActivityOptions ¶
func PrepareActivityOptions( globalAO workflow.ActivityOptions, stepAO *pipeline.ActivityOptionsConfig, ) workflow.ActivityOptions
func PrepareDeviceWorkflow ¶ added in v1.338.0
func PrepareDeviceWorkflow( ctx workflow.Context, in mobiledevice.PrepareInput, ) (mobiledevice.PrepareResult, error)
PrepareDeviceWorkflow prepares one device of a pipeline run in its runner's namespace: it sets the device up for every mobile step that uses it, then disables the Play Store when asked and starts the device log and the recording. When the setup fails it cleans the device before failing. A device the parent pipeline prepared (in.Device) is only prepared for the requests and never cleaned: the parent owns it.
func PrepareMobileDevice ¶ added in v1.330.0
func PrepareMobileDevice( ctx workflow.Context, ao workflow.ActivityOptions, settedDevices map[string]any, req mobiledevice.MobileDeviceRequest, ) (mobiledevice.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.
func PrepareWorkflowOptions ¶
func PrepareWorkflowOptions(rc pipeline.RuntimeConfig) pipeline.WorkflowOptions
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
ResolveDeviceRecord returns the display fields of a mobile device: id, name, canonified_name, type and live_stream. Callers may show them to any organization, so the serial, owner and runner stay out.
func ResolveDeviceRecords ¶
func RunIdentifier ¶
RunIdentifier is the canonical pipeline run identifier used for runner workspaces and artifacts.
func SetPayloadValue ¶
SetPayloadValue sets a key/value pair in the given payload map. If the key exists, it overwrites it; otherwise, it adds it.
func ValidateDeviceIDYAML ¶
ValidateDeviceIDYAML enforces the mobile device_id configuration rule.
func ValidateFinallySteps ¶
func ValidateFinallySteps(finallyDef pipeline.FinallyDefinition) error
Types ¶
type CleanupFunc ¶
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 ¶
func (a *ConformanceTemplateActivity) Execute( _ context.Context, input workflowengine.ActivityInput, ) (workflowengine.ActivityResult, error)
Execute resolves the check's config template, suite extras and StepCI template.
func (*ConformanceTemplateActivity) Name ¶
func (a *ConformanceTemplateActivity) Name() string
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 (a *DebugActivity) Execute( ctx context.Context, input workflowengine.ActivityInput, ) (workflowengine.ActivityResult, error)
func (*DebugActivity) Name ¶
func (a *DebugActivity) Name() string
type DebugActivityPayload ¶
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
func (w *LinkedStepsWorkflow) Workflow( ctx workflow.Context, input LinkedStepsWorkflowInput, ) (workflowengine.WorkflowResult, error)
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 PipelineDeviceInfo ¶
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) GetOptions() workflow.ActivityOptions
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"`
// ParentDevices holds the setted_devices entries the parent pipeline prepared.
// Only a child pipeline reads it: its mobile steps reuse these devices.
ParentDevices map[string]any `yaml:"parent_devices,omitempty" json:"parent_devices,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 StepDefinition ¶
type StepDefinition pipeline.StepDefinition
type WorkflowDefinition ¶
type WorkflowDefinition pipeline.WorkflowDefinition
Source Files
¶
- cli.go
- completion_notification.go
- conformance_checks_hook.go
- conformance_template_activity.go
- debug.go
- device_nexus.go
- device_operations.go
- evidence_setup.go
- execute.go
- github_pr_comment.go
- hooks.go
- linked_steps.go
- mobile_actions.go
- mobile_automation_hooks.go
- mobile_device_ids.go
- pipeline.go
- pipeline_errors.go
- report_cleanup.go
- runners.go
- semaphore_done.go
- step_walker.go
- temp_record_cleanup_hook.go
- temp_wallet_cleanup_hook.go
- utils.go