Implement resume, skip, and stage selection

This commit is contained in:
2026-05-02 11:38:42 -05:00
parent 77f421feef
commit bec784f1ec
11 changed files with 518 additions and 23 deletions

View File

@@ -29,6 +29,8 @@ type RunSummary struct {
SessionID string
ManifestPath string
StageNames []string
Executed []string
Skipped []string
}
func executeStages(ctx context.Context, cfg *config.Config, stages []stage.Stage, opts RunOptions) (*RunSummary, error) {
@@ -89,12 +91,21 @@ func executeStages(ctx context.Context, cfg *config.Config, stages []stage.Stage
stageEnv := toStageEnv(env)
_ = opts.Force // TODO: use --force behavior in future skip/stale logic.
decisions := decideStageActions(stages, m, opts.Force)
runNames := make([]string, 0, len(stages))
for _, s := range stages {
runNames := make([]string, 0, len(decisions))
executed := make([]string, 0, len(decisions))
skipped := make([]string, 0, len(decisions))
for _, d := range decisions {
s := d.Stage
runNames = append(runNames, s.Name())
if d.Action == stageActionSkip {
skipped = append(skipped, s.Name())
continue
}
executed = append(executed, s.Name())
now := nowUTC()
m.MarkStageRunning(s.Name(), now)
if err := env.ManifestStore.Save(ctx, manifestPath, m); err != nil {
@@ -123,6 +134,8 @@ func executeStages(ctx context.Context, cfg *config.Config, stages []stage.Stage
SessionID: cfg.Session.SessionID,
ManifestPath: manifestPath,
StageNames: runNames,
Executed: executed,
Skipped: skipped,
}, nil
}