workflow

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package workflow provides shared orchestration logic for module discovery, filtering, dependency extraction, and graph building.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFilters added in v0.10.0

func ApplyFilters(cfg *config.Config, ff *filter.Flags, modules []*discovery.Module) []*discovery.Module

ApplyFilters applies config and CLI filters to a module list.

func MergedFilterOptions added in v0.10.0

func MergedFilterOptions(cfg *config.Config, ff *filter.Flags) filter.Options

MergedFilterOptions merges config defaults with CLI filter flags.

func ResolveTargets added in v0.10.0

func ResolveTargets(ctx context.Context, workDir string, cfg *config.Config, result *Result, opts TargetSelectionOptions) ([]*discovery.Module, error)

ResolveTargets applies module/path filters and optional change detection to a workflow result.

Types

type ChangeDetector added in v0.10.0

type ChangeDetector = plugin.ChangeDetectionProvider

ChangeDetector aliases plugin.ChangeDetectionProvider so target selection accepts any plugin implementing the change-detection capability without re-declaring the interface here.

type ChangeDetectorResolver added in v0.10.0

type ChangeDetectorResolver func() (ChangeDetector, error)

ChangeDetectorResolver resolves the change detection provider for changed-only target selection.

type ModuleSet added in v0.10.0

type ModuleSet struct {
	Modules []*discovery.Module
	Index   *discovery.ModuleIndex
}

ModuleSet keeps a module slice and its lookup index together.

func NewModuleSet added in v0.10.0

func NewModuleSet(modules []*discovery.Module) ModuleSet

NewModuleSet builds a consistent module collection and lookup index.

func (ModuleSet) All added in v0.10.0

func (s ModuleSet) All() []*discovery.Module

All returns modules in their workflow order.

func (ModuleSet) ByID added in v0.10.0

func (s ModuleSet) ByID(id string) *discovery.Module

ByID returns a module by workflow ID.

type Options

type Options struct {
	WorkDir  string
	Segments []string

	Excludes       []string
	Includes       []string
	SegmentFilters map[string][]string
}

Options configures module discovery, filtering, and graph building.

func OptionsFromConfig added in v0.10.0

func OptionsFromConfig(workDir string, cfg *config.Config, ff *filter.Flags) Options

OptionsFromConfig builds workflow options from configuration and CLI filters.

type Result

type Result struct {
	All      ModuleSet
	Filtered ModuleSet

	Graph        *graph.DependencyGraph
	Dependencies map[string]*parser.ModuleDependencies
	Warnings     []error
}

Result contains everything produced by the module workflow.

func Run

func Run(ctx context.Context, opts Options) (*Result, error)

Run executes the full module workflow: scan → filter → parse → build graph.

type TargetSelectionOptions added in v0.10.0

type TargetSelectionOptions struct {
	ModulePath  string
	ChangedOnly bool
	BaseRef     string
	Filters     *filter.Flags

	ChangeDetectorResolver ChangeDetectorResolver
}

TargetSelectionOptions controls how executable targets are selected from a workflow result.

Jump to

Keyboard shortcuts

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