Use one execution plan throughout the runner

This commit is contained in:
2026-08-29 20:49:43 +00:00
parent 0dc8ff9b52
commit fd5ccc668b
12 changed files with 83 additions and 53 deletions

View File

@@ -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)