Isolate invocation collaborator composition
This commit is contained in:
@@ -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(),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user