Carry dependencies through pipeline commands

This commit is contained in:
2026-09-05 17:53:56 +00:00
parent c3307ab5fb
commit dd905c4daa
13 changed files with 153 additions and 89 deletions

View File

@@ -12,10 +12,15 @@ import (
// Run executes the pipeline plan and persists manifest state.
func Run(ctx context.Context, args []string, out io.Writer) error {
return runWithPipelineExecutor(ctx, args, out, executePlan)
return runWithDependencies(ctx, args, out, executePlan, commandDependencies{})
}
func runWithPipelineExecutor(ctx context.Context, args []string, out io.Writer, executor pipelineExecutor) error {
return runWithDependencies(ctx, args, out, executor, commandDependencies{})
}
func runWithDependencies(ctx context.Context, args []string, out io.Writer, executor pipelineExecutor, deps commandDependencies) error {
deps = normalizeCommandDependencies(deps)
request, err := parseBoundedRunRequest("run", args, out)
if err != nil {
if errors.Is(err, flag.ErrHelp) {
@@ -24,7 +29,7 @@ func runWithPipelineExecutor(ctx context.Context, args []string, out io.Writer,
return err
}
flags := request.Config
loaded, err := loadCommandConfig(ctx, flags.pipelinePath, flags.campaignPath, flags.campaignFilePath, flags.sessionPath, flags.sessionOptions())
loaded, err := loadCommandConfigWithDependencies(ctx, flags.pipelinePath, flags.campaignPath, flags.campaignFilePath, flags.sessionPath, flags.sessionOptions(), deps)
if err != nil {
return fmt.Errorf("run: %w", err)
}