Preserve smoke observer failures independently of readiness

This commit is contained in:
2026-11-28 16:10:49 +00:00
parent 33e8309322
commit f4951b9bde
5 changed files with 60 additions and 6 deletions

View File

@@ -62,7 +62,6 @@ func executePreflight(invocation commandkit.Invocation, input pipelineRunInput,
report.Checks = append(report.Checks, preflightCheck{ID: id, Scope: scope, Result: result, Message: message})
}
finish := func(outcome commandkit.Outcome) commandkit.Outcome {
report.Ready = outcome.Status == 0
report.DebugDirectory = capture.Path()
if err := capture.Finalize(report, outcome.Cause); err != nil {
if outcome.Status == 0 {
@@ -200,8 +199,10 @@ func executePreflight(invocation commandkit.Invocation, input pipelineRunInput,
add(string(observation.Kind), scope, "passed", fmt.Sprintf("%s check passed for profile %q.", observation.Kind, observation.ProfileID))
}
}
// Recording failure is independent of a completed diagnostic assessment.
report.Ready = !failedCheck && len(observations) == 2*len(targets.Access)+len(targets.Profiles) && ctx.Err() == nil
if err != nil {
if !failedCheck {
if !failedCheck && !report.Ready {
if capture.Err() != nil {
add("debug", preflightScope{Path: capture.Path()}, "failed", err.Error())
} else {