Propagate cancellation and preserve resumable state

This commit is contained in:
2026-11-20 05:53:49 +00:00
parent a6c6f1e4ab
commit c7a5ff316d
21 changed files with 356 additions and 27 deletions

View File

@@ -93,6 +93,9 @@ func planSelectedPipeline(ctx context.Context, input *executionInput, deps comma
}
func buildSessionPlan(ctx context.Context, cfg *config.Config, input *executionInput, selectedArtifacts []string, effective artifacts.EffectiveArtifactSet) (*sessionPlanReport, error) {
if err := ctx.Err(); err != nil {
return nil, err
}
m, err := loadManifestIfPresent(ctx, cfg)
if err != nil {
return nil, fmt.Errorf("plan: %w", err)
@@ -114,6 +117,9 @@ func buildSessionPlan(ctx context.Context, cfg *config.Config, input *executionI
report := &sessionPlanReport{Campaign: config.CampaignID(cfg.Campaign), SessionID: cfg.Session.SessionID, Stages: []plannedStage{}, Publication: []plannedPublication{}}
for _, selectedStage := range stages {
if err := ctx.Err(); err != nil {
return report, err
}
semanticConfig, err := currentStageSemanticConfig(selectedStage, stageEnv)
if err != nil {
return nil, fmt.Errorf("plan: fingerprint semantic configuration for stage %q: %w", selectedStage.Name(), err)
@@ -176,5 +182,5 @@ func buildSessionPlan(ctx context.Context, cfg *config.Config, input *executionI
report.Publication = append(report.Publication, plannedPublication{Source: action.Source, Destination: action.Destination, Required: action.Required, Selected: action.Selected})
}
}
return report, nil
return report, ctx.Err()
}