Use one execution plan throughout the runner
This commit is contained in:
@@ -26,7 +26,6 @@ type RunOptions struct {
|
||||
Force bool
|
||||
SelectedArtifacts []string
|
||||
EffectiveArtifacts artifacts.EffectiveArtifactSet
|
||||
Plan BoundedPlan
|
||||
Env *Env
|
||||
RunManifestStore manifest.RunStore
|
||||
}
|
||||
@@ -41,14 +40,15 @@ type RunSummary struct {
|
||||
Skipped []string
|
||||
}
|
||||
|
||||
var executeStagesFn = executeStages
|
||||
var executeStagesFn = executePlan
|
||||
|
||||
func executeStages(ctx context.Context, cfg *config.Config, stages []stage.Stage, opts RunOptions) (summary *RunSummary, resultErr error) {
|
||||
func executePlan(ctx context.Context, cfg *config.Config, plan BoundedPlan, opts RunOptions) (summary *RunSummary, resultErr error) {
|
||||
stages := plan.Stages()
|
||||
var prerequisiteStore manifest.Store
|
||||
if opts.Env != nil {
|
||||
prerequisiteStore = opts.Env.ManifestStore
|
||||
}
|
||||
if err := inspectBoundedPrerequisites(ctx, cfg, opts.Plan, prerequisiteStore); err != nil {
|
||||
if err := inspectBoundedPrerequisites(ctx, cfg, plan, prerequisiteStore); err != nil {
|
||||
return nil, fmt.Errorf("validate bounded run prerequisites: %w", err)
|
||||
}
|
||||
effectiveArtifacts := opts.EffectiveArtifacts
|
||||
@@ -143,7 +143,7 @@ func executeStages(ctx context.Context, cfg *config.Config, stages []stage.Stage
|
||||
// already-invalid request. Recheck the manifest protected by the session
|
||||
// lock because another invocation may have changed prerequisite state while
|
||||
// this invocation waited to acquire the lock.
|
||||
if err := validateBoundedPrerequisites(opts.Plan, m); err != nil {
|
||||
if err := validateBoundedPrerequisites(plan, m); err != nil {
|
||||
return nil, fmt.Errorf("validate bounded run prerequisites under session lock: %w", err)
|
||||
}
|
||||
identity.applyToSessionManifest(m)
|
||||
|
||||
Reference in New Issue
Block a user