Isolate invocation collaborator composition

This commit is contained in:
2026-09-04 01:11:11 +00:00
parent e0f19833a1
commit 8afe9427ca
10 changed files with 255 additions and 130 deletions

View File

@@ -31,9 +31,10 @@ type invocationRuntime struct {
stageNames []string
executed []string
skipped []string
dependencies invocationDependencies
}
func prepareInvocation(ctx context.Context, cfg *config.Config, plan BoundedPlan, opts RunOptions) (*invocationRuntime, error) {
func prepareInvocation(ctx context.Context, cfg *config.Config, plan BoundedPlan, opts RunOptions, dependencies invocationDependencies) (*invocationRuntime, error) {
var prerequisiteStore manifest.Store
if opts.Env != nil {
prerequisiteStore = opts.Env.ManifestStore
@@ -58,7 +59,7 @@ func prepareInvocation(ctx context.Context, cfg *config.Config, plan BoundedPlan
}
}
runID, err := artifacts.NewRunID()
runID, err := dependencies.newRunID()
if err != nil {
return nil, fmt.Errorf("generate run id: %w", err)
}
@@ -107,9 +108,10 @@ func prepareInvocation(ctx context.Context, cfg *config.Config, plan BoundedPlan
identity.Campaign,
identity.SessionID,
),
stageNames: make([]string, 0, len(stages)),
executed: make([]string, 0, len(stages)),
skipped: make([]string, 0, len(stages)),
stageNames: make([]string, 0, len(stages)),
executed: make([]string, 0, len(stages)),
skipped: make([]string, 0, len(stages)),
dependencies: dependencies,
}, nil
}
@@ -171,5 +173,6 @@ func (runtime *invocationRuntime) persistTerminalFailure(err error) error {
runtime.manifestPath,
runtime.manifest,
err,
runtime.dependencies.now(),
)
}