feat: recover interrupted installation preparation safely

This commit is contained in:
Codex
2026-10-06 19:02:01 +02:00
parent 5c05778614
commit af6cf88b5a
32 changed files with 497 additions and 37 deletions
+6 -1
View File
@@ -52,6 +52,11 @@ type journal struct {
Status string `json:"status"`
}
func (r Result) NeedsReview() bool {
return (r.WorkspacePreparation != nil && r.WorkspacePreparation.Code == "schema_review_required") ||
(r.BindingImport != nil && r.BindingImport.Code == "schema_review_required")
}
// Check must repeat document validation and live prerequisite probes at the public CLI boundary.
// It is mandatory; historical success in the plan never authorizes skipping current checks.
type Check func(context.Context, preflight.Plan) error
@@ -255,7 +260,7 @@ func Run(ctx context.Context, request Request, runner compose.Runner, check Chec
// A journal entry alone is never proof that a container or migration still exists.
for _, stage := range stages {
if err := operation(stage.name, stage.run); err != nil {
if result.WorkspacePreparation != nil && result.WorkspacePreparation.Code == "schema_review_required" {
if result.NeedsReview() {
return fail(stage.name, "Review the pending schema synchronization in application Administration, then repeat apply. No destructive change was confirmed by the installer.")
}
return fail(stage.name, err.Error())